From 864edce66595e6715e44b742c6311084c70d9732 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 4 Mar 2018 19:39:46 +0100 Subject: [PATCH] NEW Accept anonmymous events (no user assigned) NEW Online payment now record the payment on invoices --- htdocs/admin/agenda_extsites.php | 2 + htdocs/blockedlog/class/blockedlog.class.php | 3 +- htdocs/comm/action/class/actioncomm.class.php | 2 +- htdocs/compta/paiement.php | 4 +- .../compta/paiement/class/paiement.class.php | 3 +- .../paiement/{avalider.php => tovalidate.php} | 4 +- htdocs/core/class/html.form.class.php | 3 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/paypal.lang | 3 +- htdocs/paybox/admin/paybox.php | 11 + htdocs/paypal/admin/paypal.php | 9 + htdocs/paypal/lib/paypal.lib.php | 114 ++++++-- htdocs/public/payment/newpayment.php | 19 +- htdocs/public/payment/paymentok.php | 274 +++++++++++++++--- htdocs/public/paypal/newpayment.php | 2 +- htdocs/stripe/admin/stripe.php | 12 +- 17 files changed, 382 insertions(+), 86 deletions(-) rename htdocs/compta/paiement/{avalider.php => tovalidate.php} (96%) diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index dc995a4f88b..4c1b49d75e6 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -48,9 +48,11 @@ $MAXAGENDA=$conf->global->AGENDA_EXT_NB; // List of aviable colors $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5'); + /* * Actions */ + if ($actionsave) { $db->begin(); diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 3dc3ade52e5..3d41aba340a 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -667,11 +667,12 @@ class BlockedLog return -2; } - if (empty($this->action) || empty($this->fk_user) || empty($this->user_fullname)) { + if (empty($this->action)) { $this->error=$langs->trans("BadParameterWhenCallingCreateOfBlockedLog"); dol_syslog($this->error, LOG_WARNING); return -3; } + if (empty($this->fk_user)) $this->user_fullname='(Anonymous)'; $this->date_creation = dol_now(); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index ed0950826b8..f0bb9f92e22 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -212,7 +212,7 @@ class ActionComm extends CommonObject $now=dol_now(); // Check parameters - if (empty($this->userownerid)) + if (! isset($this->userownerid) || $this->userownerid === '') // $this->userownerid may be 0 (anonymous event) of > 0 { dol_syslog("You tried to create an event but mandatory property ownerid was not defined", LOG_WARNING); $this->errors[]='ErrorPropertyUserowneridNotDefined'; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 11751fe258b..4f17a4444f5 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -88,11 +88,11 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e if (empty($reshook)) { - if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='yes')) + if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm == 'yes')) { $error = 0; - $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); + $datepaye = dol_mktime(12, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int')); $paiement_id = 0; $totalpayment = 0; $multicurrency_totalpayment = 0; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 42106c1cb13..4d23637dfe7 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -209,9 +209,10 @@ class Paiement extends CommonObject $total = $totalamount_converted; // Maybe use price2num with MT for the converted value $mtotal = $totalamount; } + $note = ($this->note_public?$this->note_public:$this->note); $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement (entity, ref, datec, datep, amount, multicurrency_amount, fk_paiement, num_paiement, note, fk_user_creat)"; - $sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($this->note)."', ".$user->id.")"; + $sql.= " VALUES (".$conf->entity.", '".$this->ref."', '". $this->db->idate($now)."', '".$this->db->idate($this->datepaye)."', '".$total."', '".$mtotal."', ".$this->paiementid.", '".$this->num_paiement."', '".$this->db->escape($note)."', ".$user->id.")"; dol_syslog(get_class($this)."::Create insert paiement", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/tovalidate.php similarity index 96% rename from htdocs/compta/paiement/avalider.php rename to htdocs/compta/paiement/tovalidate.php index beb2fb77ecd..7e16b525233 100644 --- a/htdocs/compta/paiement/avalider.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -17,9 +17,9 @@ */ /** - * \file htdocs/compta/paiement/avalider.php + * \file htdocs/compta/paiement/tovalidate.php * \ingroup compta - * \brief Page liste des paiements a valider des factures clients + * \brief Page list payment to validate. Visible in menu when option BILL_ADD_PAYMENT_VALIDATION is on. */ require '../../main.inc.php'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index df26e44e080..7b74fc05850 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3421,7 +3421,8 @@ class Form } else { - print $langs->trans("NoActiveBankAccountDefined"); + if ($statut == 0) print $langs->trans("NoActiveBankAccountDefined"); + else print $langs->trans("NoBankAccountFound"); } } else { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 1237b72f826..000c228ef8e 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -818,7 +818,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { - $newmenu->add("/compta/paiement/avalider.php?leftmenu=customers_bills_tovalid",$langs->trans("MenuToValid"),2,$user->rights->facture->lire,'',$mainmenu,'customer_bills_tovalid'); + $newmenu->add("/compta/paiement/tovalidate.php?leftmenu=customers_bills_tovalid",$langs->trans("MenuToValid"),2,$user->rights->facture->lire,'',$mainmenu,'customer_bills_tovalid'); } $newmenu->add("/compta/paiement/rapport.php?leftmenu=customers_bills_reports",$langs->trans("Reportings"),2,$user->rights->facture->lire,'',$mainmenu,'customers_bills_reports'); diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 67dce721afe..1e6f9478313 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -708,6 +708,7 @@ CoreErrorTitle=System error CoreErrorMessage=Sorry, an error occurred. Contact your system administrator to check the logs or disable $dolibarr_main_prod=1 to get more information. CreditCard=Credit card ValidatePayment=Validate payment +CreditOrDebitCard=Credit or debit card FieldsWithAreMandatory=Fields with %s are mandatory FieldsWithIsForPublic=Fields with %s are shown on public list of members. If you don't want this, check off the "public" box. AccordingToGeoIPDatabase=(according to GeoIP convertion) diff --git a/htdocs/langs/en_US/paypal.lang b/htdocs/langs/en_US/paypal.lang index e1db55d5668..aec7404924b 100644 --- a/htdocs/langs/en_US/paypal.lang +++ b/htdocs/langs/en_US/paypal.lang @@ -30,4 +30,5 @@ ErrorCode=Error Code ErrorSeverityCode=Error Severity Code OnlinePaymentSystem=Online payment system PaypalLiveEnabled=Paypal live enabled (otherwise test/sandbox mode) -PaypalImportPayment=Import Paypal payments \ No newline at end of file +PaypalImportPayment=Import Paypal payments +PostActionAfterPayment=Post actions after payments \ No newline at end of file diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 79a6a62ad2a..1db6c1906a3 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -55,6 +55,8 @@ if ($action == 'setvalue' && $user->admin) $result=dolibarr_set_const($db, "PAYBOX_PBX_IDENTIFIANT",GETPOST('PAYBOX_PBX_IDENTIFIANT','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS",GETPOST('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS','int'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; @@ -183,6 +185,15 @@ print '
'.$langs->trans("Example").': '.$mysoc->name; print ''; +if (! empty($conf->banque->enabled)) +{ + print ''; + print $langs->trans("BankAccount").''; + print $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); + print ''; +} + + print ''; print $langs->trans("CSSUrlForPaymentForm").''; print ''; diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 711f898901c..23bf26d375f 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -55,6 +55,8 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS",GETPOST('PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS','int'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; $result=dolibarr_set_const($db, "PAYPAL_API_INTEGRAL_OR_PAYPALONLY",GETPOST('PAYPAL_API_INTEGRAL_OR_PAYPALONLY','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity); @@ -210,6 +212,13 @@ print 'name; print ''; +if (! empty($conf->banque->enabled)) +{ + print ''; + print $langs->trans("BankAccount").''; + print $form->select_comptes($conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); + print ''; +} print ''; print $langs->trans("CSSUrlForPaymentForm").''; diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index ecdd2f4fc3e..dc2e95c44da 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -192,7 +192,7 @@ function getPaypalPaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f * @param string $returnURL Url to use if payment is OK * @param string $cancelURL Url to use if payment is KO * @param string $tag Full tag - * @return void + * @return string No return (a redirect is done) if OK, or Error message if KO */ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$returnURL,$cancelURL,$tag) { @@ -272,11 +272,20 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]); $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]); - echo $langs->trans('SetExpressCheckoutAPICallFailed') . "
\n"; - echo $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg."
\n"; - echo $langs->trans('ShortErrorMessage') . ": " . $ErrorShortMsg."
\n"; - echo $langs->trans('ErrorCode') . ": " . $ErrorCode."
\n"; - echo $langs->trans('ErrorSeverityCode') . ": " . $ErrorSeverityCode."
\n"; + if ($ErrorCode == 10729) + { + $mesg.= "PayPal can't accept payments for this thirdparty. An address is defined but is not complete (missing State).
Ask system administrator to fix address or to setup Paypal module to accept payments even on not complete addresses (remove option PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS).
\n"; + } + else + { + $mesg = $langs->trans('SetExpressCheckoutAPICallFailed') . "
\n"; + $mesg.= $langs->trans('DetailedErrorMessage') . ": " . $ErrorLongMsg."
\n"; + $mesg.= $langs->trans('ShortErrorMessage') . ": " . $ErrorShortMsg."
\n"; + $mesg.= $langs->trans('ErrorCode') . ": " . $ErrorCode."
\n"; + $mesg.= $langs->trans('ErrorSeverityCode') . ": " . $ErrorSeverityCode."
\n"; + } + + return $mesg; } } @@ -300,6 +309,7 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re * phoneNum: the phoneNum entered on the merchant's site * email: the buyer email * desc: Product description + * See https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NVP/ * * @param double $paymentAmount Payment amount * @param string $currencyCodeType Currency @@ -307,8 +317,8 @@ function print_paypal_redirect($paymentAmount,$currencyCodeType,$paymentType,$re * @param string $returnURL Return Url * @param string $cancelURL Cancel Url * @param string $tag Full tag - * @param string $solutionType Type - * @param string $landingPage Landing page + * @param string $solutionType Type ('Mark' or 'Sole') + * @param string $landingPage Landing page ('Login' or 'Billing') * @param string $shipToName Ship to name * @param string $shipToStreet Ship to street * @param string $shipToCity Ship to city @@ -327,38 +337,86 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, // Construct the parameter string that describes the SetExpressCheckout API call in the shortcut implementation //declaring of global variables - global $conf, $langs; + global $conf, $langs, $mysoc; global $API_Endpoint, $API_Url, $API_version, $USE_PROXY, $PROXY_HOST, $PROXY_PORT; global $PAYPAL_API_USER, $PAYPAL_API_PASSWORD, $PAYPAL_API_SIGNATURE; $nvpstr = ''; - $nvpstr = $nvpstr . "&AMT=". urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT - $nvpstr = $nvpstr . "&PAYMENTACTION=" . urlencode($paymentType); // PAYMENTACTION deprecated by paypal -> PAYMENTREQUEST_n_PAYMENTACTION + $nvpstr = $nvpstr . "&VERSION=98.0"; $nvpstr = $nvpstr . "&RETURNURL=" . urlencode($returnURL); $nvpstr = $nvpstr . "&CANCELURL=" . urlencode($cancelURL); - $nvpstr = $nvpstr . "&CURRENCYCODE=" . urlencode($currencyCodeType); // CURRENCYCODE deprecated by paypal -> PAYMENTREQUEST_n_CURRENCYCODE - $nvpstr = $nvpstr . "&ADDROVERRIDE=1"; - //$nvpstr = $nvpstr . "&ALLOWNOTE=0"; - $nvpstr = $nvpstr . "&SHIPTONAME=" . urlencode($shipToName); // SHIPTONAME deprecated by paypal -> PAYMENTREQUEST_n_SHIPTONAME - $nvpstr = $nvpstr . "&SHIPTOSTREET=" . urlencode($shipToStreet); // - $nvpstr = $nvpstr . "&SHIPTOSTREET2=" . urlencode($shipToStreet2); - $nvpstr = $nvpstr . "&SHIPTOCITY=" . urlencode($shipToCity); - $nvpstr = $nvpstr . "&SHIPTOSTATE=" . urlencode($shipToState); - $nvpstr = $nvpstr . "&SHIPTOCOUNTRYCODE=" . urlencode($shipToCountryCode); - $nvpstr = $nvpstr . "&SHIPTOZIP=" . urlencode($shipToZip); - $nvpstr = $nvpstr . "&PHONENUM=" . urlencode($phoneNum); + if (! empty($conf->global->PAYPAL_ALLOW_NOTES)) + { + $nvpstr = $nvpstr . "&ALLOWNOTE=0"; + } + if (empty($conf->global->PAYPAL_REQUIRE_VALID_SHIPPING_ADDRESS)) + { + $nvpstr = $nvpstr . "&NOSHIPPING=1"; // An empty or not complete shipping address will be accepted + } + else + { + $nvpstr = $nvpstr . "&NOSHIPPING=0"; // A valid shipping address is required (full required fields mandatory) + } $nvpstr = $nvpstr . "&SOLUTIONTYPE=" . urlencode($solutionType); $nvpstr = $nvpstr . "&LANDINGPAGE=" . urlencode($landingPage); - //$nvpstr = $nvpstr . "&CUSTOMERSERVICENUMBER=" . urlencode($tag); // Hotline phone number - $nvpstr = $nvpstr . "&INVNUM=" . urlencode($tag); - if (! empty($email)) $nvpstr = $nvpstr . "&EMAIL=" . urlencode($email); - if (! empty($desc)) $nvpstr = $nvpstr . "&DESC=" . urlencode($desc); // DESC deprecated by paypal -> PAYMENTREQUEST_n_DESC + if (! empty($conf->global->PAYPAL_CUSTOMER_SERVICE_NUMBER)) + { + $nvpstr = $nvpstr . "&CUSTOMERSERVICENUMBER=" . urlencode($conf->global->PAYPAL_CUSTOMER_SERVICE_NUMBER); // Hotline phone number + } + $paypalprefix = 'PAYMENTREQUEST_0_'; + //$paypalprefix = ''; + if (! empty($paypalprefix) && $paymentType == 'Sole') $paymentType='Sale'; + + $nvpstr = $nvpstr . "&AMT=". urlencode($paymentAmount); // Total for all elements + + $nvpstr = $nvpstr . "&".$paypalprefix."INVNUM=" . urlencode($tag); + $nvpstr = $nvpstr . "&".$paypalprefix."AMT=". urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT + $nvpstr = $nvpstr . "&".$paypalprefix."ITEMAMT=". urlencode($paymentAmount); // AMT deprecated by paypal -> PAYMENTREQUEST_n_AMT + $nvpstr = $nvpstr . "&".$paypalprefix."PAYMENTACTION=" . urlencode($paymentType); // PAYMENTACTION deprecated by paypal -> PAYMENTREQUEST_n_PAYMENTACTION + $nvpstr = $nvpstr . "&".$paypalprefix."CURRENCYCODE=" . urlencode($currencyCodeType); // CURRENCYCODE deprecated by paypal -> PAYMENTREQUEST_n_CURRENCYCODE + + $nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_QTY0=1"; + $nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_AMT0=".urlencode($paymentAmount); + $nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_NAME0=".urlencode($desc); + $nvpstr = $nvpstr . "&".$paypalprefix."L_PAYMENTREQUEST_0_NUMBER0=0"; + + $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTONAME=" . urlencode($shipToName); // SHIPTONAME deprecated by paypal -> PAYMENTREQUEST_n_SHIPTONAME + $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOSTREET=" . urlencode($shipToStreet); // + $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOSTREET2=" . urlencode($shipToStreet2); + $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOCITY=" . urlencode($shipToCity); + $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOSTATE=" . urlencode($shipToState); + $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOCOUNTRYCODE=" . urlencode($shipToCountryCode); + $nvpstr = $nvpstr . "&".$paypalprefix."SHIPTOZIP=" . urlencode($shipToZip); + $nvpstr = $nvpstr . "&".$paypalprefix."PHONENUM=" . urlencode($phoneNum); + if (! empty($email)) $nvpstr = $nvpstr . "&".$paypalprefix."EMAIL=" . urlencode($email); // EMAIL deprecated by paypal -> PAYMENTREQUEST_n_EMAIL + if (! empty($desc)) $nvpstr = $nvpstr . "&".$paypalprefix."DESC=" . urlencode($desc); // DESC deprecated by paypal -> PAYMENTREQUEST_n_DESC + + if (! empty($conf->global->PAYPAL_LOGOIMG) && $mysoc->logo) + { + global $dolibarr_main_url_root; + + // Define $urlwithroot + $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); + $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file + //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current + + $urllogo=$urlwithroot."/viewimage.php?modulepart=mycompany&file=".$mysoc->logo; + $nvpstr = $nvpstr . "&LOGOIMG=" . urlencode($urllogo); + } + if (! empty($conf->global->PAYPAL_BRANDNAME)) + { + $nvpstr = $nvpstr . "&BRANDNAME=" . urlencode($conf->global->PAYPAL_BRANDNAME); // BRANDNAME + } + if (! empty($conf->global->PAYPAL_NOTETOBUYER)) + { + $nvpstr = $nvpstr . "&NOTETOBUYER=" . urlencode($conf->global->PAYPAL_NOTETOBUYER); // PAYPAL_NOTETOBUYER + } $_SESSION["FinalPaymentAmt"] = $paymentAmount; $_SESSION["currencyCodeType"] = $currencyCodeType; - $_SESSION["PaymentType"] = $paymentType; - $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR ']; // Payer ip + $_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole' + $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; // Payer ip //'--------------------------------------------------------------------------------------------------------------- //' Make the API call to PayPal diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index dc9bbad1188..350a73d3571 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -264,6 +264,7 @@ else if (! empty($conf->global->$paramcreditor)) $creditor=$conf->global->$param * Actions */ +// Action dopayment is called after choosing the payment mode if ($action == 'dopayment') { if ($paymentmethod == 'paypal') @@ -310,6 +311,7 @@ if ($action == 'dopayment') dol_syslog("PAYPAL_API_KO: $PAYPAL_API_KO", LOG_DEBUG); dol_syslog("PAYPAL_API_PRICE: $PAYPAL_API_PRICE", LOG_DEBUG); dol_syslog("PAYPAL_API_DEVISE: $PAYPAL_API_DEVISE", LOG_DEBUG); + // All those fields may be empty when making a payment for a free amount for example dol_syslog("shipToName: $shipToName", LOG_DEBUG); dol_syslog("shipToStreet: $shipToStreet", LOG_DEBUG); dol_syslog("shipToCity: $shipToCity", LOG_DEBUG); @@ -327,9 +329,10 @@ if ($action == 'dopayment') //$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE; // A redirect is added if API call successfull - print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG); + $mesg = print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG); - exit; + // If we are here, it means the Paypal redirect was not done, so we show error message + $action = ''; } } @@ -379,10 +382,12 @@ if ($action == 'dopayment') // Called when choosing Stripe mode, after the 'dopayment' if ($action == 'charge') { + $amountstripe = $amount; + // Correct the amount according to unit of currency // See https://support.stripe.com/questions/which-zero-decimal-currencies-does-stripe-support $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); - if (! in_array($currency, $arrayzerounitcurrency)) $amount=$amount * 100; + if (! in_array($currency, $arrayzerounitcurrency)) $amountstripe=$amountstripe * 100; dol_syslog("POST keys : ".join(',', array_keys($_POST)), LOG_DEBUG, 0, '_stripe'); dol_syslog("POST values: ".join(',', $_POST), LOG_DEBUG, 0, '_stripe'); @@ -411,7 +416,7 @@ if ($action == 'charge') dol_syslog("Create charge", LOG_DEBUG, 0, '_stripe'); $charge = \Stripe\Charge::create(array( 'customer' => $customer->id, - 'amount' => price2num($amount, 'MU'), + 'amount' => price2num($amountstripe, 'MU'), 'currency' => $currency, 'description' => 'Stripe payment: '.$FULLTAG, 'metadata' => array("FULLTAG" => $FULLTAG, 'Recipient' => $mysoc->name), @@ -850,7 +855,7 @@ if ($source == 'invoice') print ''."\n"; // Amount - print ''.$langs->trans("Amount"); + print ''.$langs->trans("PaymentAmount"); if (empty($amount) && empty($object->paye)) print ' ('.$langs->trans("ToComplete").')'; print ''; if (empty($object->paye)) @@ -1432,7 +1437,7 @@ if (preg_match('/^dopayment/',$action))
@@ -1442,7 +1447,7 @@ if (preg_match('/^dopayment/',$action))

- + diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index d74305890df..7e5413e6509 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -44,13 +44,7 @@ if (! empty($conf->paypal->enabled)) require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; } -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); +$langs->loadLangs(array("main","other","dict","bills","companies","paybox","paypal")); // Clean parameters if (! empty($conf->paypal->enabled)) @@ -130,6 +124,8 @@ $object = new stdClass(); // For triggers * View */ +$now = dol_now(); + dol_syslog("Callback url when a payment was done. query_string=".(dol_escape_htmltag($_SERVER["QUERY_STRING"])?dol_escape_htmltag($_SERVER["QUERY_STRING"]):'')." script_uri=".(dol_escape_htmltag($_SERVER["SCRIPT_URI"])?dol_escape_htmltag($_SERVER["SCRIPT_URI"]):''), LOG_DEBUG, 0, '_payment'); $tracepost = ""; @@ -183,7 +179,7 @@ if ($urllogo) if (! empty($conf->paypal->enabled)) { - if ($paymentmethod == 'paypal') + if ($paymentmethod == 'paypal') // We call this page only if payment is ok on payment system { if ($PAYPALTOKEN) { @@ -251,28 +247,187 @@ if (! empty($conf->paypal->enabled)) if (! empty($conf->paybox->enabled)) { - if ($paymentmethod == 'paybox') $ispaymentok = true; // We call this page only if payment is ok + if ($paymentmethod == 'paybox') $ispaymentok = true; // We call this page only if payment is ok on payment system } if (! empty($conf->stripe->enabled)) { - if ($paymentmethod == 'stripe') $ispaymentok = true; // We call this page only if payment is ok + if ($paymentmethod == 'stripe') $ispaymentok = true; // We call this page only if payment is ok on payment system } +// If data not provided from back url, search them into the session env +if (empty($ipaddress)) $ipaddress = $_SESSION['ipaddress']; +if (empty($TRANSACTIONID)) $TRANSACTIONID = $_SESSION['TRANSACTIONID']; +if (empty($FinalPaymentAmt)) $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; +if (empty($paymentType)) $paymentType = $_SESSION["paymentType"]; + +$fulltag = $FULLTAG; +$tmptag=dolExplodeIntoArray($fulltag,'.','='); + + +// Make complementary actions +$ispostactionok = 0; +$postactionmessages = array(); +if ($ispaymentok) +{ + if (in_array('MEM', array_keys($tmptag))) + { + // Record subscription + include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $member = new Adherent($db); + $result = $member->fetch(0, $tmptag['MEM']); + if ($result) + { + if (empty($paymentType)) $paymentType = 'CB'; + $paymentTypeId = dol_getIdFromCode($db, $paymentType,'c_paiement','code','id',1); + + if (! empty($FinalPaymentAmt) && $paymentTypeId > 0) + { + + + } + else + { + $postactionmessages[] = 'Failed to get a valid value for "amount paid" or "payment type" to record the payment of subscription for member '.$tmptag['MEM']; + $ispostactionok = -1; + } + } + else + { + $postactionmessages[] = 'Member for subscription payed '.$tmptag['MEM'].' was not found'; + $ispostactionok = -1; + } + } + elseif (in_array('INV', array_keys($tmptag))) + { + // Record payment + include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + $invoice = new Facture($db); + $result = $invoice->fetch(0, $tmptag['INV']); + if ($result) + { + $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; + + $paymentTypeId = 0; + if ($paymentmethod == 'paybox') $paymentTypeId = $conf->global->PAYBOX_PAYMENT_MODE_FOR_PAYMENTS; + if ($paymentmethod == 'paypal') $paymentTypeId = $conf->global->PAYPAL_PAYMENT_MODE_FOR_PAYMENTS; + if ($paymentmethod == 'stripe') $paymentTypeId = $conf->global->STRIPE_PAYMENT_MODE_FOR_PAYMENTS; + if (empty($paymentTypeId)) + { + $paymentType = $_SESSION["paymentType"]; + if (empty($paymentType)) $paymentType = 'CB'; + $paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1); + } + + $currencyCodeType = $_SESSION['currencyCodeType']; + + if (! empty($FinalPaymentAmt) && $paymentTypeId > 0) + { + // Creation of payment line + include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; + $paiement = new Paiement($db); + $paiement->datepaye = $now; + if ($currencyCodeType == $conf->currency) + { + $paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id + } + else + { + $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching + + $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; + $ispostactionok = -1; + $error++; // Not yet supported + } + $paiement->paiementid = $paymentTypeId; + $paiement->num_paiement = ''; + $paiement->note_public = 'Online payment using '.$paymentmethod.' from '.$ipaddress.' - Transaction ID = '.$TRANSACTIONID; + + if (! $error) + { + $paiement_id = $paiement->create($user, 1); // This include closing invoices and regenerating documents + if ($paiement_id < 0) + { + $postactionmessages[] = $paiement->error.' '.join("
\n", $paiement->errors); + $ispostactionok = -1; + $error++; + } + else + { + $postactionmessages[] = 'Payment created'; + $ispostactionok=1; + } + } + + if (! $error && ! empty($conf->banque->enabled)) + { + $bankaccountid = 0; + if ($paymentmethod == 'paybox') $bankaccountid = $conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS; + if ($paymentmethod == 'paypal') $bankaccountid = $conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS; + if ($paymentmethod == 'stripe') $bankaccountid = $conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS; + + if ($bankaccountid > 0) + { + $label='(CustomerInvoicePayment)'; + if ($invoice->type == Facture::TYPE_CREDIT_NOTE) $label='(CustomerInvoicePaymentBack)'; // Refund of a credit note + $result=$paiement->addPaymentToBank($user,'payment',$label, $bankaccountid, '', ''); + if ($result < 0) + { + $postactionmessages[] = $paiement->error.' '.joint("
\n", $paiement->errors); + $ispostactionok = -1; + $error++; + } + else + { + $postactionmessages[] = 'Bank entry of payment created'; + $ispostactionok=1; + } + } + else + { + $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Not way to record the payment.'; + $ispostactionok = -1; + $error++; + } + } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } + } + else + { + $postactionmessages[] = 'Failed to get a valid value for "amount paid" ('.$FinalPaymentAmt.') or "payment type" ('.$paymentType.') to record the payment of invoice '.$tmptag['INV']; + $ispostactionok = -1; + } + } + else + { + $postactionmessages[] = 'Invoice payed '.$tmptag['INV'].' was not found'; + $ispostactionok = -1; + } + } + else + { + // Nothing done + } +} + if ($ispaymentok) { // Get on url call - $fulltag = $FULLTAG; $onlinetoken = empty($PAYPALTOKEN)?$_SESSION['onlinetoken']:$PAYPALTOKEN; $payerID = empty($PAYPALPAYERID)?$_SESSION['payerID']:$PAYPALPAYERID; // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; - // From env - $ipaddress = $_SESSION['ipaddress']; - $TRANSACTIONID = $_SESSION['TRANSACTIONID']; // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; @@ -296,6 +451,10 @@ if ($ispaymentok) // Send an email if ($sendemail) { + $companylangs = new Translate('', $conf); + $companylangs->setDefaultLang($mysoc->default_lang); + $companylangs->loadLangs(array('main','members','bills','paypal','paybox')); + $sendto=$sendemail; $from=$conf->global->MAILING_EMAIL_FROM; // Define $urlwithroot @@ -317,25 +476,56 @@ if ($ispaymentok) else $appli.=" ".DOL_VERSION; $urlback=$_SERVER["REQUEST_URI"]; - $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("NewOnlinePaymentReceived"); + $topic='['.$appli.'] '.$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived"); $content=""; - if (! empty($tmptag['MEM'])) + if (in_array('MEM', array_keys($tmptag))) { - $langs->load("members"); $url=$urlwithroot."/adherents/card_subscriptions.php?rowid=".$tmptag['MEM']; - $content.=$langs->trans("PaymentSubscription")."
\n"; - $content.=$langs->trans("MemberId").': '.$tmptag['MEM']."
\n"; - $content.=$langs->trans("Link").': '.$url.''."
\n"; + $content.=''.$companylangs->trans("PaymentSubscription")."

\n"; + $content.=$companylangs->trans("MemberId").': '.$tmptag['MEM']."
\n"; + $content.=$companylangs->trans("Link").': '.$url.''."
\n"; + } + elseif (in_array('INV', array_keys($tmptag))) + { + $url=$urlwithroot."/compta/facture/card.php?ref=".$tmptag['INV']; + $content.=''.$companylangs->trans("Payment")."

\n"; + $content.=$companylangs->trans("Invoice").': '.$tmptag['INV']."
\n"; + //$content.=$companylangs->trans("ThirdPartyId").': '.$tmptag['CUS']."
\n"; + $content.=$companylangs->trans("Link").': '.$url.''."
\n"; } else { - $content.=$langs->transnoentitiesnoconv("NewOnlinePaymentReceived")."
\n"; + $content.=$companylangs->transnoentitiesnoconv("NewOnlinePaymentReceived")."
\n"; } + $content.=$companylangs->transnoentities("PostActionAfterPayment").' : '; + if ($ispostactionok > 0) + { + //$topic.=' ('.$companylangs->transnoentitiesnoconv("Status").' '.$companylangs->transnoentitiesnoconv("OK").')'; + $content.=''.$companylangs->transnoentitiesnoconv("OK").''; + } + elseif ($ispostactionok == 0) + { + $content.=$companylangs->transnoentitiesnoconv("None"); + } + else + { + $topic.=($ispostactionok ? '' : ' ('.$companylangs->trans("WarningPostActionErrorAfterPayment").')'); + $content.=''.$companylangs->transnoentitiesnoconv("Error").''; + } + $content.='
'."\n"; + foreach($postactionmessages as $postactionmessage) + { + $content.=' * '.$postactionmessage.'
'."\n"; + } + $content.='
'."\n"; + $content.="
\n"; - $content.=$langs->transnoentitiesnoconv("TechnicalInformation").":
\n"; - $content.=$langs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."
\n"; - $content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."
\n"; - $content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; + $content.=''.$companylangs->transnoentitiesnoconv("TechnicalInformation").":
\n"; + $content.=$companylangs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."
\n"; + $content.=$companylangs->transnoentitiesnoconv("TransactionId").': '.$TRANSACTIONID."
\n"; + $content.=$companylangs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."
\n"; + $content.="
\n"; + $content.="tag=".$fulltag."
\ntoken=".$onlinetoken."
\npaymentType=".$paymentType."
\ncurrencycodeType=".$currencyCodeType."
\npayerId=".$payerID."
\nipaddress=".$ipaddress."
\nFinalPaymentAmt=".$FinalPaymentAmt."
\n"; $ishtml=dol_textishtml($content); // May contain urls @@ -356,15 +546,12 @@ if ($ispaymentok) else { // Get on url call - $fulltag = $FULLTAG; - $onlinetoken = empty($PAYPALTOKEN)?$_SESSION['onlinetoken']:$PAYPALTOKEN; + $onlinetoken = empty($PAYPALTOKEN)?$_SESSION['onlinetoken']:$PAYPALTOKEN; $payerID = empty($PAYPALPAYERID)?$_SESSION['payerID']:$PAYPALPAYERID; // Set by newpayment.php $paymentType = $_SESSION['PaymentType']; $currencyCodeType = $_SESSION['currencyCodeType']; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; - // From env - $ipaddress = $_SESSION['ipaddress']; // Appel des triggers include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; @@ -389,12 +576,14 @@ else if ($paymentmethod == 'paybox' && ! empty($conf->global->PAYBOX_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->PAYBOX_PAYONLINE_SENDEMAIL; if ($paymentmethod == 'stripe' && ! empty($conf->global->STRIPE_PAYONLINE_SENDEMAIL)) $sendemail=$conf->global->STRIPE_PAYONLINE_SENDEMAIL; - $tmptag=dolExplodeIntoArray($fulltag,'.','='); - // Send an email if ($sendemail) { - $sendto=$sendemail; + $companylangs = new Translate('', $conf); + $companylangs->setDefaultLang($mysoc->default_lang); + $companylangs->loadLangs(array('main','members','bills','paypal','paybox')); + + $sendto=$sendemail; $from=$conf->global->MAILING_EMAIL_FROM; // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); @@ -415,14 +604,17 @@ else else $appli.=" ".DOL_VERSION; $urlback=$_SERVER["REQUEST_URI"]; - $topic='['.$appli.'] '.$langs->transnoentitiesnoconv("ValidationOfPaymentFailed"); + $topic='['.$appli.'] '.$companylangs->transnoentitiesnoconv("ValidationOfPaymentFailed"); $content=""; - $content.=$langs->transnoentitiesnoconv("PaymentSystemConfirmPaymentPageWasCalledButFailed")."\n"; - $content.="\n"; - $content.=$langs->transnoentitiesnoconv("TechnicalInformation").":\n"; - $content.=$langs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."\n"; - $content.=$langs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."\n"; - $content.="tag=".$fulltag."\ntoken=".$onlinetoken." paymentType=".$paymentType." currencycodeType=".$currencyCodeType." payerId=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt; + $content.=''.$companylangs->transnoentitiesnoconv("PaymentSystemConfirmPaymentPageWasCalledButFailed")."\n"; + + $content.="
\n"; + $content.=''.$companylangs->transnoentitiesnoconv("TechnicalInformation").":
\n"; + $content.=$companylangs->transnoentitiesnoconv("OnlinePaymentSystem").': '.$paymentmethod."
\n"; + $content.=$companylangs->transnoentitiesnoconv("ReturnURLAfterPayment").': '.$urlback."
\n"; + $content.="
\n"; + $content.="tag=".$fulltag."
\ntoken=".$onlinetoken."
\npaymentType=".$paymentType."
\ncurrencycodeType=".$currencyCodeType."
\npayerId=".$payerID."
\nipaddress=".$ipaddress."
\nFinalPaymentAmt=".$FinalPaymentAmt."
\n"; + $ishtml=dol_textishtml($content); // May contain urls @@ -448,6 +640,10 @@ print "\n
\n"; htmlPrintOnlinePaymentFooter($mysoc,$langs,0,$suffix); +// Clean session variables to avoid duplicate actions if post is resent +unset($_SESSION["FinalPaymentAmt"]); +unset($_SESSION["TRANSACTIONID"]); + llxFooter('', 'public'); $db->close(); diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index b1ecfa43803..24abc52526c 100644 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -250,7 +250,7 @@ if (GETPOST('action','aZ09') == 'dopayment') //$_SESSION["FinalPaymentAmt"]=$PAYPAL_API_PRICE; // A redirect is added if API call successfull - print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG); + $mesg = print_paypal_redirect($PAYPAL_API_PRICE,$PAYPAL_API_DEVISE,$PAYPAL_PAYMENT_TYPE,$PAYPAL_API_OK,$PAYPAL_API_KO, $FULLTAG); exit; } diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 5762c54a698..8f7a8ae9d86 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -56,7 +56,9 @@ if ($action == 'setvalue' && $user->admin) $result=dolibarr_set_const($db, "STRIPE_LIVE_SECRET_KEY",GETPOST('STRIPE_LIVE_SECRET_KEY','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CREDITOR",GETPOST('ONLINE_PAYMENT_CREDITOR','alpha'),'chaine',0,'',$conf->entity); - if (! $result > 0) $error++; + if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "STRIPE_BANK_ACCOUNT_FOR_PAYMENTS",GETPOST('STRIPE_BANK_ACCOUNT_FOR_PAYMENTS','int'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM",GETPOST('ONLINE_PAYMENT_MESSAGE_FORM','alpha'),'chaine',0,'',$conf->entity); @@ -195,6 +197,14 @@ print 'name; print ''; +if (! empty($conf->banque->enabled)) +{ + print ''; + print $langs->trans("BankAccount").''; + print $form->select_comptes($conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS, 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); + print ''; +} + print ''; print $langs->trans("CSSUrlForPaymentForm").''; print '';