More log to debug payment errors
This commit is contained in:
parent
79308b332b
commit
d1af419d02
@ -105,7 +105,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType,
|
|||||||
$landingPage = 'Billing';
|
$landingPage = 'Billing';
|
||||||
}
|
}
|
||||||
|
|
||||||
dol_syslog("expresscheckout redirect with callSetExpressCheckout $paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $tag, $solutionType, $landingPage, $shipToName, $shipToStreet, $shipToCity, $shipToState, $shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum");
|
dol_syslog("print_paypal_redirect expresscheckout redirect with callSetExpressCheckout $paymentAmount, $currencyCodeType, $paymentType, $returnURL, $cancelURL, $tag, $solutionType, $landingPage, $shipToName, $shipToStreet, $shipToCity, $shipToState, $shipToCountryCode, $shipToZip, $shipToStreet2, $phoneNum");
|
||||||
$resArray = callSetExpressCheckout(
|
$resArray = callSetExpressCheckout(
|
||||||
$paymentAmount,
|
$paymentAmount,
|
||||||
$currencyCodeType,
|
$currencyCodeType,
|
||||||
@ -127,6 +127,8 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType,
|
|||||||
$desc
|
$desc
|
||||||
);
|
);
|
||||||
|
|
||||||
|
dol_syslog("print_paypal_redirect resArray=".var_export($resArray, true), LOG_DEBUG);
|
||||||
|
|
||||||
$ack = strtoupper($resArray["ACK"]);
|
$ack = strtoupper($resArray["ACK"]);
|
||||||
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING")
|
if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING")
|
||||||
{
|
{
|
||||||
@ -134,6 +136,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType,
|
|||||||
|
|
||||||
// Redirect to paypal.com here
|
// Redirect to paypal.com here
|
||||||
$payPalURL = $API_Url.$token;
|
$payPalURL = $API_Url.$token;
|
||||||
|
dol_syslog("Redirect to ".$payPalURL, LOG_INFO);
|
||||||
header("Location: ".$payPalURL);
|
header("Location: ".$payPalURL);
|
||||||
exit;
|
exit;
|
||||||
} else {
|
} else {
|
||||||
@ -282,7 +285,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType,
|
|||||||
$_SESSION["FinalPaymentAmt"] = $paymentAmount;
|
$_SESSION["FinalPaymentAmt"] = $paymentAmount;
|
||||||
$_SESSION["currencyCodeType"] = $currencyCodeType;
|
$_SESSION["currencyCodeType"] = $currencyCodeType;
|
||||||
$_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole'
|
$_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole'
|
||||||
$_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; // Payer ip
|
$_SESSION['ipaddress'] = getUserRemoteIP(); // Payer ip
|
||||||
|
|
||||||
//'---------------------------------------------------------------------------------------------------------------
|
//'---------------------------------------------------------------------------------------------------------------
|
||||||
//' Make the API call to PayPal
|
//' Make the API call to PayPal
|
||||||
@ -433,7 +436,7 @@ function DirectPayment($paymentType, $paymentAmount, $creditCardType, $creditCar
|
|||||||
$nvpstr = $nvpstr . "&CITY=" . urlencode($city);
|
$nvpstr = $nvpstr . "&CITY=" . urlencode($city);
|
||||||
$nvpstr = $nvpstr . "&STATE=" . urlencode($state);
|
$nvpstr = $nvpstr . "&STATE=" . urlencode($state);
|
||||||
$nvpstr = $nvpstr . "&COUNTRYCODE=" . urlencode($countryCode);
|
$nvpstr = $nvpstr . "&COUNTRYCODE=" . urlencode($countryCode);
|
||||||
$nvpstr = $nvpstr . "&IPADDRESS=" . $_SERVER['REMOTE_ADDR'];
|
$nvpstr = $nvpstr . "&IPADDRESS=" . getUserRemotIP();
|
||||||
$nvpstr = $nvpstr . "&INVNUM=" . urlencode($tag);
|
$nvpstr = $nvpstr . "&INVNUM=" . urlencode($tag);
|
||||||
|
|
||||||
$resArray=hash_call("DoDirectPayment", $nvpstr);
|
$resArray=hash_call("DoDirectPayment", $nvpstr);
|
||||||
|
|||||||
@ -31,7 +31,7 @@ if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined
|
|||||||
if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
|
if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1');
|
||||||
|
|
||||||
// For MultiCompany module.
|
// For MultiCompany module.
|
||||||
// Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
|
// Do not use GETPOST here, function is not defined and this test must be done before including main.inc.php
|
||||||
// TODO This should be useless. Because entity must be retrieve from object ref and not from url.
|
// TODO This should be useless. Because entity must be retrieve from object ref and not from url.
|
||||||
$entity = (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1));
|
$entity = (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1));
|
||||||
if (is_numeric($entity)) define("DOLENTITY", $entity);
|
if (is_numeric($entity)) define("DOLENTITY", $entity);
|
||||||
|
|||||||
@ -409,7 +409,7 @@ if ($ispaymentok)
|
|||||||
$postactionmessages[] = $errmsg;
|
$postactionmessages[] = $errmsg;
|
||||||
$ispostactionok = -1;
|
$ispostactionok = -1;
|
||||||
} else {
|
} else {
|
||||||
$postactionmessages[] = 'Subscription created';
|
$postactionmessages[] = 'Subscription created (id='.$crowid.')';
|
||||||
$ispostactionok = 1;
|
$ispostactionok = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user