Paypal重复快速结账 - GetExpressCheckoutDetails不工作

时间:2016-09-30 12:08:11

标签: php paypal

您好我使用Paypal重复快速结账方法所有其他使用GetExpressCheckoutDetails的详细信息但PAYMENTREQUEST_0_CUSTOM无效。没有从PAYMENTREQUEST_0_CUSTOM的PayPal获取详细信息。

$resArray = GetShippingDetails( $token );
$ack = strtoupper($resArray["ACK"]);
   if( $ack == "SUCCESS" || $ack == "SUCESSWITHWARNING") 
  {
/*
' The information that is returned by the GetExpressCheckoutDetails call should be integrated by the partner into his Order Review 
' page      
*/
$email          = $resArray["EMAIL"]; // ' Email address of payer.
$payerId            = $resArray["PAYERID"]; // ' Unique PayPal customer account identification number.
$payerStatus        = $resArray["PAYERSTATUS"]; // ' Status of payer. Character length and limitations: 10 single-byte alphabetic characters.
$salutation         = $resArray["SALUTATION"]; // ' Payer's salutation.
$firstName          = $resArray["FIRSTNAME"]; // ' Payer's first name.
$middleName         = $resArray["MIDDLENAME"]; // ' Payer's middle name.
$lastName           = $resArray["LASTNAME"]; // ' Payer's last name.
$suffix             = $resArray["SUFFIX"]; // ' Payer's suffix.
$curnyCode          = $resArray["CURRENCYCODE"]; // ' Payer's country of residence in the form of ISO standard 3166 two-character country codes.
$id                 = $resArray["PAYMENTREQUEST_0_CUSTOM"]; // ' Payer's country of residence in the form of ISO standard 3166 two-character country codes.
$TOKEN              = $resArray["TOKEN"]; // ' Payer's country of residence in the form of ISO standard 3166 two-character country codes.
$business           = $resArray["BUSINESS"]; // ' Payer's business name.
$shipToName         = $resArray["SHIPTONAME"]; // ' Person's name associated with this address.
$shipToStreet       = $resArray["SHIPTOSTREET"]; // ' First street address.
$shipToStreet2      = $resArray["SHIPTOSTREET2"]; // ' Second street address.
$shipToCity         = $resArray["SHIPTOCITY"]; // ' Name of city.
$shipToState        = $resArray["SHIPTOSTATE"]; // ' State or province
$shipToCntryCode    = $resArray["SHIPTOCOUNTRYCODE"]; // ' Country code. 
$shipToZip          = $resArray["SHIPTOZIP"]; // ' U.S. Zip code or other country-specific postal code.
$addressStatus      = $resArray["ADDRESSSTATUS"]; // ' Status of street address on file with PayPal   
$invoiceNumber      = $resArray["INVNUM"]; // ' Your own invoice or tracking number, as set by you in the element of the same name in SetExpressCheckout request .
$phonNumber         = $resArray["PHONENUM"]; // ' Payer's contact telephone number. Note:  PayPal returns a contact telephone number only if your Merchant account profile settings require that the buyer enter one. 
$transaction_id     = '123'; // ' Payer's contact telephone number. Note:  PayPal returns a contact telephone number only if your Merchant account profile settings require that the buyer enter one. 
$status     = 'still'; // ' Payer's contact telephone number. Note:  PayPal returns a contact telephone number only if your Merchant account profile settings require that the buyer enter one. 

require_once(dirname( dirname( dirname( dirname( __FILE__ )))) . '/wp-load.php' );

global $wpdb;

$update_data = array('transaction_id' => $transaction_id,
                   'status' => $status);

$where = array('token' => $id );

$update_format = array('%s', '%s');

$wpdb->update('wpcads_paypal', $update_data, $where, $update_format);

} 

0 个答案:

没有答案