Loading commerce_paypal.module +30 −7 Changes for commerce_paypal.module: 30 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -274,6 +274,35 @@ function commerce_paypal_form_commerce_payment_method_add_form_alter(&$form, For unset($form["payment_method"]["#options"]["new--paypal_checkout--paypal"]); } /** * Returns the list of funding sources to be enabled or disabled. * * The full list can be found at: * https://developer.paypal.com/sdk/js/configuration/#enable-funding. * * @return array * Machine name as key and translated label as value. */ function commerce_paypal_get_funding_sources() { return [ 'paypal' => t('PayPal'), 'card' => t('Credit or debit card'), 'credit' => t('PayPal Credit'), 'paylater' => t('Pay Later'), 'bancontact' => t('Bancontact'), 'blik' => t('BLIK'), 'eps' => t('eps'), 'giropay' => t('giropay'), 'ideal' => t('iDEAL'), 'mercadopago' => t('Mercado Pago'), 'mybank' => t('MyBank'), 'p24' => t('Przelewy24'), 'sepa' => t('SEPA-Lastschrift'), 'sofort' => t('Sofort'), 'venmo' => t('Venmo'), ]; } /** * Returns the label to use for a PayPal funding source. * Loading @@ -284,13 +313,7 @@ function commerce_paypal_form_commerce_payment_method_add_form_alter(&$form, For * The label to show a customer for the funding source. */ function commerce_paypal_funding_source_label($funding_source) { $funding_sources = [ 'card' => t('Credit or debit card'), 'credit' => t('PayPal Credit'), 'paylater' => t('Pay Later'), 'paypal' => t('PayPal'), 'venmo' => t('Venmo'), ]; $funding_sources = commerce_paypal_get_funding_sources(); return $funding_sources[$funding_source] ?? ''; } Loading src/Plugin/Commerce/PaymentGateway/Checkout.php +1 −9 Changes for src/Plugin/Commerce/PaymentGateway/Checkout.php: 1 added line, 9 removed lines. Original line number Diff line number Diff line Loading @@ -194,15 +194,7 @@ class Checkout extends OffsitePaymentGatewayBase implements CheckoutInterface { '#title' => $this->t('Disable funding sources'), '#description' => $this->t('The disabled funding sources for the transaction. Any funding sources passed do not display with Smart Payment Buttons. By default, funding source eligibility is smartly decided based on a variety of factors.'), '#type' => 'checkboxes', '#options' => [ 'card' => $this->t('Credit or debit cards'), 'giropay' => $this->t('Giropay'), 'mybank' => $this->t('MyBank'), 'credit' => $this->t('PayPal Credit'), 'sepa' => $this->t('SEPA-Lastschrift'), 'sofort' => $this->t('Sofort'), 'venmo' => $this->t('Venmo'), ], '#options' => commerce_paypal_get_funding_sources(), '#default_value' => $this->configuration['disable_funding'], '#states' => $spb_states, ]; Loading Loading
commerce_paypal.module +30 −7 Changes for commerce_paypal.module: 30 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -274,6 +274,35 @@ function commerce_paypal_form_commerce_payment_method_add_form_alter(&$form, For unset($form["payment_method"]["#options"]["new--paypal_checkout--paypal"]); } /** * Returns the list of funding sources to be enabled or disabled. * * The full list can be found at: * https://developer.paypal.com/sdk/js/configuration/#enable-funding. * * @return array * Machine name as key and translated label as value. */ function commerce_paypal_get_funding_sources() { return [ 'paypal' => t('PayPal'), 'card' => t('Credit or debit card'), 'credit' => t('PayPal Credit'), 'paylater' => t('Pay Later'), 'bancontact' => t('Bancontact'), 'blik' => t('BLIK'), 'eps' => t('eps'), 'giropay' => t('giropay'), 'ideal' => t('iDEAL'), 'mercadopago' => t('Mercado Pago'), 'mybank' => t('MyBank'), 'p24' => t('Przelewy24'), 'sepa' => t('SEPA-Lastschrift'), 'sofort' => t('Sofort'), 'venmo' => t('Venmo'), ]; } /** * Returns the label to use for a PayPal funding source. * Loading @@ -284,13 +313,7 @@ function commerce_paypal_form_commerce_payment_method_add_form_alter(&$form, For * The label to show a customer for the funding source. */ function commerce_paypal_funding_source_label($funding_source) { $funding_sources = [ 'card' => t('Credit or debit card'), 'credit' => t('PayPal Credit'), 'paylater' => t('Pay Later'), 'paypal' => t('PayPal'), 'venmo' => t('Venmo'), ]; $funding_sources = commerce_paypal_get_funding_sources(); return $funding_sources[$funding_source] ?? ''; } Loading
src/Plugin/Commerce/PaymentGateway/Checkout.php +1 −9 Changes for src/Plugin/Commerce/PaymentGateway/Checkout.php: 1 added line, 9 removed lines. Original line number Diff line number Diff line Loading @@ -194,15 +194,7 @@ class Checkout extends OffsitePaymentGatewayBase implements CheckoutInterface { '#title' => $this->t('Disable funding sources'), '#description' => $this->t('The disabled funding sources for the transaction. Any funding sources passed do not display with Smart Payment Buttons. By default, funding source eligibility is smartly decided based on a variety of factors.'), '#type' => 'checkboxes', '#options' => [ 'card' => $this->t('Credit or debit cards'), 'giropay' => $this->t('Giropay'), 'mybank' => $this->t('MyBank'), 'credit' => $this->t('PayPal Credit'), 'sepa' => $this->t('SEPA-Lastschrift'), 'sofort' => $this->t('Sofort'), 'venmo' => $this->t('Venmo'), ], '#options' => commerce_paypal_get_funding_sources(), '#default_value' => $this->configuration['disable_funding'], '#states' => $spb_states, ]; Loading