updated plugin Easy Digital Downloads
version 3.1.1.2
This commit is contained in:
@ -48,7 +48,7 @@ function connect_settings_field() {
|
||||
<?php
|
||||
echo wp_kses( sprintf(
|
||||
/* Translators: %1$s opening <strong> tag; %2$s closing </strong> tag */
|
||||
__( '%1$sConnection failure:%2$s Please ensure browser popups are enabled then click the button below to connect again. If you continue to experience this error, please contact support.', 'easy-digital-downloads' ),
|
||||
__( '%1$sConnection failure:%2$s This is most likely due to your browser blocking the connection. Most store owners have the best success with Chrome, but for some reason, a few select browsers/devices prevent the connection from EDD and PayPal from working. You might have to enable popups, then restart your browser. If that doesn\'t work, please try a different browser or device and see if that works. If you continue to experience this error, please contact support.', 'easy-digital-downloads' ),
|
||||
'<strong>',
|
||||
'</strong>'
|
||||
), array( 'strong' => array() ) );
|
||||
@ -114,7 +114,8 @@ function process_connect() {
|
||||
'country_code' => edd_get_shop_country(),
|
||||
'currency_code' => edd_get_currency(),
|
||||
'return_url' => get_settings_url()
|
||||
) )
|
||||
) ),
|
||||
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
|
||||
) );
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
@ -245,7 +246,8 @@ function get_and_save_credentials() {
|
||||
'grant_type' => 'authorization_code',
|
||||
'code' => $_POST['auth_code'],
|
||||
'code_verifier' => $partner_details->nonce
|
||||
)
|
||||
),
|
||||
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
|
||||
) );
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
@ -272,7 +274,8 @@ function get_and_save_credentials() {
|
||||
'Authorization' => sprintf( 'Bearer %s', $body->access_token ),
|
||||
'Content-Type' => 'application/json',
|
||||
'timeout' => 15
|
||||
)
|
||||
),
|
||||
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
|
||||
) );
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
@ -748,7 +751,8 @@ function get_merchant_status( $merchant_id, $nonce = '' ) {
|
||||
'mode' => edd_is_test_mode() ? API::MODE_SANDBOX : API::MODE_LIVE,
|
||||
'merchant_id' => $merchant_id,
|
||||
'nonce' => $nonce
|
||||
) )
|
||||
) ),
|
||||
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
|
||||
) );
|
||||
|
||||
$response_code = wp_remote_retrieve_response_code( $response );
|
||||
|
@ -52,7 +52,7 @@ add_action( 'admin_notices', function () {
|
||||
echo wp_kses( sprintf(
|
||||
/* Translators: %1$s opening anchor tag; %2$s closing anchor tag */
|
||||
__( 'A new, improved PayPal experience is now available in Easy Digital Downloads. You can learn more about the new integration in %1$sour documentation%2$s.', 'easy-digital-downloads' ),
|
||||
'<a href="https://docs.easydigitaldownloads.com/article/2410-paypal#migration" target="_blank">',
|
||||
'<a href="https://easydigitaldownloads.com/docs/paypal-setup/#upgrade" target="_blank">',
|
||||
'</a>'
|
||||
), array( 'a' => array( 'href' => true, 'target' => true ) ) );
|
||||
?>
|
||||
|
@ -135,7 +135,7 @@ function documentation_settings_field() {
|
||||
<?php
|
||||
echo wp_kses( sprintf(
|
||||
__( 'To learn more about the PayPal gateway, visit <a href="%s" target="_blank">our documentation</a>.', 'easy-digital-downloads' ),
|
||||
'https://docs.easydigitaldownloads.com/article/2410-paypal'
|
||||
'https://easydigitaldownloads.com/docs/paypal-setup/'
|
||||
), array( 'a' => array( 'href' => true, 'target' => true ) ) )
|
||||
?>
|
||||
</p>
|
||||
@ -147,7 +147,7 @@ function documentation_settings_field() {
|
||||
<?php
|
||||
echo wp_kses( sprintf(
|
||||
__( 'PayPal requires an SSL certificate to accept payments. You can learn more about obtaining an SSL certificate in our <a href="%s" target="_blank">SSL setup article</a>.', 'easy-digital-downloads' ),
|
||||
'https://docs.easydigitaldownloads.com/article/994-how-to-set-up-ssl'
|
||||
'https://easydigitaldownloads.com/docs/do-i-need-an-ssl-certificate/'
|
||||
), array( 'a' => array( 'href' => true, 'target' => true ) ) );
|
||||
?>
|
||||
</p>
|
||||
|
@ -194,7 +194,8 @@ class API {
|
||||
),
|
||||
'body' => array(
|
||||
'grant_type' => 'client_credentials'
|
||||
)
|
||||
),
|
||||
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
|
||||
) );
|
||||
|
||||
$body = json_decode( wp_remote_retrieve_body( $response ) );
|
||||
|
@ -115,6 +115,7 @@ function listen_for_ipn() {
|
||||
'post' => '/cgi-bin/webscr HTTP/1.1',
|
||||
|
||||
),
|
||||
'user-agent' => 'Easy Digital Downloads/' . EDD_VERSION . '; ' . get_bloginfo( 'name' ),
|
||||
);
|
||||
|
||||
// Get response.
|
||||
@ -244,14 +245,29 @@ function listen_for_ipn() {
|
||||
|
||||
ipn_debug_log( 'subscription ' . $subscription->id . ': preparing to insert renewal payment' );
|
||||
|
||||
// when a user makes a recurring payment.
|
||||
$payment_id = $subscription->add_payment(
|
||||
array(
|
||||
'amount' => $amount,
|
||||
'transaction_id' => $transaction_id,
|
||||
)
|
||||
// Build the array for adding a subscription order.
|
||||
$subscription_payment_args = array(
|
||||
'amount' => $amount,
|
||||
'transaction_id' => $transaction_id,
|
||||
);
|
||||
|
||||
// Create a DateTime object of the payment_date, so we can adjust as needed.
|
||||
$subscription_payment_date = new \DateTime( $posted['payment_date'] );
|
||||
|
||||
// To make sure we don't inadverntatly fail, make sure the date was parsed correctly before working with it.
|
||||
if ( $subscription_payment_date instanceof \DateTime ) {
|
||||
/**
|
||||
* Convert to GMT, as that is what EDD 3.0 expects the times to be in.
|
||||
*/
|
||||
$subscription_payment_date->setTimezone( new \DateTimeZone( 'GMT' ) );
|
||||
|
||||
// Now add the date into the arguments for creating the renewal payment.
|
||||
$subscription_payment_args['date'] = $subscription_payment_date->format( 'Y-m-d H:i:s' );
|
||||
}
|
||||
|
||||
// when a user makes a recurring payment.
|
||||
$payment_id = $subscription->add_payment( $subscription_payment_args );
|
||||
|
||||
if ( ! empty( $payment_id ) ) {
|
||||
ipn_debug_log( 'subscription ' . $subscription->id . ': renewal payment was recorded successfully, preparing to renew subscription' );
|
||||
$subscription->renew( $payment_id );
|
||||
|
Reference in New Issue
Block a user