diff --git a/system/modules/isotope/dca/tl_iso_payment.php b/system/modules/isotope/dca/tl_iso_payment.php index 48e559b973..7822509228 100644 --- a/system/modules/isotope/dca/tl_iso_payment.php +++ b/system/modules/isotope/dca/tl_iso_payment.php @@ -103,7 +103,7 @@ 'paybyway' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},paybyway_merchant_id,paybyway_private_key;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled,debug,logging', 'paypal' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},paypal_account;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled,debug,logging', 'paypal_plus' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},paypal_client,paypal_secret;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled,debug,logging', - 'paypal_checkout' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},paypal_client,paypal_secret;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled,debug,logging', + 'paypal_checkout' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},paypal_client,paypal_secret,paypal_enable_funding;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled,debug,logging', 'postfinance' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},psp_pspid,psp_http_method,psp_hash_method,psp_hash_in,psp_hash_out,psp_dynamic_template,psp_payment_method;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled,debug,logging', 'viveum' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},psp_pspid,psp_http_method,psp_hash_method,psp_hash_in,psp_hash_out,psp_dynamic_template,psp_payment_method;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled,debug,logging', 'datatrans' => '{type_legend},name,label,type;{note_legend:hide},note;{config_legend},new_order_status,trans_type,quantity_mode,minimum_quantity,maximum_quantity,minimum_total,maximum_total,countries,shipping_modules,product_types,product_types_condition,config_ids;{gateway_legend},datatrans_id,datatrans_sign,datatrans_hash_method,datatrans_hash_convert;{price_legend:hide},price,tax_class;{expert_legend:hide},guests,protected;{enabled_legend},enabled,debug,logging', @@ -344,6 +344,18 @@ 'eval' => array('mandatory'=>true, 'maxlength'=>128, 'hideInput'=>true, 'tl_class'=>'w50'), 'sql' => "varchar(128) NOT NULL default ''", ), + 'paypal_enable_funding' => array + ( + 'exclude' => true, + 'inputType' => 'select', + 'options' => \Isotope\Model\Payment\PaypalCheckout::$enableFundingParameters, + 'options_callback' => function() { + return \Isotope\Model\Payment\PaypalCheckout::getEnableFundingOptions(); + }, + 'reference' => &$GLOBALS['TL_LANG']['tl_iso_payment']['paypal_enable_funding'], + 'eval' => array('multiple'=>true, 'size'=>8, 'tl_class'=>'w50 w50h', 'chosen'=>true), + 'sql' => "blob NULL", + ), 'psp_pspid' => array ( 'exclude' => true, diff --git a/system/modules/isotope/languages/de/tl_iso_payment.xlf b/system/modules/isotope/languages/de/tl_iso_payment.xlf index cb60d6b4bb..fa285db628 100644 --- a/system/modules/isotope/languages/de/tl_iso_payment.xlf +++ b/system/modules/isotope/languages/de/tl_iso_payment.xlf @@ -193,6 +193,26 @@ Enter your PayPal API secret. Geben Sie Ihren PayPal API Schlüssel ein. + + Enable funding + Finanzierungsquellen aktivieren + + + The enabled funding sources for the transaction. By default, funding source eligibility is determined based on a variety of factors. Enable funding can be used to ensure a funding source is rendered, if eligible. + Geben Sie die Finanzierungsquellen an die Sie aktivieren möchten. Standardmäßig wird die Zulässigkeit von Finanzierungsquellen auf der Grundlage einer Reihe von Faktoren bestimmt. Mit der Option "Finanzierung aktivieren" kann sichergestellt werden, dass eine Finanzierungsquelle genutzt wird, wenn sie in Frage kommt. + + + Credit or debit cards + Kredit- oder Debitkarten + + + PayPal Credit (US, UK) + PayPal Credit (US, UK) + + + Pay Later (US, UK), Pay in 4 (AU) + Später Bezahlen + PSPID PSPID @@ -1016,4 +1036,4 @@ SOFORTüberweisung - \ No newline at end of file + diff --git a/system/modules/isotope/languages/en/tl_iso_payment.xlf b/system/modules/isotope/languages/en/tl_iso_payment.xlf index 0072911515..b14d805b21 100644 --- a/system/modules/isotope/languages/en/tl_iso_payment.xlf +++ b/system/modules/isotope/languages/en/tl_iso_payment.xlf @@ -146,6 +146,54 @@ Enter your PayPal API secret. + + Enable funding + + + The enabled funding sources for the transaction. By default, funding source eligibility is determined based on a variety of factors. Enable funding can be used to ensure a funding source is rendered, if eligible. + + + Credit or debit cards + + + PayPal Credit (US, UK) + + + Pay Later (US, UK), Pay in 4 (AU) + + + Venmo + + + Bancontact + + + BLIK + + + eps + + + giropay + + + iDEAL + + + Mercado Pago + + + MyBank + + + Przelewy24 + + + SEPA-Lastschrift + + + Sofort + PSPID diff --git a/system/modules/isotope/languages/es/tl_iso_payment.xlf b/system/modules/isotope/languages/es/tl_iso_payment.xlf index a774ecc8c7..aade76318b 100644 --- a/system/modules/isotope/languages/es/tl_iso_payment.xlf +++ b/system/modules/isotope/languages/es/tl_iso_payment.xlf @@ -174,6 +174,10 @@ Enter your PayPal API secret. + + Pay Later (US, UK), Pay in 4 (AU) + Paga en 3 plazos + PSPID @@ -875,4 +879,4 @@ - \ No newline at end of file + diff --git a/system/modules/isotope/languages/fr/tl_iso_payment.xlf b/system/modules/isotope/languages/fr/tl_iso_payment.xlf index 7aa6cc2353..0f5c0f7c90 100644 --- a/system/modules/isotope/languages/fr/tl_iso_payment.xlf +++ b/system/modules/isotope/languages/fr/tl_iso_payment.xlf @@ -178,6 +178,10 @@ Enter your PayPal API secret. + + Pay Later (US, UK), Pay in 4 (AU) + 4X PayPal + PSPID PSPID @@ -888,4 +892,4 @@ - \ No newline at end of file + diff --git a/system/modules/isotope/languages/it/tl_iso_payment.xlf b/system/modules/isotope/languages/it/tl_iso_payment.xlf index 726c12f933..5bcdae5a25 100644 --- a/system/modules/isotope/languages/it/tl_iso_payment.xlf +++ b/system/modules/isotope/languages/it/tl_iso_payment.xlf @@ -193,6 +193,10 @@ Enter your PayPal API secret. Inserire il vostro segreto API PayPal. + + Pay Later (US, UK), Pay in 4 (AU) + Paga in 3 rate + PSPID PSPID @@ -1015,4 +1019,4 @@ - \ No newline at end of file + diff --git a/system/modules/isotope/library/Isotope/Model/Payment/PaypalCheckout.php b/system/modules/isotope/library/Isotope/Model/Payment/PaypalCheckout.php index 9d93e86f49..d3bbf01183 100644 --- a/system/modules/isotope/library/Isotope/Model/Payment/PaypalCheckout.php +++ b/system/modules/isotope/library/Isotope/Model/Payment/PaypalCheckout.php @@ -24,6 +24,27 @@ class PaypalCheckout extends PaypalApi { + /** + * List of parameters to enable funding + * @var array + */ + public static $enableFundingParameters = array( + 'card', + 'credit', + 'paylater', + 'venmo', + 'bancontact', + 'blik', + 'eps', + 'giropay', + 'ideal', + 'mercadopago', + 'mybank', + 'p24', + 'sepa', + 'sofort' + ); + public function isAvailable(): bool { if (!in_array(Isotope::getConfig()->currency, ['AUD', 'BRL', 'CAD', 'CZK', 'DKK', 'EUR', 'HKD', 'HUF', 'ILS', 'JPY', 'MYR', 'MXN', 'TWD', 'NZD', 'NOK', 'PHP', 'PLN', 'GBP', 'RUB', 'SGD', 'SEK', 'CHF', 'THB', 'USD'])) { @@ -63,6 +84,7 @@ public function checkoutForm(IsotopeProductCollection $objOrder, Module $objModu $template->client_id = $this->paypal_client; $template->currency = $objOrder->getCurrency(); + $template->enable_funding = $this->getEnableFundingParameters(); parse_str(parse_url($link['href'], PHP_URL_QUERY), $params); $template->token = $params['token']; @@ -122,4 +144,44 @@ public function processPayment(IsotopeProductCollection $objOrder, Module $objMo return true; } + + /** + * Get list of model types + * + * @return array + */ + public static function getFundingParameters() + { + return static::$enableFundingParameters; + } + + /** + * Return options list of model types + * + * @return array + */ + public static function getEnableFundingOptions() + { + $arrOptions = array(); + + foreach (static::getFundingParameters() as $strName => $strClass) { + $arrOptions[$strClass] = $GLOBALS['TL_LANG']['tl_iso_payment']['paypal_enable_funding_options'][$strClass] ?? $strClass; + } + + return $arrOptions; + } + + /** + * Get enable funding parameters + * + * @return null|string + */ + public function getEnableFundingParameters() + { + if (isset($this->paypal_enable_funding)) { + return implode(',', array_values(unserialize($this->paypal_enable_funding))); + } + + return null; + } } diff --git a/system/modules/isotope/templates/payment/iso_payment_paypal_checkout.html5 b/system/modules/isotope/templates/payment/iso_payment_paypal_checkout.html5 index 58af904f03..b6ea181bf4 100644 --- a/system/modules/isotope/templates/payment/iso_payment_paypal_checkout.html5 +++ b/system/modules/isotope/templates/payment/iso_payment_paypal_checkout.html5 @@ -1,5 +1,5 @@
- +