$_REQUEST or $_POST phone number value in paypal - paypal

How to get buyer phone number in paypal after transaction.
i.e., in return_url or notify_url($_REQUEST or $_POST).
Thanks

You can get the phone number if you make sure that you have settings turn on in your PayPal account . Go to the below url after you login to your PayPal account :
https://www.paypal.com/us/cgi-bin/webscr?cmd=_profile-website-payments
Once you enable that you will get the phone in IPN as well as on PDT like below which includes phone number too .
IPN Text
mc_gross=0.01 &protection_eligibility=Eligible &address_status=confirmed &payer_id=XXXXX&tax=0.00 &address_street=sdfad sfcqa &payment_date=07:32:22 May 05, 2015 PDT &
amp;payment_status=Completed &charset=UTF-8 &address_zip=28202 &first_name=asas &mc_
fee=0.01 &address_country_code=US &address_name=asas sdas &notify_version=3.8 &custo
m= &payer_status=unverified &business=XXXXX&address_country=United State
s &address_city=Charlotte &quantity=1 &verify_sign=ApBHX6qbpxJW-Ll3oP22LSbo0WeuALhKG1yb8
vEI4Ru8T3R32uGwMFbU &payer_email=XXXXXX&**contact_phone=232-321-2345** &txn_id=8
2P55278LK622610P &payment_type=instant &last_name=sdas &address_state=NC &receiver_e
mail=XXXXX&payment_fee=0.01 &receiver_id=XXXXXX&txn_type=web_acc
ept &item_name=Test Item &mc_currency=USD &item_number=123 &residence_country=US &am
p;test_ipn=1 &receipt_id=1673-8486-0790-7009 &handling_amount=0.00 &transaction_subject=
&payment_gross=0.01 &shipping=0.00 &ipn_track_id=6e43b2c5f2c83

Related

PayPal Express checkout SALUTATION not received in response

I am using PayPal Express checkout for payment. I need the SALUTATION of the user along with other shipping details. But it seems that only FIRSTNAME and LASTNAME are got from the response. What should be done to get the SALUTATION in the response as well.
This is the response got from GetExpressCheckoutDetails
TOKEN:EC%2d9F317807RE7947807
BILLINGAGREEMENTACCEPTEDSTATUS:0
CHECKOUTSTATUS:PaymentActionCompleted
TIMESTAMP:2016%2d05%2d12T11%3a54%3a16Z
CORRELATIONID:c50a6ba8b3002
ACK:Success
VERSION:93
BUILD:000000
EMAIL:nihal%40gmail%2ecom
PAYERID:2CLDDRMSKLDMA
PAYERSTATUS:unverified
FIRSTNAME:Nihal
LASTNAME:Mohammad
COUNTRYCODE:IN
SHIPTONAME:Nihal
SHIPTOSTREET:Chakkorathukulam
SHIPTOSTREET2:Nadakkavu
SHIPTOCITY:Calicut
SHIPTOSTATE:KOZHIKODE
SHIPTOZIP:670006
SHIPTOCOUNTRYCODE:IN
SHIPTOCOUNTRYNAME:India
ADDRESSSTATUS:Unconfirmed
CURRENCYCODE:USD
AMT:10%2e00
SHIPPINGAMT:0%2e00
HANDLINGAMT:0%2e00
TAXAMT:0%2e00
INSURANCEAMT:0%2e00
SHIPDISCAMT:0%2e00
PAYMENTREQUEST_0_CURRENCYCODE:USD
PAYMENTREQUEST_0_AMT:10%2e00
PAYMENTREQUEST_0_SHIPPINGAMT:0%2e00
PAYMENTREQUEST_0_HANDLINGAMT:0%2e00
PAYMENTREQUEST_0_TAXAMT:0%2e00
PAYMENTREQUEST_0_INSURANCEAMT:0%2e00
PAYMENTREQUEST_0_SHIPDISCAMT:0%2e00
PAYMENTREQUEST_0_TRANSACTIONID:2KR64654T7820071F
PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED:false
PAYMENTREQUEST_0_SHIPTONAME:Nihal
PAYMENTREQUEST_0_SHIPTOSTREET:Chakkorathukulam
PAYMENTREQUEST_0_SHIPTOSTREET2:Nadakkavu
PAYMENTREQUEST_0_SHIPTOCITY:Calicut
PAYMENTREQUEST_0_SHIPTOSTATE:KOZHIKODE
PAYMENTREQUEST_0_SHIPTOZIP:670006
PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE:IN
PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME:India
PAYMENTREQUEST_0_ADDRESSSTATUS:Unconfirmed
PAYMENTREQUESTINFO_0_TRANSACTIONID:2KR64654T7820071F
PAYMENTREQUESTINFO_0_ERRORCODE:0
In PayPal documentation they say it is available in response.
see here
Its a simple problem. I was using the merchant account for US region. And the US region does not need the SALUTATION part for their address. That was why the response was not returning the salutation part i guess.

Getting the Unique Transaction ID seen by the customer from Express Checkout

I'm using PayPal Express Checkout on a sandbox account, and i'm trying to link up the Unique Transaction ID on the "customer" paypal site with the completed transaction via Express Checkout.
My DoExpressCheckoutPayment returned:
TOKEN=EC%2d2KG36160AM8868619&
SUCCESSPAGEREDIRECTREQUESTED=false&
TIMESTAMP=2015%2d01%2d29T09%3a45%3a09Z&
CORRELATIONID=44060412ed341&
ACK=Success&
VERSION=93&BUILD=15009693&
INSURANCEOPTIONSELECTED=false&
SHIPPINGOPTIONISDEFAULT=false&
PAYMENTINFO_0_TRANSACTIONID=011446947E558235S&
PAYMENTINFO_0_TRANSACTIONTYPE=expresscheckout&
PAYMENTINFO_0_PAYMENTTYPE=instant&
PAYMENTINFO_0_ORDERTIME=2015%2d01%2d29T09%3a45%3a08Z&
PAYMENTINFO_0_AMT=7%2e98&
PAYMENTINFO_0_FEEAMT=0%2e47&
PAYMENTINFO_0_TAXAMT=0%2e00&
PAYMENTINFO_0_CURRENCYCODE=GBP&
PAYMENTINFO_0_PAYMENTSTATUS=Completed&
PAYMENTINFO_0_PENDINGREASON=None&
PAYMENTINFO_0_REASONCODE=None&
PAYMENTINFO_0_PROTECTIONELIGIBILITY=Ineligible&
PAYMENTINFO_0_PROTECTIONELIGIBILITYTYPE=None&
PAYMENTINFO_0_SECUREMERCHANTACCOUNTID=W9SM36U76AXSS&
PAYMENTINFO_0_ERRORCODE=0&
PAYMENTINFO_0_ACK=Success
Then my GetExpressCheckoutDetails returned:
TOKEN=EC%2d2KG36160AM8868619&
BILLINGAGREEMENTACCEPTEDSTATUS=0&
CHECKOUTSTATUS=PaymentActionCompleted&
TIMESTAMP=2015%2d01%2d29T09%3a45%3a33Z&
CORRELATIONID=80e00a0067bea&
ACK=Success&
VERSION=93&
BUILD=15009693&
EMAIL=test1%40sud%2eco2euk&
PAYERID=H54VEN293PLFL&
PAYERSTATUS=verified&
FIRSTNAME=Test&
LASTNAME=User&
COUNTRYCODE=GB&
CURRENCYCODE=GBP&
AMT=7%2e98&
SHIPPINGAMT=0%2e00&
HANDLINGAMT=0%2e00&
TAXAMT=0%2e00&
INSURANCEAMT=0%2e00&
SHIPDISCAMT=0%2e00&
PAYMENTREQUEST_0_CURRENCYCODE=GBP&
PAYMENTREQUEST_0_AMT=7%2e98&
PAYMENTREQUEST_0_SHIPPINGAMT=0%2e00&
PAYMENTREQUEST_0_HANDLINGAMT=0%2e00&
PAYMENTREQUEST_0_TAXAMT=0%2e00&
PAYMENTREQUEST_0_INSURANCEAMT=0%2e00&
PAYMENTREQUEST_0_SHIPDISCAMT=0%2e00&
PAYMENTREQUEST_0_TRANSACTIONID=011446947E558235S&
PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED=false&
PAYMENTREQUESTINFO_0_TRANSACTIONID=011446947E558235S&
PAYMENTREQUESTINFO_0_ERRORCODE=0
But the customer site says:
PayPal Express Checkout Payment Sent (Unique Transaction ID 7PK53077PJ222701T)
Oh..the (painful) memories :) That aforementioned "oddity" also exists elsewhere - e.g. eBay transactions
IINM, you'll need to send your own "custom ID" - the Invoice Id mentioned above (which is displayed to the end user) so both ends have some visual reference to a transaction.
In the REST API (unsure in Classic, haven't tried), if you send an Order, the Order Number (finally) is shared on both ends (same for both). Though it wouldn't hurt to still send your own "custom Id"/"Invoice Id".
Buyer/Customer Paypal UI:
Seller/Merchant Paypal UI:
Hth...

PayPal Payflow: How to verify in one request, and then authorize in another without saving CC info?

I'm building a book store and I am building the checkout using PayPal Payflow . This is the checkout flow:
Shipping info --> Billing info |verify CC using Paypal| --> Order summary --> Submit |authorize CC using Paypal|
Shipping info: fill out shipping address, nothing special here
Billing info: fill out your billing address + credit card info. Don't save the credit card info since it's against standards, instead just send the CC number, expiration date, and CVV directly to PayPal to verify. PayPal approves.
Order summary: The order sees the summary of his order before he submits the order. He presses submit and another request to PayPal is sent to authorize the funds.
However, the CC info vanishes after #2, so how would I persist that data to #3 so that I can send it to PayPal again?
Can I just use the ORIGID to point to the PNREF ? The documentation says I have to do a full request with the whole params list (including CC info, CVV, exp date, etc).
TRXTYPE=A&TENDER=C&PWD=x1y2z3&PARTNER=PayPal&VENDOR=SuperMerchant&USER=S
uperMerchant&ACCT=5555555555554444&EXPDATE=0308&AMT=123.00&COMMENT1=Seco
nd purchase&COMMENT2=Low risk customer&INVNUM=123456789&STREET=5199
MAPLE&ZIP=94588
Or am I just misunderstanding what authorization means? Isn't authorization actually reserving funds in the user's CC? So that shouldn't be done until the user presses submit order right?
I figured it out.
The documentation here: https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/pp_payflowpro_guide.pdf
on page 40 mentions it briefly, but doesn't go into much detail about this checkout flow even though it seems pretty common.
My assumption was right, in that I could just do an address verification request first with all the CC info, and use the PNREF returned. I save the PNREF id in my session and reuse it to submit a request that looks like this:
def authorize_transaction(pnref)
make_request(authorization_data(pnref))
end
def authorization_data(pnref)
{
"TRXTYPE" => "A",
"TENDER" => "C",
"USER" => PAYPAL_API["user"],
"PWD" => PAYPAL_API["pwd"],
"VENDOR" => PAYPAL_API["user"],
"PARTNER" => "Paypal",
"AMT" => purchase.total_price,
"ORIGID" => pnref,
"VERBOSITY" => "HIGH"
}
end
And receive the desired response:
{"RESULT"=>"0", "PNREF"=>"A10A6A9C08E1", "RESPMSG"=>"Approved", "AUTHCODE"=>"752PNI", "AVSADDR"=>"Y", "AVSZIP"=>"Y", "HOSTCODE"=>"A", "PROCAVS"=>"Y", "VISACARDLEVEL"=>"12", "TRANSTIME"=>"2014-01-31 11:53:56", "FIRSTNAME"=>"net", "LASTNAME"=>"theory", "AMT"=>"15.64", "ACCT"=>"1111", "EXPDATE"=>"0115", "CARDTYPE"=>"0", "IAVS"=>"N"}

paypal checkout display shipping costs but does not include them in transaction

I do not know if the issue is in code or the paypal account settings. Paypal displays correctly the shipping cost, it displays the correct total (item price + shipping),
but in fact, the transactions includes only the item price, not the shipping costs.
I have been unable to find out what is wrong. if paypal can display it correctly, why cant it include it properly in the transaction ?
here is the request sent to paypal:
$padata = '&CURRENCYCODE='.urlencode($PayPalCurrencyCode).
'&PAYMENTACTION=Sale'.
'&ALLOWNOTE=1'.
'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($PayPalCurrencyCode).
'&PAYMENTREQUEST_0_AMT='.urlencode($TotalPrice).
'&PAYMENTREQUEST_0_ITEMAMT='.urlencode($ItemTotalPrice).
'&L_PAYMENTREQUEST_0_QTY0='. urlencode($ItemQty).
'&L_PAYMENTREQUEST_0_AMT0='.urlencode($ItemPrice).
'&PAYMENTREQUEST_0_SHIPPINGAMT='.urlencode($deliveryCost).
'&L_PAYMENTREQUEST_0_NAME0='.urlencode($ItemName).
'&L_PAYMENTREQUEST_0_NUMBER0='.urlencode($ItemNumber).
'&AMT='.urlencode($ItemTotalPrice).
'&RETURNURL='.urlencode($PayPalReturnURL ).
'&CANCELURL='.urlencode($PayPalCancelURL);
The param for shipping that I used is :
PAYMENTREQUEST_0_SHIPPINGAMT
is it correct ? is a complementary one needed ?
Are you supplying all of your PAYMENTREQUEST_0_* and L_PAYMENTREQUEST_0_* variables in your DoExpressCheckoutPayment call as well as your SetExpressCheckout call?
SetExpressCheckout will control what the buyer sees when they go to check out on PayPal. DoExpressCheckoutPayment will control what the buyer is actually charged for. Therefore, if you want your shipping charge to be included in the transaction, you need to make sure that it's included in both calls.
for the records, correct params for DoExpressCheckoutPayment :
$padata = '&TOKEN='.urlencode($token).
'&PAYERID='.urlencode($playerid).
'&PAYMENTACTION='.urlencode("SALE").
'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($PayPalCurrencyCode).
'&PAYMENTREQUEST_0_SHIPPINGAMT='.urlencode($deliveryCost).
'&PAYMENTREQUEST_0_AMT='.urlencode($TotalPrice).
'&PAYMENTREQUEST_0_ITEMAMT='.urlencode($ItemTotalPrice).
'&CURRENCYCODE='.urlencode($PayPalCurrencyCode);

PayPal ExpressCheckout ignores discount

I disovered a wired issue using Paypal ExpressCheckout with discounts:
I pass 2 Items like:
L_NAME0 : "test2",
L_AMT0: 2, // 2 EUR
L_QTY0: 1
and
L_NAME1 : "Discount",
L_AMT1: -0.60, // 60 cent
L_QTY1: 1
After redirect to Paypal everything seems fine:
But after closing this transaction, paypal charges the full amount (2 EUR) from my paypal-account:
What is wrong with this paypal discount? It seems to be cheating on the customer and he must feel betrayed.
I dont believe its paypals fault, so any ideas on what i did wrong are appreciated :)
It looks like you applied the discount line item to your SetExpressCheckout call, but the DoExpressCheckoutPayment call must not have had the same thing..??
You need to make sure DECP has all of the same line item details in it.