【发布时间】:2020-06-21 08:35:29
【问题描述】:
我通过 php 使用旧的 NVP REST API 和方法“DoExpressCheckoutPayment” 创建一个简单的 curl,返回一个 transactionID
谁能告诉我如何将订单状态设置为“已确认”? 使用什么方法和参数?用于数字产品(因此没有跟踪信息)
只是碰巧,paypal 有时会将交易设置为 HOLD,直到我将其手动设置为确认,这是很多工作。
如何使用 curl 来确认交易订单状态?什么方法?
这是我目前使用的:
$API_Endpoint = "https://api-3t".$paypalmode.".paypal.com/nvp";
$version = urlencode('76.0');
// Set the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
// Set the API operation, version, and API signature in the request.
$nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_";
// Set the request as a POST FIELD for curl.
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
// Get response from the server.
$httpResponse = curl_exec($ch);
【问题讨论】: