Skip to content
Snippets Groups Projects
Commit 6d13dec0 authored by mattwire's avatar mattwire
Browse files

Add setting for Stripe Checkout payment methods and enable Card/SEPA

parent 26256969
Branches
Tags
1 merge request!217Implement Stripe Checkout (with support for SEPA and ACH)
......@@ -179,6 +179,7 @@ class CRM_Core_Payment_StripeCheckout extends CRM_Core_Payment_Stripe {
'customer' => $stripeCustomerID,
// 'submit_type' => one of 'auto', pay, book, donate
'client_reference_id' => $propertyBag->getInvoiceID(),
'payment_method_types' => \Civi::settings()->get('stripe_checkout_supported_payment_methods'),
];
$checkoutSession = $this->stripeClient->checkout->sessions->create($checkoutSessionParams);
......
......@@ -9,6 +9,8 @@
+--------------------------------------------------------------------+
*/
use CRM_Stripe_ExtensionUtil as E;
class CRM_Stripe_Api {
/**
......@@ -251,4 +253,37 @@ class CRM_Stripe_Api {
return substr($civiCRMLocale,0, 2);
}
public static function getListOfSupportedPaymentMethodsCheckout() {
return [
'card' => E::ts('Card'),
// 'acss_debit',
// 'affirm',
// 'afterpay_clearpay',
// 'alipay',
// 'au_becs_debit',
// 'bacs_debit',
// 'bancontact',
// 'blik',
// 'boleto',
// 'cashapp',
// 'customer_balance',
// 'eps',
// 'fpx',
// 'giropay',
// 'grabpay',
// 'ideal',
// 'klarna',
// 'konbini',
// 'oxxo',
// 'p24',
// 'paynow',
// 'pix',
// 'promptpay',
'sepa_debit' => E::ts('SEPA Direct Debit'),
// 'sofort',
//'us_bank_account',
// 'wechat_pay',
];
}
}
......@@ -102,7 +102,7 @@ If this is empty the "suffix" will be generated by CiviCRM using the information
'default' => '',
'is_domain' => 1,
'is_contact' => 0,
'title' => E::ts('Country where your account is registered'),
'title' => E::ts('Country where your account is registered (ONLY set if you want to enable Google/Apple pay)'),
'description' => E::ts('If this is empty the <a href="%2" target="_blank">paymentRequest</a> button will not be enabled. If set, the <a href="%2" target="_blank">paymentRequest</a> button will be shown instead of the card element if supported by the client browser.
Required by the paymentRequest button. 2-character code (eg. "US") that can be found <a href="%1" target="_blank">here</a>.',
[
......@@ -112,7 +112,7 @@ Required by the paymentRequest button. 2-character code (eg. "US") that can be f
'html_attributes' => [],
'settings_pages' => [
'stripe' => [
'weight' => 30,
'weight' => 130,
]
],
],
......@@ -231,4 +231,25 @@ Do NOT enable unless you\'ve enabled this feature on your Stripe account - see <
]
],
],
'stripe_checkout_supported_payment_methods' => [
'name' => 'stripe_checkout_supported_payment_methods',
'type' => 'Array',
'html_type' => 'select',
'html_attributes' => [
'multiple' => TRUE,
'class' => 'crm-select2',
],
'required' => TRUE,
'pseudoconstant' => ['callback' => 'CRM_Stripe_Api::getListOfSupportedPaymentMethodsCheckout'],
'default' => ['card'],
'title' => E::ts('Supported payment methods for Stripe Checkout'),
'is_domain' => 1,
'is_contact' => 0,
'description' => E::ts('Link and Google/Apple Pay are controlled via your Stripe Dashboard. Payment method will only appear if all criteria are met (eg. for SEPA currency must be EUR)'),
'settings_pages' => [
'stripe' => [
'weight' => 30,
],
],
],
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment