updated plugin Easy Digital Downloads version 3.1.0.4

This commit is contained in:
2023-01-18 16:39:57 +00:00
committed by Gitium
parent ae8dabbd21
commit 6f8f73e860
77 changed files with 2262 additions and 681 deletions

View File

@ -280,8 +280,12 @@ function get_order_items( $purchase_data ) {
if ( $item_amount <= 0 ) {
$item_amount = 0;
}
$substr_func = function_exists( 'mb_substr' ) ? 'mb_substr' : 'substr';
$name = $substr_func( edd_get_cart_item_name( $item ), 0, 127 );
$items[ $i ] = array(
'name' => stripslashes_deep( html_entity_decode( substr( edd_get_cart_item_name( $item ), 0, 127 ), ENT_COMPAT, 'UTF-8' ) ),
'name' => stripslashes_deep( html_entity_decode( $name, ENT_COMPAT, 'UTF-8' ) ),
'quantity' => $item['quantity'],
'unit_amount' => array(
'currency_code' => edd_get_currency(),

View File

@ -13,6 +13,7 @@
namespace EDD\Gateways\PayPal\IPN;
use EDD\Gateways\PayPal;
/**
* Listens for an IPN call from PayPal
*
@ -25,6 +26,11 @@ function listen_for_ipn() {
return;
}
// If PayPal is not connected, we don't need to run here.
if ( ! PayPal\has_rest_api_connection() ) {
return;
}
ipn_debug_log( 'IPN Backup Loaded' );
// Moving this up in the load order so we can check some things before even getting to verification.
@ -174,7 +180,7 @@ function listen_for_ipn() {
// Bail if this is the very first payment.
if ( date( 'Y-n-d', strtotime( $subscription->created ) ) == date( 'Y-n-d', strtotime( $posted['payment_date'] ) ) ) {
if ( ! empty( $posted['payment_date'] ) && date( 'Y-n-d', strtotime( $subscription->created ) ) == date( 'Y-n-d', strtotime( $posted['payment_date'] ) ) ) {
ipn_debug_log( 'IPN for subscription ' . $subscription->id . ': processing stopped because this is the initial payment.' );
return;
}