Using the REST API, how can I charge tax or shipping if I send the user to PayPal to collect shipping information (and pay, of course)?
Doing some research it almost seems like that isn't possible, but I can't imagine that being the case. If I have to collect shipping information myself, the value prop for using PP is greatly reduced.
With the REST API, just like the Classic API, a PayPal payment is executed in three steps:
1) Send initial information to PayPal to get a token. Redirect customer to PayPal. Customer authorizes payment.
2) Get payment details (like the shipping address)
3) Confirm payment.
So, in this case, after getting the shipping address, you display an order review page to the customer where it will generate the shipping options and tax amount to the customer. They then have to select a "Confirm Order" button which will then finalize the charge to PayPal with the new tax/shipping and final amount.
In API terms, the final step is done with the /execute command. This accepts the payer_id you received in step 2, and a transactions array that supports a new amount object.
The amount object includes a details object that includes shipping, tax, handling fee, insurance, etc.
Include the details the customer decides on your review page and PayPal will charge the updated amount to the customer's funding source of choice.
Related
I am using the PayPal Rest API to implement PayPal into my website. The flow for my site is below.
Users selects PayPal to pay
Create payment in code
Send to PayPal to approve
Sent back to Step 2 of my order process
User can update the shipping method or apply a coupon code
User Submits the order
As you can see the amount and details of my order can be changed after I create the initial payment in Step 2 of my process. Also a user could update items/amounts on their order as well.
How do I update the transactions of a payment after it gets approved?
you should use Payment authorization:
PayPal Authorization & Capture is a settlement solution that provides increased flexibility in obtaining payments from buyers. During a traditional sale at PayPal, the authorization and capture action is completed simultaneously. PayPal Authorization & Capture separates the authorization of payment from the capture of the authorized payment.
Authorization & Capture is for merchants who have a delayed order fulfillment process and who typically make a $1 USD authorization at checkout. It enables merchants to modify the original authorization amount due to order changes (such as taxes, shipping, or item availability) that occur after the buyers place the initial order. This chapter discusses the authorization and capture process and provides steps to help you authorize, capture, reauthorize, and void funds.
Paypal doc
you need to impelemnt instant update callback:
Here is how the Instant Update API works
When a buyer logs in to PayPal, the PayPal server calls your callback server with the buyer's default shipping address, which is stored in the PayPal system.
Your callback server responds with the shipping options available for that address, along with any insurance options and tax adjustments on the order.
PayPal displays this information in the cart review area so buyers can choose from the options.
The buyer's final choices are returned in the GetExpressCheckoutDetails response.
https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECInstantUpdateAPI/
hope this helps you
I have question that if a customer changes the shipping address when he makes the payment in Paypal (Paypal IPN ,Paypal express) from the entered address(in our merchant website) , how can we do add the extra values or decrease the amount based on the new shipping address .
Thanks
Az
You could:
Implement the Instant Update API, or;
Obtain shipping data by calling GetExpressCheckoutDetails as described in this flow (#5).
Hth...
I am using the Express Checkout API to accept payments for my online store. The payment flow is as follows:
1) User adds Item to Cart
2) User proceeds to PayPal
3) User enters or selects existing shipping address, confirms, and is redirected to order confirmation step
4) Order Details such as Shipping Address are retrieved from PayPal using GetExpressCheckoutDetails.
5) On the order confirmation step (prior to DoExpressCheckoutPayment), user has the option to change the shipping address returned by PayPal. If user changes the shipping address, I need to recalculate the shipping cost to this new address, and submit the new shipping cost, as well as the new address back to PayPal
6) I am attempting to do this as part of the DoExpressCheckoutPayment payment call, using PAYMENTREQUEST_0_SHIPTONAME etc, but the shipping address within the transaction details does not change. (Likely because these are deprecated) Instead, the address chosen or entered on PayPal remains.
How can I submit a new shipping address to PayPal without having the user re-enter the transaction funnel from the beginning?
The shipping parameters in DECP are not deprecated. The documentation is a little bit misleading. It's the old version of those parameters, prior to when they added the ability to do parallel payments to EC, that are deprecated.
So, for example, SHIPTONAME is deprecated. Instead, you should now use PAYMENTREQUEST_n_SHIPTONAME like you have.
That said, whatever you send in the DECP request should be carried over to PayPal and end up being what is used for the payment's shipping address. In fact, if you don't include an address in DECP it shouldn't end up as part of the payment details in my experience.
If you want to provide a sample of the API requests during a checkout I'll be happy to take a look and see if I can figure out where you're going wrong.
Capture Card as I understand it allows a seller to securely accept an online order with credit card name, number and code via a shopping cart. We can subsequently ship the order, add the freight to the invoice and submit the total amount to the credit card for payment. After the payment has been posted the credit card information is wiped from the order.
I was led to believe that I could do this with a PayPal Payments Pro account, so I created one and sent a test invoice through with my own credit card. The amount of the invoice with tax was immediately posted to my PayPal account without the opportunity to add freight.
Can anyone on this forum provide a solution or workaround?
Thanks!!
Are you processing this initially as a sale or an authorization. If you are wanting to use the DoDirectPayment API with Website Payments Pro, you could process a 1.00 authorization to validate the card. Then perform all of the calculations that you are needing to, and then process the payment using the DoReferenceTransaction API call where you send across the full amount you want to charge to the buyers card. You only have to reference the transaction id for the last successful 1.00 auth you did, and PayPal will use the same credit card information. Otherwise you could also process the DoDirectPayment API call with the full amount at the time of checkout, and just use the DoReferenceTransactions API call to charge any additional charges to where not initially charged such as tax and shipping.
Another option would be to use Express Checkout, and process the transaction as an order. This will allow you to make more then one authorization/capture against the order. You can also set a max amount in the Express Checkout API calls.
If I have a Visa card number saved in my database, is there a way I can charge that Visa automatically through the PayPal API without the user having to enter anything? We want to keep this site as easy and hassle-free to use as possible. It would be a variable amount, based on how they use the site.
(Don't worry, proper disclaimers will be in place, and the user will be notified)
What about these "recurring payments"? That way I don't have to store the CC info on my website, but do they allow variable amounts that I could periodically send to PayPal?
Yes, you can.
Look at Direct Payments:
1 On your website, the customer
chooses to pay with a credit card and
enters the credit card number and
other details.
2 The customer reviews the order.
3 When your customer clicks “Pay” to
place the order, you call a PayPal API
to request payment, and the payment
transaction is initiated. Note: The
customer does not see this step.
PayPal does not send your customer a
recipt for the payment.
4 You transfer your customer to your
order confirmation page.
The payment is performed without redirecting the customer to PP site, so it's up to you to request CC data from the customer and submit them to PP API.