Fix warning

This commit is contained in:
Pedro Silva 2024-01-18 10:39:49 +00:00
parent 4c04144c23
commit 7f3d74c8c8
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3

View file

@ -106,8 +106,9 @@ class SavePaymentMethodsModule implements ModuleInterface {
}
if ( $payment_method === PayPalGateway::ID ) {
$funding_source = $request_data['funding_source'] ?? null;
if ( $request_data['funding_source'] === 'venmo' ) {
if ( $funding_source === 'venmo' ) {
$data['payment_source'] = array(
'venmo' => array(
'attributes' => array(
@ -118,6 +119,20 @@ class SavePaymentMethodsModule implements ModuleInterface {
),
),
);
} else if ( $funding_source === 'apple_pay' ) {
$data['payment_source'] = array(
'apple_pay' => array(
'stored_credential' => array(
'payment_initiator' => 'CUSTOMER',
'payment_type' => 'RECURRING',
),
'attributes' => array(
'vault' => array(
'store_in_vault' => 'ON_SUCCESS',
),
),
),
);
} else {
$data['payment_source'] = array(
'paypal' => array(