Reputation: 119
I'm building an eCommerce website (using node.js) and I use the classic PayPal api. I need the costumers to enter their phone number so I can contact them in case of a problem with their order.
So for that I changed the setting on my papal Account under the Website Setting to require a phone number on checkout.
After calling SetExpressCheckout
and the customer enters his information, including the phone number, I get the response with success status as well as the other order information.
However, the phone number is missing from the response. According to the docs, it's suppose to be in the PHONENUM
field. I tried to call GetExpressCheckoutDetails
also in order to get the phone, yet it is still missing.
here the request call:
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);
});
});
and this is the response i get:
{"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"}
Am I missing something or are there additional steps in order to get the phone number ?
Upvotes: 0
Views: 348
Reputation: 6463
It looks like the "Require Phone number" setting was not enabled correctly. I have enabled it again for your Sandbox account. You can try again.
Alternatively, you can use PAYMENTREQUEST_n_SHIPTOPHONENUM
if you want to get the ship to phonenumber.(You need to include REQCONFIRMSHIPPING=1
to use this.
Upvotes: 1