Skip to content

Commit

Permalink
Add Venmo vaulting payment_source parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosilva-pt committed Jan 15, 2024
1 parent 751edc8 commit 36887ab
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions modules/ppcp-save-payment-methods/src/SavePaymentMethodsModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,30 @@ function( array $data, string $payment_method, array $request_data ): array {
}

if ( $payment_method === PayPalGateway::ID ) {
$data['payment_source'] = array(
'paypal' => array(
'attributes' => array(
'vault' => array(
'store_in_vault' => 'ON_SUCCESS',
'usage_type' => 'MERCHANT',

if ( $request_data['funding_source'] === 'venmo' ) {
$data['payment_source'] = array(
'venmo' => array(
'attributes' => array(
'vault' => array(
'store_in_vault' => 'ON_SUCCESS',
'usage_type' => 'MERCHANT',
),
),
),
),
);
);
} else {
$data['payment_source'] = array(
'paypal' => array(
'attributes' => array(
'vault' => array(
'store_in_vault' => 'ON_SUCCESS',
'usage_type' => 'MERCHANT',
),
),
),
);
}
}

return $data;
Expand Down

0 comments on commit 36887ab

Please sign in to comment.