Merge pull request #1972 from woocommerce/fix-funding-source-warning

Fix warning undefined funding_source.
This commit is contained in:
Emili Castells 2024-01-18 12:12:58 +01:00 committed by GitHub
commit 08511ba5d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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 && $funding_source === 'venmo' ) {
$data['payment_source'] = array(
'venmo' => array(
'attributes' => array(