mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Do not add previous_transaction_reference
for PayPal payment method
This commit is contained in:
parent
fe08c2d4f4
commit
83ae24eae8
1 changed files with 12 additions and 1 deletions
|
@ -107,8 +107,19 @@ class SubscriptionModule implements ModuleInterface {
|
|||
function( array $data ) use ( $c ) {
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||
$wc_order_action = wc_clean( wp_unslash( $_POST['wc_order_action'] ?? '' ) );
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
||||
$subscription_id = wc_clean( wp_unslash( $_POST['post_ID'] ?? '' ) );
|
||||
if ( ! $subscription_id ) {
|
||||
return $data;
|
||||
}
|
||||
$subscription = wc_get_order( $subscription_id );
|
||||
if ( ! is_a( $subscription, WC_Subscription::class ) ) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
if (
|
||||
$wc_order_action === 'wcs_process_renewal'
|
||||
$wc_order_action === 'wcs_process_renewal' && $subscription->get_payment_method() === CreditCardGateway::ID
|
||||
&& isset( $data['payment_source']['token'] ) && $data['payment_source']['token']['type'] === 'PAYMENT_METHOD_TOKEN'
|
||||
&& isset( $data['payment_source']['token']['source']->card )
|
||||
) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue