Merge pull request #19364 from ptibogxiv/patch-452

ADD Klarna provider with Stripe
This commit is contained in:
Laurent Destailleur 2021-11-15 11:01:32 +01:00 committed by GitHub
commit 184b76d0ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -390,6 +390,20 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code
print '</td></tr>';
}
// Activate Klarna
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code
print '<tr class="oddeven"><td>';
print $langs->trans("STRIPE_KLARNA").'</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('STRIPE_KLARNA');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("STRIPE_KLARNA", $arrval, $conf->global->STRIPE_KLARNA);
}
print ' &nbsp; <span class="opacitymedium">'.$langs->trans("ExampleOnlyForKlarnaCustomers").'</span>';
print '</td></tr>';
}
// Activate Bancontact
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { // TODO Not used by current code
print '<tr class="oddeven"><td>';

View File

@ -409,6 +409,9 @@ class Stripe extends CommonObject
if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) {
$paymentmethodtypes[] = "sepa_debit"; //&& ($object->thirdparty->isInEEC())
}
if (!empty($conf->global->STRIPE_KLARNA)) {
$paymentmethodtypes[] = "klarna";
}
if (!empty($conf->global->STRIPE_BANCONTACT)) {
$paymentmethodtypes[] = "bancontact";
}
@ -450,7 +453,9 @@ class Stripe extends CommonObject
if (!empty($conf->global->STRIPE_GIROPAY)) {
unset($dataforintent['setup_future_usage']);
}
if (!empty($conf->global->STRIPE_KLARNA)) {
unset($dataforintent['setup_future_usage']);
}
if (!is_null($payment_method)) {
$dataforintent["payment_method"] = $payment_method;
$description .= ' - '.$payment_method;
@ -602,6 +607,9 @@ class Stripe extends CommonObject
if (!empty($conf->global->STRIPE_BANCONTACT)) {
$paymentmethodtypes[] = "bancontact";
}
if (!empty($conf->global->STRIPE_KLARNA)) {
$paymentmethodtypes[] = "klarna";
}
if (!empty($conf->global->STRIPE_IDEAL)) {
$paymentmethodtypes[] = "ideal";
}