Skip to content

Commit

Permalink
feat: set paypal order id and subscription id correctely
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinderk committed Aug 19, 2023
1 parent 13897da commit 0839c6a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/PaymentGateways/Gateways/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ private function registerGateways()


add_filter("givewp_create_payment_gateway_data_" . PayPalCommerceGateway::id(), function ($gatewayData) {
$gatewayData['payPalOrderId'] = $gatewayData['payPalOrderId'] ?? give_clean($_POST['payPalOrderId']);
$gatewayData['payPalOrderId'] = $gatewayData['payPalOrderId']
?? give_clean($_POST['gatewayData']['payPalOrderId']);
return $gatewayData;
});

add_filter('givewp_create_subscription_gateway_data_' . PayPalCommerceGateway::id(), function ($gatewayData) {
$gatewayData['payPalSubscriptionId'] = $gatewayData['payPalSubscriptionId']
?? give_clean($_POST['gatewayData']['payPalSubscriptionId']);
return $gatewayData;
});

Expand Down

0 comments on commit 0839c6a

Please sign in to comment.