Better log
This commit is contained in:
parent
fc31a1182b
commit
03aa8c4b83
@ -21,6 +21,11 @@
|
|||||||
* For Paypal test: https://developer.paypal.com/
|
* For Paypal test: https://developer.paypal.com/
|
||||||
* For Paybox test: ???
|
* For Paybox test: ???
|
||||||
* For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing
|
* For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing
|
||||||
|
*
|
||||||
|
* Variants:
|
||||||
|
* - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new checkout API
|
||||||
|
* - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API
|
||||||
|
* - If no option set, we use old APIS (charge)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2099,7 +2104,7 @@ if (preg_match('/^dopayment/', $action)) // If we choosed/click on the payment
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
// Code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off and STRIPE_USE_NEW_CHECKOUT off
|
// Old code for payment with option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION off and STRIPE_USE_NEW_CHECKOUT off
|
||||||
|
|
||||||
// Create a Stripe client.
|
// Create a Stripe client.
|
||||||
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
|
var stripe = Stripe('<?php echo $stripearrayofkeys['publishable_key']; // Defined into config.php ?>');
|
||||||
|
|||||||
@ -286,9 +286,11 @@ class Stripe extends CommonObject
|
|||||||
/**
|
/**
|
||||||
* Get the Stripe payment intent. Create it with confirm=false
|
* Get the Stripe payment intent. Create it with confirm=false
|
||||||
* Warning. If a payment was tried and failed, a payment intent was created.
|
* Warning. If a payment was tried and failed, a payment intent was created.
|
||||||
* But if we change someting on object to pay (amount or other), reusing same payment intent is not allowed.
|
* But if we change something on object to pay (amount or other), reusing same payment intent is not allowed.
|
||||||
* Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay),
|
* Recommanded solution is to recreate a new payment intent each time we need one (old one will be automatically closed after a delay),
|
||||||
* that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old ones that will not be used)
|
* that's why i comment the part of code to retreive a payment intent with object id (never mind if we cumulate payment intent with old ones that will not be used)
|
||||||
|
* Note: This is used when option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on when making a payment from the public/payment/newpayment.php page
|
||||||
|
* but not when using the STRIPE_USE_NEW_CHECKOUT.
|
||||||
*
|
*
|
||||||
* @param double $amount Amount
|
* @param double $amount Amount
|
||||||
* @param string $currency_code Currency code
|
* @param string $currency_code Currency code
|
||||||
@ -307,7 +309,7 @@ class Stripe extends CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
dol_syslog("getPaymentIntent");
|
dol_syslog("getPaymentIntent", LOG_INFO, 1);
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
@ -479,7 +481,7 @@ class Stripe extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog("getPaymentIntent return error=".$error);
|
dol_syslog("getPaymentIntent return error=".$error, LOG_INFO, -1);
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user