diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 655d501cac3..873678adcae 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -105,7 +105,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType, $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( $paymentAmount, $currencyCodeType, @@ -127,6 +127,8 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType, $desc ); + dol_syslog("print_paypal_redirect resArray=".var_export($resArray, true), LOG_DEBUG); + $ack = strtoupper($resArray["ACK"]); if ($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING") { @@ -134,6 +136,7 @@ function print_paypal_redirect($paymentAmount, $currencyCodeType, $paymentType, // Redirect to paypal.com here $payPalURL = $API_Url.$token; + dol_syslog("Redirect to ".$payPalURL, LOG_INFO); header("Location: ".$payPalURL); exit; } else { @@ -282,7 +285,7 @@ function callSetExpressCheckout($paymentAmount, $currencyCodeType, $paymentType, $_SESSION["FinalPaymentAmt"] = $paymentAmount; $_SESSION["currencyCodeType"] = $currencyCodeType; $_SESSION["PaymentType"] = $paymentType; // 'Mark', 'Sole' - $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; // Payer ip + $_SESSION['ipaddress'] = getUserRemoteIP(); // Payer ip //'--------------------------------------------------------------------------------------------------------------- //' Make the API call to PayPal @@ -433,7 +436,7 @@ function DirectPayment($paymentType, $paymentAmount, $creditCardType, $creditCar $nvpstr = $nvpstr . "&CITY=" . urlencode($city); $nvpstr = $nvpstr . "&STATE=" . urlencode($state); $nvpstr = $nvpstr . "&COUNTRYCODE=" . urlencode($countryCode); - $nvpstr = $nvpstr . "&IPADDRESS=" . $_SERVER['REMOTE_ADDR']; + $nvpstr = $nvpstr . "&IPADDRESS=" . getUserRemotIP(); $nvpstr = $nvpstr . "&INVNUM=" . urlencode($tag); $resArray=hash_call("DoDirectPayment", $nvpstr); diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index ac92c958931..b99c4a39392 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -31,7 +31,7 @@ if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined if (!defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // 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. $entity = (!empty($_GET['e']) ? (int) $_GET['e'] : (!empty($_POST['e']) ? (int) $_POST['e'] : 1)); if (is_numeric($entity)) define("DOLENTITY", $entity); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index ef4931c4b4a..346e4003e4c 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -409,7 +409,7 @@ if ($ispaymentok) $postactionmessages[] = $errmsg; $ispostactionok = -1; } else { - $postactionmessages[] = 'Subscription created'; + $postactionmessages[] = 'Subscription created (id='.$crowid.')'; $ispostactionok = 1; } }