gpt4 book ai didi

node.js - SetExpressCheckout 和 GetExpressCheckoutDetails 都缺少电话号码

转载 作者:太空宇宙 更新时间:2023-11-03 16:28:31 26 4
gpt4 key购买 nike

我正在构建一个电子商务网站(使用 node.js)并使用经典的 PayPal api。我需要客户输入他们的电话号码,以便在他们的订单出现问题时联系他们。

为此,我在网站设置下更改了教皇帐户的设置,要求在结账时提供电话号码。在调用 SetExpressCheckout 并且客户输入了他的信息(包括电话号码)之后,我得到了成功状态的响应以及其他订单信息。

但是,响应中缺少电话号码。根据文档,它应该在 PHONENUM 字段中。我也尝试调用 GetExpressCheckoutDetails 以获取电话,但它仍然不见了。

这里请求调用:

var post_data = {
USER: paypalUser,
PWD: paypalPassword,
SIGNATURE: paypalSignature,
METHOD: "SetExpressCheckout",
VERSION: 93,
SOLUTIONTYPE: "Sole",
L_PAYMENTREQUEST_0_NAME0 : info.name,
L_PAYMENTREQUEST_0_DESC0 : info.description,
L_PAYMENTREQUEST_0_AMT0 : info.price,
L_PAYMENTREQUEST_0_QTY0 : 1,
PAYMENTREQUEST_0_PAYMENTACTION: "SALE",
PAYMENTREQUEST_0_AMT: subtotal+shippingCost,
PAYMENTREQUEST_0_ITEMAMT: subtotal,
PAYMENTREQUEST_0_CURRENCYCODE: "ILS",
PAYMENTREQUEST_0_SHIPPINGAMT:shippingCost,
LOCALECODE:"he_IL",
RETURNURL: "http://localhost:3000" + successUrl,
CANCELURL: "http://localhost:3000" + cancelUrl,
LOGOIMG:"localhost:3000/images/logo.svg"
}
var post_data_encoded = querystring.encode(post_data);
var httpRequest = https.request(options,function(response){
response.on('data', function (chunk) {
var resData = querystring.parse(chunk.toString());
callback(resData);
});
});

这是我得到的回复:

{"TOKEN":"EC-1UV4673091640241G",
"BILLINGAGREEMENTACCEPTEDSTATUS":"0",
"CHECKOUTSTATUS":"PaymentActionNotInitiated",
"TIMESTAMP":"2015-02-09T21:27:23Z",
"CORRELATIONID":"c1d72f302ac78",
"ACK":"Success",
"VERSION":"93",
"BUILD":"15177679",
"EMAIL":"******@gmail.com",
"PAYERID":"YW4B5FG9HBEXU",
"PAYERSTATUS":"unverified",
"FIRSTNAME":"Dany",
"LASTNAME":"Shovevani",
"COUNTRYCODE":"US",
"SHIPTONAME":"Dany Shovevani",
"SHIPTOSTREET":"baba",
"SHIPTOCITY":"New York",
"SHIPTOSTATE":"NY",
"SHIPTOZIP":"10001",
"SHIPTOCOUNTRYCODE":"US",
"SHIPTOCOUNTRYNAME":"United States",
"ADDRESSSTATUS":"Confirmed",
"CURRENCYCODE":"ILS",
"AMT":"225.00",
"ITEMAMT":"200.00",
"SHIPPINGAMT":"25.00",
"HANDLINGAMT":"0.00",
"TAXAMT":"0.00",
"INSURANCEAMT":"0.00",
"SHIPDISCAMT":"0.00",
"L_NAME0":"חלוק",
"L_QTY0":"1",
"L_TAXAMT0":"0.00",
"L_AMT0":"200.00",
"L_DESC0":"חלוק רגיל גדול.",
"L_ITEMWEIGHTVALUE0":" 0.00000",
"L_ITEMLENGTHVALUE0":" 0.00000",
"L_ITEMWIDTHVALUE0":" 0.00000",
"L_ITEMHEIGHTVALUE0":" 0.00000",
"PAYMENTREQUEST_0_CURRENCYCODE":"ILS",
"PAYMENTREQUEST_0_AMT":"482.50",
"PAYMENTREQUEST_0_ITEMAMT":"457.50",
"PAYMENTREQUEST_0_SHIPPINGAMT":"25.00",
"PAYMENTREQUEST_0_HANDLINGAMT":"0.00",
"PAYMENTREQUEST_0_TAXAMT":"0.00",
"PAYMENTREQUEST_0_INSURANCEAMT":"0.00",
"PAYMENTREQUEST_0_SHIPDISCAMT":"0.00",
"PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED":"false",
"PAYMENTREQUEST_0_SHIPTONAME":"Dany Shovevani",
"PAYMENTREQUEST_0_SHIPTOSTREET":"baba",
"PAYMENTREQUEST_0_SHIPTOCITY":"New York",
"PAYMENTREQUEST_0_SHIPTOSTATE":"NY",
"PAYMENTREQUEST_0_SHIPTOZIP":"10001",
"PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE":"US",
"PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME":"United States",
"PAYMENTREQUEST_0_ADDRESSSTATUS":"Confirmed",
"L_PAYMENTREQUEST_0_NAME0":"חלוק",
"L_PAYMENTREQUEST_0_QTY0":"1",
"L_PAYMENTREQUEST_0_TAXAMT0":"0.00",
"L_PAYMENTREQUEST_0_AMT0":"200.00",
"L_PAYMENTREQUEST_0_DESC0":"חלוק רגיל גדול.",
"L_PAYMENTREQUEST_0_ITEMWEIGHTVALUE0":" 0.00000",
"L_PAYMENTREQUEST_0_ITEMLENGTHVALUE0":" 0.00000",
"L_PAYMENTREQUEST_0_ITEMWIDTHVALUE0":" 0.00000",
"L_PAYMENTREQUEST_0_ITEMHEIGHTVALUE0":" 0.00000",
"PAYMENTREQUESTINFO_0_ERRORCODE":"0"}

我是否遗漏了什么或是否有额外的步骤来获取电话号码?

最佳答案

“需要电话号码”设置似乎未正确启用。我已为您的 Sandbox 帐户再次启用它。你可以再试一次。

或者,您可以使用PAYMENTREQUEST_n_SHIPTOPHONENUM,如果您想要运送到电话号码。(您需要包含REQCONFIRMSHIPPING=1以使用this

关于node.js - SetExpressCheckout 和 GetExpressCheckoutDetails 都缺少电话号码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28420663/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com