Fix trans
This commit is contained in:
parent
f11943126a
commit
d1c49c7021
@ -97,22 +97,28 @@ function payment_supplier_prepare_head(Paiement $object)
|
|||||||
*/
|
*/
|
||||||
function getValidOnlinePaymentMethods($paymentmethod = '')
|
function getValidOnlinePaymentMethods($paymentmethod = '')
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $langs;
|
||||||
|
|
||||||
$validpaymentmethod=array();
|
$validpaymentmethod=array();
|
||||||
|
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'paypal') && ! empty($conf->paypal->enabled))
|
if ((empty($paymentmethod) || $paymentmethod == 'paypal') && ! empty($conf->paypal->enabled))
|
||||||
{
|
{
|
||||||
|
$langs->load("paypal");
|
||||||
$validpaymentmethod['paypal']='valid';
|
$validpaymentmethod['paypal']='valid';
|
||||||
}
|
}
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && ! empty($conf->paybox->enabled))
|
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && ! empty($conf->paybox->enabled))
|
||||||
{
|
{
|
||||||
|
$langs->load("paybox");
|
||||||
$validpaymentmethod['paybox']='valid';
|
$validpaymentmethod['paybox']='valid';
|
||||||
}
|
}
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'stripe') && ! empty($conf->stripe->enabled))
|
if ((empty($paymentmethod) || $paymentmethod == 'stripe') && ! empty($conf->stripe->enabled))
|
||||||
{
|
{
|
||||||
|
$langs->load("stripe");
|
||||||
$validpaymentmethod['stripe']='valid';
|
$validpaymentmethod['stripe']='valid';
|
||||||
}
|
}
|
||||||
|
// TODO Add trigger
|
||||||
|
|
||||||
|
|
||||||
return $validpaymentmethod;
|
return $validpaymentmethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,6 +179,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
|||||||
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
|
if (empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) $out.='&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
|
||||||
else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
else $out.='&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN, 2);
|
||||||
}
|
}
|
||||||
|
//if ($mode) $out.='&noidempotency=1';
|
||||||
}
|
}
|
||||||
elseif ($type == 'order')
|
elseif ($type == 'order')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,7 +20,6 @@ ToOfferALinkForOnlinePaymentOnContractLine=URL to offer a %s online payment user
|
|||||||
ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer a %s online payment user interface for a free amount
|
ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer a %s online payment user interface for a free amount
|
||||||
ToOfferALinkForOnlinePaymentOnMemberSubscription=URL to offer a %s online payment user interface for a member subscription
|
ToOfferALinkForOnlinePaymentOnMemberSubscription=URL to offer a %s online payment user interface for a member subscription
|
||||||
ToOfferALinkForOnlinePaymentOnDonation=URL to offer a %s online payment, user interface for payment of donation
|
ToOfferALinkForOnlinePaymentOnDonation=URL to offer a %s online payment, user interface for payment of donation
|
||||||
YouCanAddTagOnUrl=You can also add url parameter <b>&tag=<i>value</i></b> to any of those URL (required only for free payment) to add your own payment comment tag.
|
|
||||||
SetupPayBoxToHavePaymentCreatedAutomatically=Setup your Paybox with url <b>%s</b> to have payment created automatically when validated by Paybox.
|
SetupPayBoxToHavePaymentCreatedAutomatically=Setup your Paybox with url <b>%s</b> to have payment created automatically when validated by Paybox.
|
||||||
YourPaymentHasBeenRecorded=This page confirms that your payment has been recorded. Thank you.
|
YourPaymentHasBeenRecorded=This page confirms that your payment has been recorded. Thank you.
|
||||||
YourPaymentHasNotBeenRecorded=Your payment has NOT been recorded and the transaction has been canceled. Thank you.
|
YourPaymentHasNotBeenRecorded=Your payment has NOT been recorded and the transaction has been canceled. Thank you.
|
||||||
|
|||||||
@ -21,7 +21,7 @@ ToOfferALinkForOnlinePaymentOnInvoice=URL to offer a %s online payment user inte
|
|||||||
ToOfferALinkForOnlinePaymentOnContractLine=URL to offer a %s online payment user interface for a contract line
|
ToOfferALinkForOnlinePaymentOnContractLine=URL to offer a %s online payment user interface for a contract line
|
||||||
ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer a %s online payment user interface for a free amount
|
ToOfferALinkForOnlinePaymentOnFreeAmount=URL to offer a %s online payment user interface for a free amount
|
||||||
ToOfferALinkForOnlinePaymentOnMemberSubscription=URL to offer a %s online payment user interface for a member subscription
|
ToOfferALinkForOnlinePaymentOnMemberSubscription=URL to offer a %s online payment user interface for a member subscription
|
||||||
YouCanAddTagOnUrl=You can also add url parameter <b>&tag=<i>value</i></b> to any of those URL (required only for free payment) to add your own payment comment tag.
|
YouCanAddTagOnUrl=You can also add url parameter <b>&tag=<i>value</i></b> to any of those URL (mandatory only for free payment) to add your own payment comment tag.<br>For free payment, you may also add the parameter <strong>&noidempotency=1</strong> so the same link with same tag can be used several times (some payment mode may limit the payment to 1 for each different link without this parameter)
|
||||||
SetupStripeToHavePaymentCreatedAutomatically=Setup your Stripe with url <b>%s</b> to have payment created automatically when validated by Stripe.
|
SetupStripeToHavePaymentCreatedAutomatically=Setup your Stripe with url <b>%s</b> to have payment created automatically when validated by Stripe.
|
||||||
AccountParameter=Account parameters
|
AccountParameter=Account parameters
|
||||||
UsageParameter=Usage parameters
|
UsageParameter=Usage parameters
|
||||||
|
|||||||
@ -63,10 +63,10 @@ $action=GETPOST('action', 'aZ09');
|
|||||||
// tag (a free text, required if type is empty)
|
// tag (a free text, required if type is empty)
|
||||||
// currency (iso code)
|
// currency (iso code)
|
||||||
|
|
||||||
$suffix=GETPOST("suffix", 'aZ09');
|
$suffix = GETPOST("suffix", 'aZ09');
|
||||||
$amount=price2num(GETPOST("amount", 'alpha'));
|
$amount = price2num(GETPOST("amount", 'alpha'));
|
||||||
if (! GETPOST("currency", 'alpha')) $currency=$conf->currency;
|
if (! GETPOST("currency", 'alpha')) $currency = $conf->currency;
|
||||||
else $currency=GETPOST("currency", 'alpha');
|
else $currency = GETPOST("currency", 'alpha');
|
||||||
$source = GETPOST("s", 'alpha')?GETPOST("s", 'alpha'):GETPOST("source", 'alpha');
|
$source = GETPOST("s", 'alpha')?GETPOST("s", 'alpha'):GETPOST("source", 'alpha');
|
||||||
$download = GETPOST('d', 'int')?GETPOST('d', 'int'):GETPOST('download', 'int');
|
$download = GETPOST('d', 'int')?GETPOST('d', 'int'):GETPOST('download', 'int');
|
||||||
|
|
||||||
@ -159,7 +159,7 @@ $urlko=preg_replace('/&$/', '', $urlko); // Remove last &
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Find valid payment methods
|
// Make special controls
|
||||||
|
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'paypal') && ! empty($conf->paypal->enabled))
|
if ((empty($paymentmethod) || $paymentmethod == 'paypal') && ! empty($conf->paypal->enabled))
|
||||||
{
|
{
|
||||||
@ -186,36 +186,18 @@ if ((empty($paymentmethod) || $paymentmethod == 'paypal') && ! empty($conf->payp
|
|||||||
dol_print_error('', "Paypal setup param PAYPAL_API_SIGNATURE not defined");
|
dol_print_error('', "Paypal setup param PAYPAL_API_SIGNATURE not defined");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$validpaymentmethod['paypal']='valid';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && ! empty($conf->paybox->enabled))
|
if ((empty($paymentmethod) || $paymentmethod == 'paybox') && ! empty($conf->paybox->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("paybox");
|
// No specific test for the moment
|
||||||
|
|
||||||
// TODO Chek setup is complete
|
|
||||||
|
|
||||||
$validpaymentmethod['paybox']='valid';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((empty($paymentmethod) || $paymentmethod == 'stripe') && ! empty($conf->stripe->enabled))
|
if ((empty($paymentmethod) || $paymentmethod == 'stripe') && ! empty($conf->stripe->enabled))
|
||||||
{
|
{
|
||||||
$langs->load("stripe");
|
require_once DOL_DOCUMENT_ROOT.'/stripe/config.php'; // This include also /stripe/lib/stripe.lib.php, /includes/stripe/init.php, ...
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/stripe/config.php';
|
|
||||||
/* already included into /stripe/config.php
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/stripe/lib/stripe.lib.php';
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/includes/stripe/init.php';
|
|
||||||
*/
|
|
||||||
|
|
||||||
$validpaymentmethod['stripe']='valid';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Replace previous set of $validpaymentmethod with this line:
|
// Initialize $validpaymentmethod
|
||||||
//$validpaymentmethod = getValidOnlinePaymentMethods($paymentmethod);
|
$validpaymentmethod = getValidOnlinePaymentMethods($paymentmethod);
|
||||||
|
|
||||||
|
|
||||||
// Check security token
|
// Check security token
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user