2018-04-17 10:15:14 +02:00
< ? php
2019-01-28 21:39:22 +01:00
/* Copyright ( C ) 2017 Alexandre Spangaro < aspangaro @ open - dsi . fr >
2017-05-08 06:52:30 +02:00
* Copyright ( C ) 2017 Olivier Geffroy < jeff @ jeffinfo . com >
2017-04-18 05:44:08 +02:00
* Copyright ( C ) 2017 Saasprov < saasprov @ gmail . com >
2021-01-24 13:38:23 +01:00
* Copyright ( C ) 2018 - 2021 Thibault FOUCART < support @ ptibogxiv . net >
2018-09-10 20:55:20 +02:00
* Copyright ( C ) 2018 Frédéric France < frederic . france @ netlogic . fr >
2017-02-22 06:33:52 +01:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 3 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2017-02-22 06:33:52 +01:00
*/
/**
* \file htdocs / stripe / admin / stripe . php
* \ingroup stripe
* \brief Page to setup stripe module
*/
require '../../main.inc.php' ;
2017-04-29 07:34:30 +02:00
require_once DOL_DOCUMENT_ROOT . '/stripe/lib/stripe.lib.php' ;
2017-02-22 06:33:52 +01:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php' ;
2018-03-06 20:45:05 +01:00
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php' ;
2019-04-24 13:08:13 +02:00
require_once DOL_DOCUMENT_ROOT . '/stripe/class/stripe.class.php' ;
2017-02-22 06:33:52 +01:00
2019-11-13 19:35:39 +01:00
$servicename = 'Stripe' ;
2017-02-22 06:33:52 +01:00
2018-05-26 16:35:29 +02:00
// Load translation files required by the page
$langs -> loadLangs ( array ( 'admin' , 'other' , 'paypal' , 'paybox' , 'stripe' ));
2017-02-22 06:33:52 +01:00
2021-03-23 17:46:06 +01:00
if ( empty ( $user -> admin )) {
accessforbidden ();
}
if ( empty ( $conf -> stripe -> enabled )) {
2021-02-26 21:17:52 +01:00
accessforbidden ();
}
2017-08-31 02:34:07 +02:00
2020-09-16 19:39:50 +02:00
$action = GETPOST ( 'action' , 'aZ09' );
2017-02-22 06:33:52 +01:00
2019-04-24 18:47:11 +02:00
/*
* Actions
*/
2021-02-26 21:17:52 +01:00
if ( $action == 'setvalue' && $user -> admin ) {
2017-02-22 06:33:52 +01:00
$db -> begin ();
2018-03-12 13:39:32 +01:00
if ( empty ( $conf -> stripeconnect -> enabled )) {
$result = dolibarr_set_const ( $db , " STRIPE_TEST_PUBLISHABLE_KEY " , GETPOST ( 'STRIPE_TEST_PUBLISHABLE_KEY' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
$result = dolibarr_set_const ( $db , " STRIPE_TEST_SECRET_KEY " , GETPOST ( 'STRIPE_TEST_SECRET_KEY' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2019-07-29 18:34:21 +02:00
$result = dolibarr_set_const ( $db , " STRIPE_TEST_WEBHOOK_ID " , GETPOST ( 'STRIPE_TEST_WEBHOOK_ID' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
$result = dolibarr_set_const ( $db , " STRIPE_TEST_WEBHOOK_KEY " , GETPOST ( 'STRIPE_TEST_WEBHOOK_KEY' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
$result = dolibarr_set_const ( $db , " STRIPE_LIVE_PUBLISHABLE_KEY " , GETPOST ( 'STRIPE_LIVE_PUBLISHABLE_KEY' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
$result = dolibarr_set_const ( $db , " STRIPE_LIVE_SECRET_KEY " , GETPOST ( 'STRIPE_LIVE_SECRET_KEY' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2019-07-29 18:34:21 +02:00
$result = dolibarr_set_const ( $db , " STRIPE_LIVE_WEBHOOK_ID " , GETPOST ( 'STRIPE_LIVE_WEBHOOK_ID' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
$result = dolibarr_set_const ( $db , " STRIPE_LIVE_WEBHOOK_KEY " , GETPOST ( 'STRIPE_LIVE_WEBHOOK_KEY' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
}
$result = dolibarr_set_const ( $db , " ONLINE_PAYMENT_CREDITOR " , GETPOST ( 'ONLINE_PAYMENT_CREDITOR' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
$result = dolibarr_set_const ( $db , " STRIPE_BANK_ACCOUNT_FOR_PAYMENTS " , GETPOST ( 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS' , 'int' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2020-10-31 14:32:18 +01:00
$result = dolibarr_set_const ( $db , " STRIPE_USER_ACCOUNT_FOR_ACTIONS " , GETPOST ( 'STRIPE_USER_ACCOUNT_FOR_ACTIONS' , 'int' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2020-10-31 14:32:18 +01:00
$error ++ ;
}
$result = dolibarr_set_const ( $db , " STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS " , GETPOST ( 'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS' , 'int' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
$result = dolibarr_set_const ( $db , " ONLINE_PAYMENT_CSS_URL " , GETPOST ( 'ONLINE_PAYMENT_CSS_URL' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2021-05-28 10:31:54 +02:00
$result = dolibarr_set_const ( $db , " ONLINE_PAYMENT_MESSAGE_FORM " , GETPOST ( 'ONLINE_PAYMENT_MESSAGE_FORM' , 'restricthtml' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2021-05-28 10:31:54 +02:00
$result = dolibarr_set_const ( $db , " ONLINE_PAYMENT_MESSAGE_OK " , GETPOST ( 'ONLINE_PAYMENT_MESSAGE_OK' , 'restricthtml' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2021-05-28 10:31:54 +02:00
$result = dolibarr_set_const ( $db , " ONLINE_PAYMENT_MESSAGE_KO " , GETPOST ( 'ONLINE_PAYMENT_MESSAGE_KO' , 'restricthtml' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
$result = dolibarr_set_const ( $db , " ONLINE_PAYMENT_SENDEMAIL " , GETPOST ( 'ONLINE_PAYMENT_SENDEMAIL' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2021-02-26 21:17:52 +01:00
}
2018-03-12 13:39:32 +01:00
// Stock decrement
2019-02-23 19:26:52 +01:00
//$result = dolibarr_set_const($db, "ONLINE_PAYMENT_WAREHOUSE", (GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') > 0 ? GETPOST('ONLINE_PAYMENT_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
//if (! $result > 0)
// $error ++;
2018-04-13 00:45:39 +02:00
2017-09-15 13:43:16 +02:00
// Payment token for URL
2018-03-12 13:39:32 +01:00
$result = dolibarr_set_const ( $db , " PAYMENT_SECURITY_TOKEN " , GETPOST ( 'PAYMENT_SECURITY_TOKEN' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-13 19:35:39 +01:00
$error ++ ;
2019-11-26 09:34:42 +01:00
}
if ( empty ( $conf -> use_javascript_ajax )) {
2019-11-26 11:55:34 +01:00
$result = dolibarr_set_const ( $db , " PAYMENT_SECURITY_TOKEN_UNIQUE " , GETPOST ( 'PAYMENT_SECURITY_TOKEN_UNIQUE' , 'alpha' ), 'chaine' , 0 , '' , $conf -> entity );
2022-08-12 15:54:50 +02:00
if ( ! ( $result > 0 )) {
2019-11-26 11:55:34 +01:00
$error ++ ;
}
2019-11-26 09:34:42 +01:00
}
2018-03-12 13:39:32 +01:00
2019-11-13 19:35:39 +01:00
if ( ! $error ) {
2018-03-12 13:39:32 +01:00
$db -> commit ();
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
} else {
$db -> rollback ();
2017-02-22 06:33:52 +01:00
dol_print_error ( $db );
2018-03-12 13:39:32 +01:00
}
2017-02-22 06:33:52 +01:00
}
2021-02-26 21:17:52 +01:00
if ( $action == " setlive " ) {
2019-01-27 11:55:16 +01:00
$liveenable = GETPOST ( 'value' , 'int' );
2018-09-10 20:55:20 +02:00
$res = dolibarr_set_const ( $db , " STRIPE_LIVE " , $liveenable , 'yesno' , 0 , '' , $conf -> entity );
if ( $res > 0 ) {
2017-05-08 06:52:30 +02:00
setEventMessages ( $langs -> trans ( " SetupSaved " ), null , 'mesgs' );
2020-05-21 15:05:19 +02:00
} else {
2017-05-08 06:52:30 +02:00
setEventMessages ( $langs -> trans ( " Error " ), null , 'errors' );
}
}
2018-03-07 16:13:49 +01:00
//TODO: import script for stripe account saving in alone or connect mode for stripe.class.php
2017-05-14 17:05:13 +02:00
2018-03-08 19:50:41 +01:00
2017-02-22 06:33:52 +01:00
/*
* View
*/
2019-11-13 19:35:39 +01:00
$form = new Form ( $db );
$formproduct = new FormProduct ( $db );
2017-05-13 22:05:58 +02:00
2019-01-27 11:55:16 +01:00
llxHeader ( '' , $langs -> trans ( " StripeSetup " ));
2017-02-22 06:33:52 +01:00
2019-11-13 19:35:39 +01:00
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs -> trans ( " BackToModuleList " ) . '</a>' ;
2019-01-27 11:55:16 +01:00
print load_fiche_titre ( $langs -> trans ( " ModuleSetup " ) . ' Stripe' , $linkback );
2017-02-22 06:33:52 +01:00
2019-11-13 19:35:39 +01:00
$head = stripeadmin_prepare_head ();
2017-02-22 06:33:52 +01:00
2020-09-24 21:54:21 +02:00
print '<form method="POST" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
2019-12-18 23:12:31 +01:00
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
2017-02-22 06:33:52 +01:00
print '<input type="hidden" name="action" value="setvalue">' ;
2020-10-22 22:50:03 +02:00
print dol_get_fiche_head ( $head , 'stripeaccount' , '' , - 1 );
2017-02-22 06:33:52 +01:00
2020-04-10 10:59:32 +02:00
$stripearrayofwebhookevents = array ( 'account.updated' , 'payout.created' , 'payout.paid' , 'charge.pending' , 'charge.refunded' , 'charge.succeeded' , 'charge.failed' , 'payment_intent.succeeded' , 'payment_intent.payment_failed' , 'payment_method.attached' , 'payment_method.updated' , 'payment_method.card_automatically_updated' , 'payment_method.detached' , 'source.chargeable' , 'customer.deleted' );
2019-04-24 13:08:13 +02:00
2019-11-19 21:21:15 +01:00
print '<span class="opacitymedium">' . $langs -> trans ( " StripeDesc " ) . " </span><br> \n " ;
2017-02-22 06:33:52 +01:00
print '<br>' ;
2020-12-07 11:42:35 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2017-02-22 06:33:52 +01:00
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " AccountParameter " ) . '</td>' ;
print '<td>' . $langs -> trans ( " Value " ) . '</td>' ;
2019-04-24 21:26:58 +02:00
print '<td></td>' ;
2017-02-22 06:33:52 +01:00
print " </tr> \n " ;
2017-05-13 22:05:58 +02:00
print '<tr class="oddeven">' ;
2020-12-07 11:42:35 +01:00
print '<td>' ;
2017-05-08 06:52:30 +02:00
print $langs -> trans ( " StripeLiveEnabled " ) . '</td><td>' ;
2019-10-27 17:01:23 +01:00
if ( $conf -> use_javascript_ajax ) {
2020-10-31 14:32:18 +01:00
print ajax_constantonoff ( 'STRIPE_LIVE' );
2019-10-27 17:01:23 +01:00
} else {
2020-10-31 14:32:18 +01:00
$arrval = array ( '0' => $langs -> trans ( " No " ), '1' => $langs -> trans ( " Yes " ));
print $form -> selectarray ( " STRIPE_LIVE " , $arrval , $conf -> global -> STRIPE_LIVE );
2019-10-27 17:01:23 +01:00
}
2019-04-24 21:26:58 +02:00
print '</td><td></td></tr>' ;
2017-02-22 06:33:52 +01:00
2021-02-26 21:17:52 +01:00
if ( empty ( $conf -> stripeconnect -> enabled )) {
2018-03-08 19:50:41 +01:00
print '<tr class="oddeven"><td>' ;
print '<span class="fieldrequired">' . $langs -> trans ( " STRIPE_TEST_PUBLISHABLE_KEY " ) . '</span></td><td>' ;
2021-03-23 18:15:12 +01:00
print '<input class="minwidth300" type="text" name="STRIPE_TEST_PUBLISHABLE_KEY" value="' . $conf -> global -> STRIPE_TEST_PUBLISHABLE_KEY . '" placeholder="' . $langs -> trans ( " Example " ) . ': pk_test_xxxxxxxxxxxxxxxxxxxxxxxx">' ;
2019-04-24 13:08:13 +02:00
print '</td><td></td></tr>' ;
2017-02-22 06:33:52 +01:00
2018-03-08 19:50:41 +01:00
print '<tr class="oddeven"><td>' ;
print '<span class="titlefield fieldrequired">' . $langs -> trans ( " STRIPE_TEST_SECRET_KEY " ) . '</span></td><td>' ;
2021-03-23 18:15:12 +01:00
print '<input class="minwidth300" type="text" name="STRIPE_TEST_SECRET_KEY" value="' . $conf -> global -> STRIPE_TEST_SECRET_KEY . '" placeholder="' . $langs -> trans ( " Example " ) . ': sk_test_xxxxxxxxxxxxxxxxxxxxxxxx">' ;
2019-04-24 13:08:13 +02:00
print '</td><td></td></tr>' ;
2017-02-22 06:33:52 +01:00
2018-03-08 19:50:41 +01:00
print '<tr class="oddeven"><td>' ;
2019-07-28 22:57:07 +02:00
print '<span class="titlefield">' . $langs -> trans ( " STRIPE_TEST_WEBHOOK_KEY " ) . '</span></td><td>' ;
2019-04-24 21:26:58 +02:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) {
2022-07-28 10:47:36 +02:00
print '<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_ID" value="' . getDolGlobalString ( 'STRIPE_TEST_WEBHOOK_ID' ) . '" placeholder="' . $langs -> trans ( " Example " ) . ': we_xxxxxxxxxxxxxxxxxxxxxxxx">' ;
2021-03-23 18:15:12 +01:00
print '<br>' ;
2019-04-24 21:26:58 +02:00
}
2022-07-28 10:47:36 +02:00
print '<input class="minwidth300" type="text" name="STRIPE_TEST_WEBHOOK_KEY" value="' . getDolGlobalString ( 'STRIPE_TEST_WEBHOOK_KEY' ) . '" placeholder="' . $langs -> trans ( " Example " ) . ': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">' ;
2020-12-07 11:42:35 +01:00
$out = img_picto ( '' , 'globe' ) . ' <span class="opacitymedium">' . $langs -> trans ( " ToOfferALinkForTestWebhook " ) . '</span> ' ;
2020-10-31 14:32:18 +01:00
$url = dol_buildpath ( '/public/stripe/ipn.php?test' , 3 );
2020-12-07 11:42:35 +01:00
$out .= '<input type="text" id="onlinetestwebhookurl" class="minwidth500" value="' . $url . '" disabled>' ;
2019-11-13 19:35:39 +01:00
$out .= ajax_autoselect ( " onlinetestwebhookurl " , 0 );
2019-04-24 21:26:58 +02:00
print '<br>' . $out ;
2019-04-24 13:08:13 +02:00
print '</td><td>' ;
2021-02-26 21:17:52 +01:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) {
if ( ! empty ( $conf -> global -> STRIPE_TEST_WEBHOOK_KEY ) && ! empty ( $conf -> global -> STRIPE_TEST_SECRET_KEY ) && ! empty ( $conf -> global -> STRIPE_TEST_WEBHOOK_ID )) {
2020-10-31 14:32:18 +01:00
\Stripe\Stripe :: setApiKey ( $conf -> global -> STRIPE_TEST_SECRET_KEY );
$endpoint = \Stripe\WebhookEndpoint :: retrieve ( $conf -> global -> STRIPE_TEST_WEBHOOK_ID );
$endpoint -> enabled_events = $stripearrayofwebhookevents ;
if ( GETPOST ( 'webhook' , 'alpha' ) == $conf -> global -> STRIPE_TEST_WEBHOOK_ID ) {
if ( ! GETPOST ( 'status' , 'alpha' )) {
$endpoint -> disabled = true ;
} else {
$endpoint -> disabled = false ;
}
}
$endpoint -> url = dol_buildpath ( '/public/stripe/ipn.php?test' , 3 );
$endpoint -> save ();
2021-02-26 21:17:52 +01:00
if ( $endpoint -> status == 'enabled' ) {
2020-10-31 14:32:18 +01:00
print '<a class="reposition" href="' . $_SERVER [ 'PHP_SELF' ] . '?action=ipn&webhook=' . $endpoint -> id . '&status=0">' ;
print img_picto ( $langs -> trans ( " Activated " ), 'switch_on' );
} else {
print '<a class="reposition" href="' . $_SERVER [ 'PHP_SELF' ] . '?action=ipn&webhook=' . $endpoint -> id . '&status=1">' ;
print img_picto ( $langs -> trans ( " Disabled " ), 'switch_off' );
}
//print $endpoint;
} else {
2021-03-23 17:46:06 +01:00
print img_picto ( $langs -> trans ( " Inactive " ), 'statut5' );
2020-10-31 14:32:18 +01:00
}
2019-04-24 21:26:58 +02:00
}
2020-10-31 14:32:18 +01:00
print '</td></tr>' ;
2018-03-05 16:48:38 +01:00
} else {
2018-03-10 14:45:07 +01:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " StripeConnect " ) . '</td>' ;
2021-04-19 21:30:25 +02:00
print '<td><b>' . $langs -> trans ( " StripeConnect_Mode " ) . '</b><br>' ;
2018-03-11 01:23:06 +01:00
print $langs -> trans ( " STRIPE_APPLICATION_FEE_PLATFORM " ) . ' ' ;
print price ( $conf -> global -> STRIPE_APPLICATION_FEE_PERCENT );
print '% + ' ;
print price ( $conf -> global -> STRIPE_APPLICATION_FEE );
2019-08-02 14:48:45 +02:00
print ' ' . $langs -> getCurrencySymbol ( $conf -> currency ) . ' ' . $langs -> trans ( " minimum " ) . ' ' . price ( $conf -> global -> STRIPE_APPLICATION_FEE_MINIMAL ) . ' ' . $langs -> getCurrencySymbol ( $conf -> currency );
2019-04-24 21:26:58 +02:00
print '</td><td></td></tr>' ;
2018-03-05 16:48:38 +01:00
}
2018-03-06 16:29:43 +01:00
2021-02-26 21:17:52 +01:00
if ( empty ( $conf -> stripeconnect -> enabled )) {
2018-03-12 13:39:32 +01:00
print '<tr class="oddeven"><td>' ;
print '<span class="fieldrequired">' . $langs -> trans ( " STRIPE_LIVE_PUBLISHABLE_KEY " ) . '</span></td><td>' ;
2022-07-28 10:47:36 +02:00
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_PUBLISHABLE_KEY" value="' . getDolGlobalString ( 'STRIPE_LIVE_PUBLISHABLE_KEY' ) . '" placeholder="' . $langs -> trans ( " Example " ) . ': pk_live_xxxxxxxxxxxxxxxxxxxxxxxx">' ;
2019-04-24 13:08:13 +02:00
print '</td><td></td></tr>' ;
2018-03-12 13:39:32 +01:00
2018-03-07 16:13:49 +01:00
print '<tr class="oddeven"><td>' ;
2018-03-08 19:50:41 +01:00
print '<span class="fieldrequired">' . $langs -> trans ( " STRIPE_LIVE_SECRET_KEY " ) . '</span></td><td>' ;
2022-07-28 10:47:36 +02:00
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_SECRET_KEY" value="' . getDolGlobalString ( 'STRIPE_LIVE_SECRET_KEY' ) . '" placeholder="' . $langs -> trans ( " Example " ) . ': sk_live_xxxxxxxxxxxxxxxxxxxxxxxx">' ;
2019-04-24 13:08:13 +02:00
print '</td><td></td></tr>' ;
2018-03-07 16:13:49 +01:00
2018-03-08 19:50:41 +01:00
print '<tr class="oddeven"><td>' ;
2019-07-28 22:57:07 +02:00
print '<span class="titlefield">' . $langs -> trans ( " STRIPE_LIVE_WEBHOOK_KEY " ) . '</span></td><td>' ;
2019-04-24 21:26:58 +02:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) {
2022-07-28 10:47:36 +02:00
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_ID" value="' . getDolGlobalString ( 'STRIPE_LIVE_WEBHOOK_ID' ) . '" placeholder="' . $langs -> trans ( " Example " ) . ': we_xxxxxxxxxxxxxxxxxxxxxxxx">' ;
2021-03-23 18:15:12 +01:00
print '<br>' ;
2019-04-24 21:26:58 +02:00
}
2021-03-23 18:15:12 +01:00
print '<input class="minwidth300" type="text" name="STRIPE_LIVE_WEBHOOK_KEY" value="' . $conf -> global -> STRIPE_LIVE_WEBHOOK_KEY . '" placeholder="' . $langs -> trans ( " Example " ) . ': whsec_xxxxxxxxxxxxxxxxxxxxxxxx">' ;
2022-07-28 10:47:36 +02:00
$out = img_picto ( '' , 'globe' , 'class="pictofixedwidth"' ) . ' <span class="opacitymedium">' . $langs -> trans ( " ToOfferALinkForLiveWebhook " ) . '</span> ' ;
2020-10-31 14:32:18 +01:00
$url = dol_buildpath ( '/public/stripe/ipn.php' , 3 );
2020-12-07 11:42:35 +01:00
$out .= '<input type="text" id="onlinelivewebhookurl" class="minwidth500" value="' . $url . '" disabled>' ;
2019-11-13 19:35:39 +01:00
$out .= ajax_autoselect ( " onlinelivewebhookurl " , 0 );
2019-04-24 21:26:58 +02:00
print '<br>' . $out ;
2019-04-24 13:08:13 +02:00
print '</td><td>' ;
2021-02-26 21:17:52 +01:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) {
if ( ! empty ( $conf -> global -> STRIPE_LIVE_WEBHOOK_KEY ) && ! empty ( $conf -> global -> STRIPE_LIVE_SECRET_KEY ) && ! empty ( $conf -> global -> STRIPE_LIVE_WEBHOOK_ID )) {
2020-10-31 14:32:18 +01:00
\Stripe\Stripe :: setApiKey ( $conf -> global -> STRIPE_LIVE_SECRET_KEY );
$endpoint = \Stripe\WebhookEndpoint :: retrieve ( $conf -> global -> STRIPE_LIVE_WEBHOOK_ID );
$endpoint -> enabled_events = $stripearrayofwebhookevents ;
if ( GETPOST ( 'webhook' , 'alpha' ) == $conf -> global -> STRIPE_LIVE_WEBHOOK_ID ) {
if ( empty ( GETPOST ( 'status' , 'alpha' ))) {
$endpoint -> disabled = true ;
} else {
$endpoint -> disabled = false ;
}
}
$endpoint -> url = dol_buildpath ( '/public/stripe/ipn.php' , 3 );
$endpoint -> save ();
2021-02-26 21:17:52 +01:00
if ( $endpoint -> status == 'enabled' ) {
2020-10-31 14:32:18 +01:00
print '<a class="reposition" href="' . $_SERVER [ 'PHP_SELF' ] . '?action=ipn&webhook=' . $endpoint -> id . '&status=0">' ;
print img_picto ( $langs -> trans ( " Activated " ), 'switch_on' );
} else {
print '<a class="reposition" href="' . $_SERVER [ 'PHP_SELF' ] . '?action=ipn&webhook=' . $endpoint -> id . '&status=1">' ;
print img_picto ( $langs -> trans ( " Disabled " ), 'switch_off' );
}
//print $endpoint;
} else {
2021-03-23 17:46:06 +01:00
print img_picto ( $langs -> trans ( " Inactive " ), 'statut5' );
2020-10-31 14:32:18 +01:00
}
2019-04-24 21:26:58 +02:00
}
2020-10-31 14:32:18 +01:00
print '</td></tr>' ;
2020-05-21 15:05:19 +02:00
} else {
2018-03-08 19:50:41 +01:00
print '<tr class="oddeven"><td>' . $langs -> trans ( " StripeConnect " ) . '</td>' ;
2019-04-24 21:26:58 +02:00
print '<td>' . $langs -> trans ( " StripeConnect_Mode " ) . '</td><td></td></tr>' ;
2018-03-08 19:50:41 +01:00
}
2018-03-06 16:29:43 +01:00
2017-04-29 07:04:34 +02:00
print '</table>' ;
2020-12-07 11:42:35 +01:00
print '</div>' ;
2017-04-29 07:04:34 +02:00
print '<br>' ;
2018-03-07 16:13:49 +01:00
2020-12-07 11:42:35 +01:00
print '<div class="div-table-responsive-no-min">' ;
2019-11-05 21:24:41 +01:00
print '<table class="noborder centpercent">' ;
2017-02-22 06:33:52 +01:00
print '<tr class="liste_titre">' ;
2020-12-07 11:42:35 +01:00
print '<td>' . $langs -> trans ( " UsageParameter " ) . '</td>' ;
2017-02-22 06:33:52 +01:00
print '<td>' . $langs -> trans ( " Value " ) . '</td>' ;
print " </tr> \n " ;
2017-05-13 22:05:58 +02:00
print '<tr class="oddeven"><td>' ;
2020-09-14 14:41:11 +02:00
print $langs -> trans ( " PublicVendorName " ) . '</td><td>' ;
2022-07-28 10:47:36 +02:00
print '<input class="minwidth300" type="text" name="ONLINE_PAYMENT_CREDITOR" value="' . getDolGlobalString ( 'ONLINE_PAYMENT_CREDITOR' ) . '">' ;
2020-09-14 14:46:38 +02:00
print ' <span class="opacitymedium">' . $langs -> trans ( " Example " ) . ': ' . $mysoc -> name . '</span>' ;
2017-02-22 06:33:52 +01:00
print '</td></tr>' ;
2018-09-10 20:18:16 +02:00
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " StripeUserAccountForActions " ) . '</td><td>' ;
2022-07-28 10:47:36 +02:00
print img_picto ( '' , 'user' , 'class="pictofixedwidth"' ) . $form -> select_dolusers ( getDolGlobalString ( 'STRIPE_USER_ACCOUNT_FOR_ACTIONS' ), 'STRIPE_USER_ACCOUNT_FOR_ACTIONS' , 0 );
2018-09-10 20:18:16 +02:00
print '</td></tr>' ;
2018-03-08 19:50:41 +01:00
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " BankAccount " ) . '</td><td>' ;
2022-07-28 10:47:36 +02:00
print img_picto ( '' , 'bank_account' , 'class="pictofixedwidth"' );
$form -> select_comptes ( getDolGlobalString ( 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS' ), 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS' , 0 , '' , 1 );
2018-03-08 19:50:41 +01:00
print '</td></tr>' ;
2021-11-05 14:23:19 +01:00
if ( getDolGlobalInt ( 'MAIN_FEATURES_LEVEL' ) >= 2 ) { // What is this for ?
2018-03-04 19:39:46 +01:00
print '<tr class="oddeven"><td>' ;
2018-03-08 19:50:41 +01:00
print $langs -> trans ( " BankAccountForBankTransfer " ) . '</td><td>' ;
2022-07-28 10:47:36 +02:00
print img_picto ( '' , 'bank_account' , 'class="pictofixedwidth"' );
$form -> select_comptes ( getDolGlobalString ( 'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS' ), 'STRIPE_BANK_ACCOUNT_FOR_BANKTRANSFERS' , 0 , '' , 1 );
2018-03-04 19:39:46 +01:00
print '</td></tr>' ;
2018-03-07 14:44:32 +01:00
}
2019-02-19 15:49:54 +01:00
// Activate Payment Request API
2021-02-26 21:17:52 +01:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) { // TODO Not used by current code
2020-10-31 14:32:18 +01:00
print '<tr class="oddeven"><td>' ;
2022-07-28 10:47:36 +02:00
print $langs -> trans ( " STRIPE_PAYMENT_REQUEST_API " ) . ' ?? Not used, what is it for ??</td><td>' ;
2020-10-31 14:32:18 +01:00
if ( $conf -> use_javascript_ajax ) {
print ajax_constantonoff ( 'STRIPE_PAYMENT_REQUEST_API' );
} else {
$arrval = array ( '0' => $langs -> trans ( " No " ), '1' => $langs -> trans ( " Yes " ));
2022-07-28 10:47:36 +02:00
print $form -> selectarray ( " STRIPE_PAYMENT_REQUEST_API " , $arrval , getDolGlobalString ( 'STRIPE_PAYMENT_REQUEST_API' ));
2020-10-31 14:32:18 +01:00
}
2019-02-19 15:49:54 +01:00
print '</td></tr>' ;
}
// Activate SEPA DIRECT_DEBIT
2021-02-26 21:17:52 +01:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) { // TODO Not used by current code
2018-06-06 15:28:50 +02:00
print '<tr class="oddeven"><td>' ;
2019-02-19 15:49:54 +01:00
print $langs -> trans ( " STRIPE_SEPA_DIRECT_DEBIT " ) . '</td><td>' ;
2020-10-31 14:32:18 +01:00
if ( $conf -> use_javascript_ajax ) {
print ajax_constantonoff ( 'STRIPE_SEPA_DIRECT_DEBIT' );
} else {
$arrval = array ( '0' => $langs -> trans ( " No " ), '1' => $langs -> trans ( " Yes " ));
2022-07-28 10:47:36 +02:00
print $form -> selectarray ( " STRIPE_SEPA_DIRECT_DEBIT " , $arrval , getDolGlobalString ( 'STRIPE_SEPA_DIRECT_DEBIT' ));
2020-10-31 14:32:18 +01:00
}
2019-02-19 15:49:54 +01:00
print '</td></tr>' ;
2018-06-06 15:28:50 +02:00
}
2018-04-17 10:14:36 +02:00
2021-11-12 13:21:40 +01:00
// 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 ' <span class="opacitymedium">' . $langs -> trans ( " ExampleOnlyForKlarnaCustomers " ) . '</span>' ;
print '</td></tr>' ;
}
2021-01-24 13:37:05 +01:00
// Activate Bancontact
2021-02-26 21:17:52 +01:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) { // TODO Not used by current code
2021-01-24 13:37:05 +01:00
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " STRIPE_BANCONTACT " ) . '</td><td>' ;
if ( $conf -> use_javascript_ajax ) {
print ajax_constantonoff ( 'STRIPE_BANCONTACT' );
} else {
$arrval = array ( '0' => $langs -> trans ( " No " ), '1' => $langs -> trans ( " Yes " ));
print $form -> selectarray ( " STRIPE_BANCONTACT " , $arrval , $conf -> global -> STRIPE_BANCONTACT );
}
print ' <span class="opacitymedium">' . $langs -> trans ( " ExampleOnlyForBECustomers " ) . '</span>' ;
print '</td></tr>' ;
}
2020-09-05 14:14:56 +02:00
// Activate iDEAL
2021-02-26 21:17:52 +01:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) { // TODO Not used by current code
2020-09-05 14:14:56 +02:00
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " STRIPE_IDEAL " ) . '</td><td>' ;
if ( $conf -> use_javascript_ajax ) {
print ajax_constantonoff ( 'STRIPE_IDEAL' );
} else {
$arrval = array ( '0' => $langs -> trans ( " No " ), '1' => $langs -> trans ( " Yes " ));
print $form -> selectarray ( " STRIPE_IDEAL " , $arrval , $conf -> global -> STRIPE_SEPA_DIRECT_DEBIT );
}
2020-09-14 14:46:38 +02:00
print ' <span class="opacitymedium">' . $langs -> trans ( " ExampleOnlyForNLCustomers " ) . '</span>' ;
2020-09-05 14:14:56 +02:00
print '</td></tr>' ;
}
2021-01-24 13:37:05 +01:00
// Activate Giropay
2021-02-26 21:17:52 +01:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) { // TODO Not used by current code
2021-01-24 13:37:05 +01:00
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " STRIPE_GIROPAY " ) . '</td><td>' ;
if ( $conf -> use_javascript_ajax ) {
print ajax_constantonoff ( 'STRIPE_GIROPAY' );
} else {
$arrval = array ( '0' => $langs -> trans ( " No " ), '1' => $langs -> trans ( " Yes " ));
print $form -> selectarray ( " STRIPE_GIROPAY " , $arrval , $conf -> global -> STRIPE_GIROPAY );
}
print ' <span class="opacitymedium">' . $langs -> trans ( " ExampleOnlyForDECustomers " ) . '</span>' ;
print '</td></tr>' ;
}
// Activate Sofort
2021-02-26 21:17:52 +01:00
if ( $conf -> global -> MAIN_FEATURES_LEVEL >= 2 ) { // TODO Not used by current code
2021-01-24 13:37:05 +01:00
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " STRIPE_SOFORT " ) . '</td><td>' ;
if ( $conf -> use_javascript_ajax ) {
print ajax_constantonoff ( 'STRIPE_SOFORT' );
} else {
$arrval = array ( '0' => $langs -> trans ( " No " ), '1' => $langs -> trans ( " Yes " ));
print $form -> selectarray ( " STRIPE_SOFORT " , $arrval , $conf -> global -> STRIPE_SOFORT );
}
print ' <span class="opacitymedium">' . $langs -> trans ( " ExampleOnlyForATBEDEITNLESCustomers " ) . '</span>' ;
print '</td></tr>' ;
}
2017-05-13 22:05:58 +02:00
print '<tr class="oddeven"><td>' ;
2017-02-22 06:33:52 +01:00
print $langs -> trans ( " CSSUrlForPaymentForm " ) . '</td><td>' ;
2017-08-31 02:34:07 +02:00
print '<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="' . $conf -> global -> ONLINE_PAYMENT_CSS_URL . '">' ;
2020-09-14 14:46:38 +02:00
print ' <span class="opacitymedium">' . $langs -> trans ( " Example " ) . ': http://mysite/mycss.css</span>' ;
2017-02-22 06:33:52 +01:00
print '</td></tr>' ;
2017-09-09 09:54:42 +02:00
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " MessageForm " ) . '</td><td>' ;
2019-11-13 19:35:39 +01:00
$doleditor = new DolEditor ( 'ONLINE_PAYMENT_MESSAGE_FORM' , $conf -> global -> ONLINE_PAYMENT_MESSAGE_FORM , '' , 100 , 'dolibarr_details' , 'In' , false , true , true , ROWS_2 , '90%' );
2017-09-09 09:54:42 +02:00
$doleditor -> Create ();
print '</td></tr>' ;
2017-05-13 22:05:58 +02:00
print '<tr class="oddeven"><td>' ;
2017-02-22 06:33:52 +01:00
print $langs -> trans ( " MessageOK " ) . '</td><td>' ;
2019-11-13 19:35:39 +01:00
$doleditor = new DolEditor ( 'ONLINE_PAYMENT_MESSAGE_OK' , $conf -> global -> ONLINE_PAYMENT_MESSAGE_OK , '' , 100 , 'dolibarr_details' , 'In' , false , true , true , ROWS_2 , '90%' );
2017-02-22 06:33:52 +01:00
$doleditor -> Create ();
print '</td></tr>' ;
2017-05-13 22:05:58 +02:00
print '<tr class="oddeven"><td>' ;
2017-02-22 06:33:52 +01:00
print $langs -> trans ( " MessageKO " ) . '</td><td>' ;
2019-11-13 19:35:39 +01:00
$doleditor = new DolEditor ( 'ONLINE_PAYMENT_MESSAGE_KO' , $conf -> global -> ONLINE_PAYMENT_MESSAGE_KO , '' , 100 , 'dolibarr_details' , 'In' , false , true , true , ROWS_2 , '90%' );
2017-02-22 06:33:52 +01:00
$doleditor -> Create ();
print '</td></tr>' ;
2017-05-14 16:17:00 +02:00
print '<tr class="oddeven"><td>' ;
2017-08-31 02:34:07 +02:00
print $langs -> trans ( " ONLINE_PAYMENT_SENDEMAIL " ) . '</td><td>' ;
2022-07-28 10:47:36 +02:00
print img_picto ( '' , 'email' , 'class="pictofixedwidth"' );
2020-09-14 19:00:18 +02:00
print '<input class="minwidth200" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="' . $conf -> global -> ONLINE_PAYMENT_SENDEMAIL . '">' ;
2020-09-14 14:46:38 +02:00
print ' <span class="opacitymedium">' . $langs -> trans ( " Example " ) . ': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>' ;
2018-03-08 19:50:41 +01:00
print '</td></tr>' ;
2018-03-06 20:45:05 +01:00
2020-12-07 11:42:35 +01:00
print '</table>' ;
print '</div>' ;
print '<br>' ;
print '<div class="div-table-responsive-no-min">' ;
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " UrlGenerationParameters " ) . '</td>' ;
print '<td>' . $langs -> trans ( " Value " ) . '</td>' ;
print " </tr> \n " ;
2017-09-15 13:43:16 +02:00
// Payment token for URL
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " SecurityToken " ) . '</td><td>' ;
2020-09-14 19:00:18 +02:00
print '<input class="minwidth300" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="' . $conf -> global -> PAYMENT_SECURITY_TOKEN . '">' ;
2020-09-14 15:05:35 +02:00
if ( ! empty ( $conf -> use_javascript_ajax )) {
2017-09-15 13:43:16 +02:00
print ' ' . img_picto ( $langs -> trans ( 'Generate' ), 'refresh' , 'id="generate_token" class="linkobject"' );
2020-09-14 15:05:35 +02:00
}
2020-10-31 14:32:18 +01:00
if ( ! empty ( $conf -> global -> PAYMENT_SECURITY_ACCEPT_ANY_TOKEN )) {
2020-09-14 15:05:35 +02:00
$langs -> load ( " errors " );
2020-09-20 18:05:49 +02:00
print img_warning ( $langs -> trans ( " WarningTheHiddenOptionIsOn " , 'PAYMENT_SECURITY_ACCEPT_ANY_TOKEN' ), '' , 'pictowarning marginleftonly' );
2020-09-14 15:05:35 +02:00
}
2017-09-15 13:43:16 +02:00
print '</td></tr>' ;
print '<tr class="oddeven"><td>' ;
print $langs -> trans ( " SecurityTokenIsUnique " ) . '</td><td>' ;
2019-02-19 15:49:54 +01:00
if ( $conf -> use_javascript_ajax ) {
2022-07-28 10:47:36 +02:00
print ajax_constantonoff ( 'PAYMENT_SECURITY_TOKEN_UNIQUE' , null , null , 0 , 0 , 1 );
2019-02-19 15:49:54 +01:00
} else {
2020-10-31 14:32:18 +01:00
$arrval = array ( '0' => $langs -> trans ( " No " ), '1' => $langs -> trans ( " Yes " ));
print $form -> selectarray ( " PAYMENT_SECURITY_TOKEN_UNIQUE " , $arrval , $conf -> global -> PAYMENT_SECURITY_TOKEN_UNIQUE );
2019-02-19 15:49:54 +01:00
}
2017-09-15 13:43:16 +02:00
print '</td></tr>' ;
2017-02-22 06:33:52 +01:00
print '</table>' ;
2020-12-07 11:42:35 +01:00
print '</div>' ;
2017-02-22 06:33:52 +01:00
2020-10-27 18:19:31 +01:00
print dol_get_fiche_end ();
2017-02-22 06:33:52 +01:00
2021-08-20 14:41:30 +02:00
print $form -> buttonsSaveCancel ( " Save " , '' );
2017-02-22 06:33:52 +01:00
print '</form>' ;
print '<br><br>' ;
2017-05-13 22:05:58 +02:00
2019-11-13 19:35:39 +01:00
$token = '' ;
2017-05-13 22:05:58 +02:00
2017-09-15 13:43:16 +02:00
include DOL_DOCUMENT_ROOT . '/core/tpl/onlinepaymentlinks.tpl.php' ;
2017-02-22 06:33:52 +01:00
2021-01-28 22:30:13 +01:00
print info_admin ( $langs -> trans ( " ExampleOfTestCreditCard " , '4242424242424242 (no 3DSecure) or 4000000000003063 (3DSecure required) or 4000002760003184 (3DSecure2 required on all transaction) or 4000003800000446 (3DSecure2 required, the off-session allowed)' , '4000000000000101' , '4000000000000069' , '4000000000000341' ));
2018-03-05 16:48:38 +01:00
2021-02-26 21:17:52 +01:00
if ( ! empty ( $conf -> use_javascript_ajax )) {
2017-05-13 22:05:58 +02:00
print " \n " . '<script type="text/javascript">' ;
print ' $ ( document ) . ready ( function () {
2020-12-07 11:42:35 +01:00
$ ( " #apidoc " ) . hide ();
$ ( " #apidoca " ) . click ( function () {
console . log ( " We click on apidoca show/hide " );
$ ( " #apidoc " ) . show ();
$ ( " #apidoca " ) . hide ();
return false ;
});
}); ' ;
2017-05-13 22:05:58 +02:00
print '</script>' ;
}
2017-02-22 06:33:52 +01:00
2018-08-05 10:56:39 +02:00
// End of page
2017-05-13 22:05:58 +02:00
llxFooter ();
2017-02-22 06:33:52 +01:00
$db -> close ();