I would like to activate the seller protection option, this requires me to send over the shipping address the buyer has filled in on my website.
I have 2 scenarios: with 1 receiver and with no receivers.
I know that I need to use the SetPaymentOptions API call but I couldn't a way to pass the PAY or PAY_PRIMARY option I have in the PAY API.
Is it possible to pass shipping address with chained payments?
Please let me know what am I missing.
Thanks
Setup chained payment with shipping address, this can be implemented if you integrate chained payment by using embeded flow. This is the steps for you to follow to display and collect the selected shipping address
Call the Pay API operation with actionType set to CREATE to obtain a payment key.
Set senderOptions.requireShippingAddressSelection to true in your request to SetPaymentOptions and call the API operation.
Redirect the payment sender's browser to the embedded payment flow at https://www.paypal.com/webapps/adaptivepayment/flow/pay?paykey=... after obtaining the pay key.
After returning from the flow, call the GetShippingAddresses API operation to obtain the selected shipping address.
Note: This step assume that you have implemented the JavaScript for invoking the embedded payment flow, that you have set up your button or form to invoke the flow, and that you have included the code to close the window associated with the flow.
For more information, here is the reference link for you:
Adaptive payment : https://developer.paypal.com/docs/classic/adaptive-payments/integration-guide/APIntro/
Pay API : https://developer.paypal.com/docs/classic/api/adaptive-payments/Pay_API_Operation/
SetPaymentOptions API : https://developer.paypal.com/docs/classic/api/adaptive-payments/SetPaymentOptions_API_Operation/
Hope these could be helpful.
Related
This is probably a stupid question, I think I'm having a mental block.
I want to use Paypal's express checkout for buyers to make purchases with as few steps as possible (also using Paypal's optional account feature). The problem is: for me to direct the user to paypal, I will need to have calculated shipping costs, which depends on the country they're in. Obviously I cannot know this unless I have been told one way or another. What are common solutions to this problem?
Ideas:
Use their IP address. Not reliable - various types of proxies, VPNs, anonymizers etc.
Have the user select their country from a drop-down box before I redirect them to paypal
Force them to log in using Paypal's Identity service before calculating postage
Use 1. or 2. and once payment is received, if country is different to expected,
Refund buyer the difference in postage cost or request an additional payment. (Hardly ideal)
Similar to 4., instead of "Sale Payment Action for Express Checkout" Use 1. or 2. in conjunction with one of Paypal's delayed express checkout payment methods and if necessary reduce or increase the amount charged:
Authorization Payment Action for Express Checkout
Order Payment Action for Express Checkout
I'd like to know what solutions other developers have chosen - maybe I've missed an idea. As a consumer, I cannot remember seeing solutions to this.
The general way people do this is simply to use GetExpressCheckoutDetails to obtain the buyer's shipping address, apply any shipping/tax as necessary, and display a final review page on your site that the user would confirm before calling DoExpressCheckoutPayment.
If you want to eliminate the additional review page (PayPal's and then your own) you can use the Instant Update API.
In this case you would include an additional parameter on the URL when you redirect to PayPal (useraction=commit) and this will change the button on the PayPal review page to say Pay instead of Continue.
Also in your SEC request you'll include the CALLBACK parameter and include a URL to your callback listener. PayPal's review page will POST the buyer's shipping address to this callback URL so that you can receive the data, calculate shipping and tax accordingly, and send a response of those options back to the PayPal review page. This will populate the PayPal review page's drop down menu for the shipping option and the user can choose accordingly.
This method allows you to utilize the PayPal review page entirely and finalize the payment there so that the only thing the user sees once they're returned to your site (after you call DECP) is a final thank you / receipt page.
I have been able to get a PayPal adaptive payments payment to work with a simple payment call.
But I want to get shipping details.
I have tried setting action type to create, then using the payKey returned sending a SetPaymentOptions call setting RequireShippingAddressSelection = True, then using the returned url from the payment call as before but still no shipping info.
I have seen others with this problem but without an answer.
Thanks
I have the same problem and here's what I got from PayPal Tech Support.
It is not possible for you to supply a shipping address as part of an
Adaptive Payments transaction. However, you can request that the
customer selects a shipping address from the addresses existing on
their PayPal account when they checkout using the embedded flow.
Details of the embedded flow are available here:
https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/integration-guide/APIntro/
(Search for Embedded Payments)
If you think this is an option you would also be required to implement
another API call, SetPaymentOptions, which would be sent after the Pay
API request. Within the SetPaymentOptions API request you would add
the parameter requireShippingAddressSelection. Details of the
SetPaymentOptions API are located here:
https://developer.paypal.com/webapps/developer/docs/classic/api/adaptive-payments/SetPaymentOptions_API_Operation/
If your application requires that you supply a custom shipping address
to PayPal at the time of payment then you will need to consider using
Express Checkout instead of Adaptive Payments.
Are you sure the shipping info isn't passing? I don't think it's anything you'll see during the checkout process, but it will show up in the transaction details of the payment in your PayPal account.
I spent hours researching this and it appears to be an API bug from 2011 (great job PayPal!).
Unfortunately, you have to request the shipping info from the user before redirecting them to PayPal.
Source link
I am using a PayPal simple chained payment flow rather than embedded for my website's transactiosn. Is it possible to allow buyers to choose their PayPal verified shipping address in the transaction?
To my knowledge there's no way (currently) to allow users to choose a shipping address from their account within an Adaptive Payments flow, however, you can use SetPaymentOptions to bind a shipping address to the payment if you have the user fill it into your app at some point.
You would call Pay with the action set to CREATE and then call SetPaymentOptions behind that to configure any additional options you'd like. There are quite a few things you can add with that additional call.
No, shipping addresses are only supported in the embedded payments flow.
I am using PayPal Adaptive payments (chained payments).
If I set:
1. CREATE payment
2. In the SetPaymentOptions -> Requires shipping address selection = true
3. When I redirect user for the https://www.sandbox.paypal.com/webscr&cmd=_ap-payment&paykey=[PA KEY] user after authentication is not shown any prompt for shipping address
why?
Accordingly to the
https://www.x.com/developers/paypal/documentation-tools/api/pay-api-operation
when using CREATE I should do: CREATE – Use this option to set up the payment instructions with SetPaymentOptions and then execute the payment at a later time with the ExecutePayment.
But as soon as I try to run ExecutePayment I get the following information:
This payment request must be authorized by the sender
How can I set additional payment options then?
The ExecutePayment call would only be used if you're utilizing delayed chained payments. Otherwise, the payment still happens as soon as the buyer logs in and approves it, so there is no need for ExecutePayment. Calling it at that point results in the error you're getting, that the paykey was already used.
Did the sender actually authorize the payment?
The flow should be like:
Call Pay API operation with actionType as CREATE
If paymentExecStatus=CREATED and ack=SUCCESS, obtain payKey (here, keep detailLevel=ReturnAll in RequestEnvelope field of your Pay API request)
Redirect user to Paypal https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=YOUR_PAYKEY_ABOVE
If user approves payment, you will be redirected to your returnURL sent as a part of Pay API request
Verify approval status using PaymentDetails API operation
Later you can execute the payment thus setup in step 4 using ExecutePayment API operation. Send the same payKey you obtained in step 2.
You have got error code 550001 since the user approval seems to be not yet done successfully. It may be due to:
The application did not redirect user/sender to Paypal for authorization
OR
The user did not enter correct login details
OR
There were not sufficient funds available
etc.
I'm integrating PayPal into my web application. Here I want to make complete checkout process.It has direct payment and express checkout.
In Express checkout we need only PayPal account like
1)Clicking Check out with PayPal
2) Logs into PayPal to authenticate
3)Reviews the transaction on PayPal
4)Confirms the order and pays from your site
5)Receives an order confirmation
In Direct checkout(A generic checkout flow),
1)Checks out from the shopping cart page
2)Provides shipping information
3)Chooses a payment option and provides
4)billing and payment information
5)Reviews the order and pays
6)Receives an order confirmation
This the flow. In Direct checkout when you choose payment option as PayPal(step 3) you need to login and make payment. Any way there is one default shipping address available in PayPal account and also you must give shipping address in step 2.
Now I want to send the complete cart details and shipping address to PayPal?
and I want make the direct checkout(A generic checkout flow) here? Can any one help me to do this?
Use Express Checkout and DoDirectPayment (Website Payments Pro). Express Checkout gives you the redirect-to-PayPal-and-login functionality, whereas DoDirectPayment allows you to take card payments directly on your site.
In addition, you can override the PayPal Profile shipping address of the buyer by specifying ADDROVERRIDE=1 in the SetExpressCheckout API call. Remember you'll need to pass in the appropriate shipping address details information as well.
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout