Debug sepa payment

This commit is contained in:
Laurent Destailleur 2022-10-13 05:31:36 +02:00
parent 9b1a01bbd6
commit eabf01a422
3 changed files with 657 additions and 651 deletions

View File

@ -114,11 +114,7 @@ if (empty($reshook)) {
} }
$paymentservice = GETPOST('paymentservice'); $paymentservice = GETPOST('paymentservice');
if (preg_match('/stripesepa/', $paymentservice)) { $result = $object->demande_prelevement($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype);
$result = $object->demande_prelevement_stripe($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype);
} else {
$result = $object->demande_prelevement($user, price2num(GETPOST('withdraw_request_amount', 'alpha')), $newtype, $sourcetype);
}
if ($result > 0) { if ($result > 0) {
$db->commit(); $db->commit();
@ -142,6 +138,14 @@ if (empty($reshook)) {
} }
} }
// Payment with Direct Debit Stripe
if ($action == 'sepastripepayment' && $usercancreate) {
$result = $object->makeStripeSepaRequest($user, GETPOST('did', 'int'), 'direct-debit', 'facture');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
// payments conditions // payments conditions
if ($action == 'setconditions' && $usercancreate) { if ($action == 'setconditions' && $usercancreate) {
$object->fetch($id); $object->fetch($id);
@ -871,7 +875,8 @@ if ($object->id > 0) {
print '<td>'; print '<td>';
if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) { if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) {
print '<a href="'.$_SERVER["PHP_SELF"].'?action=new&paymentservice=stripesepa&token='.newToken().'&did='.$obj->rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("SendToStripe").'</a>'; $langs->load("stripe");
print '<a href="'.$_SERVER["PHP_SELF"].'?action=sepastripepayment&paymentservice=stripesepa&token='.newToken().'&did='.$obj->rowid.'&id='.$object->id.'&type='.urlencode($type).'">'.img_picto('', 'stripe', 'class="pictofixedwidth"').$langs->trans("RequestDirectDebitWithStripe").'</a>';
} }
print '</td>'; print '</td>';

File diff suppressed because it is too large Load Diff

View File

@ -71,3 +71,4 @@ PaymentWillBeRecordedForNextPeriod=Payment will be recorded for the next period.
ClickHereToTryAgain=<a href="%s">Click here to try again...</a> ClickHereToTryAgain=<a href="%s">Click here to try again...</a>
CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authentication rules, creation of a card must be done from Stripe backoffice. You can click here to switch on Stripe customer record: %s CreationOfPaymentModeMustBeDoneFromStripeInterface=Due to Strong Customer Authentication rules, creation of a card must be done from Stripe backoffice. You can click here to switch on Stripe customer record: %s
TERMINAL_LOCATION=Location (address) for terminals TERMINAL_LOCATION=Location (address) for terminals
RequestDirectDebitWithStripe=Request Direct Debit with Stripe