change product quantity in payment request API - payment-request-api

can we change the product quantity if we use the payment request API?
as for now, i see example of changing the payment method, changing user contact information, changing shipping address and also selecting various type of shipping address but i don't found an example that shows buyer can change quantity of the item
for example the buyer click buy now, and then that Payment Request API interface would popup. In the popup, i want the buyer to be able to add quantity of the item he or she want to buy.

That is not possible within the Payment Request API spec.
If you want to make it happen, consider proposing the feature in the spec discussion at https://github.com/w3c/payment-request/issues .

Related

PayPal "Buy Now" Link?

I see in PayPal how to make a Buy Now button. However, the code behind that is a form that POST to PayPal. Is there a way to create a link to a PayPal payment page with all of the relevant information (e.g. item name, price, custom customer fields to request, discount coupon field, etc.)? I want to be able to include this link in emails/SMS. I only have one item to sell and it's for a certain price, unless a valid discount coupon is applied, then it's for a set lower price.
I will want to put a Buy Now button on my site to do the same thing, but I do need a link I can email/SMS as well. Is there a way to do this?
Yes, PayPal website payments standard URLs work via either GET or POST, so you can take the same variables and put them in the URL string. So for example:
https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=foo#yourcompanyhere.com
However, I'm not sure if this is an "offical" feature; while it has worked for at least the last dozen years so I would be comfortable using it in an email, I would recommend keeping your primary website integration using form posts.

Paypal: technique to obtain buyer's country for establishing postage prices without introducing extra steps

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.

PayPal "Pay with Credit Card" and Item description

I have a few questions regarding using PayPal.
The first image is from an existing website, while the second is from a sandboxed Express Checkout test.
Differences between the two:
On the left side, there is an item description and quantity.
On the bottom right, notice it is Pay with my Credit Card instead of Create a PayPal account.
How do I achieve 1. and 2.? What APIs do I use?
Take note that my site has potentially many items for sale, and it is impossible for me to manually create buttons for each one.
Edited: Ok I just found the answer to 1.: https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/integration-guide/ECCustomizing/
For 2., the existing website actually prompts for details such as name, and address before redirecting to the PayPal site. When I click on "Pay with Credit Card", the details input earlier do show up on the PayPal form. I also notice the existing site can accept direct credit card payments, which seem to me it is using at least a Payment Pro solution. Is that why it can achieve 2.?
How do I achieve that? Do I use the AdaptiveAccount API to create an account on behalf of the user?
In order get the credit card section to display by default instead of the option to pay with a PayPal account, you need to pass over to additional variables in your SetExpressCheckout API call.
SOLUTIONTYPE=Sole
LANDINGPAGE-Billing

Describing shipping service on a paypal shopping cart?

I'm passing along variables to a paypal shopping cart(using the api and paypal payment standard). I can pass the shipping cost, but how, or is it possible to describe the shipping method on paypal form? I can't for the life of me find where or how this is done.
Example,
my widget.... $1
shipping and Handling....$12
What I'd like:
my widget.... $1
shipping and Handling....$12
(UPS Ground)
Thanks for any input
Not entirely sure that passing the shipping provider to PayPal is possible. You might be able to pass it as a separate variable or some type of custom variable. If you only have one shipping provider you might be able to do the following
Log into your PayPal account
Go to Profile > My Selling Tools
Underneath Shipping my items click the Update button aligned with 'Shipping Preferences'
Select your default shipping carrier and press Save
You can pass over the shipping description/provider. However the feature only works with Express Checkout and with Website Payments Standard (cart upload method). You would use this when using the Instant Update API. You can find more about this in developers guide, and there is a section here showing what variables you would need to pass over with your cart upload code.

relating website payments standard and IPN?

Im using Website Payments Standard so users can pay for a rating to be shown on their profile. Im also using IPN to check if the payment went through. How do I relate the two? When I get an IPN request to my listener, how do I know which user and rating it relates to?
If users are initiating payment through a buy it now or shopping cart button embedded in your site, you can set some sort of text box where the user enters their user name. this info will be sent with the Ipn. This is set up on the pay pal sure where you create the buttons.
Another method would be get their actual name from the ipn. Check the documentation for a list of variables that are sent with the ipn, there are a lot of possibilities.