What is the difference between Google Pay API vs Payment Request API? - web

I saw that Google released a new Google Pay API for the web. However, there is also a Payment Request API fo the web. Is Google Pay just a rebrand of Payment Request API? In what cases would you use one API over the other?

The "Payment Request API" is a W3C standard and a part of "Web Payments" effort. This means the API is expected to be implemented by multiple browsers and it's already landed in Chrome, Edge and Samsung Browser. And it's also expected to be available on Firefox, Safari and so on. Payment Request API is never a Google's property and it's an open standard.
https://www.w3.org/Payments/WG/
The Payment Request API is said to allow users to pick their saved credit card information with just one tap. But it's just a part of larger ecosystem. It can integrate with any third party payment apps and allow users to make payment through those apps via the Payment Request API.
Consider Google Pay one of such payment apps. Other good examples are upcoming Apple Pay (when Safari implements the Payment Request API) or Samsung Pay. Alipay also implemented one and have done a talk about it at Google I/O 2017.
https://www.youtube.com/watch?v=hU89pPBmhds
What makes it look complicated about Google Pay for those who knew about the Payment Request API is that it conceals the Payment Request API behind its library. By initiating Payment Request with just a single payment method without requesting shipping information, you can bypass Payment Request user interface and directly launch the payment app (in this case Google Pay).
https://developers.google.com/payments/web/tutorial
This article should be a good start:
https://medium.com/dev-channel/addressing-common-misconceptions-about-the-payment-request-api-4d0db51dae75
Hope this helps.

Related

Saving User's card in Square Payments

I'm new to Square and want to implement it in a React Native app with a Node backend.
I see that there is a method to save the customer's card details.
https://github.com/square/square-nodejs-sdk/blob/master/src/api/customersApi.ts#L230
But there is also the payment form?
https://developer.squareup.com/docs/payment-form/how-it-works
Firstly, I cannot see if the payment form is even available in React Native - information seems very scarce.
Secondly, even if I do implement that form, I can't see a way to connect it to the customers API endpoint.
I don't want to use in-app payments (i.e. google or apple pay). I want to be able to save card details like Amazon does, and use them whenever a user places an order in app (probably triggered by a node process). I'm not sure if I'm going about this the correct way, guidance would be appreciated.
In-App Payments SDK will be the way to go (and there is a React Native plugin already). The In-App Payments SDK is basically a mobile Square Payment Form, that you linked to. It will generate a secure nonce, and you can use the nonce to save the card on file. The next time the customer comes, instead of bringing up In-App Payments, you can simply call CreatePayment in your backend, with the customer_id and the customer_card_id as the source.
As for "connecting it to the Customers API" - you don't connect it directly per se. You would collect information from the customer, on your own, and pass it directly to the Customers API to create a customer. You can then call CreateCustomerCard using the nonce (generated by In-App Payments), and the customer_id that you just created, to save the card to this customer profile.

Difference between paypal subscriptions and billing agreement?

I see paypal is upgrading their APIs. I want to collect recurring payments and provide a feature to upgrade / downgrade the plans.
In the samples, paypal is using billing agreements and when I see the docs, it says the API is deprecated please use subscriptions API. I am confused which one to use.
Please help me in this.
PS: Also my product includes one time payments
The PayPal Subscriptions API uses billing agreements and plans, and there are multiple versions. Everything linked from https://developer.paypal.com/docs/subscriptions/integrate/ will be the most recent version.
For one-time (non-subscription) payments, the most robust integration is to have two routes on your server that implement v2/checkout/orders API calls to "create order" and "capture order", combined with this front end: https://developer.paypal.com/demo/checkout/#/pattern/server
For a subscription integration to be similarly robust (in that your server gets an immediate API response of profile activation), you can have those buttons call your server as well: PayPal Smart Subscribe server side

Marketplace that allows payment on behalf of third party

I am currently developing a marketplace type of website. When it comes to handling payments, I would like to be able to charge customers on behalf of sellers.
Which payment gateway API should I use (if this is even possible)? I am using React and Node.
For reference, what I was looking for was something like Stripe Connect. According to their website: "Marketplaces and platforms use Stripe Connect to accept money and pay out to third parties. Connect provides a complete set of building blocks to support virtually any business model, including on-demand businesses, e‑commerce, crowdfunding, and travel and events."

Stripe vs mastercard?

why do developers use Stripe not Master-card API or Visa API while stripe charges money more. i checked and found out Master-card and Visa have their own API's , i guess there's something there i don't understand? probably i live in egypt, which global service should i use to integrate in my PHP websites while Stripe is not available in egypt?
sjsonp1389885476573({
"error": {
"message": "Your card was declined.",
"type": "card_error",
"code": "card_declined"
}
}
, 402)
Thank you
One of the primary reason why developers use payment gateways such as stripe and not separate APIs for master, visa, maestro etc. as you need to do development and testing individually for these APIs along with monitoring any changes that happen with them.
Stripe on the other hand provides an API layer over all these APIs and simplify them so that businesses don't have to worry about integrating the separate APIs.
The list of payment gateways available in Egypt currently includes :
2Checkout
BitPay
Coinbase
GoCoin
Mastercard Payment Gateway Services
NETbilling
PayFort
PayPal Express Checkout
Paystack
Also, the integration time is very less with these payment gateways as compared to the APIs of payment solutions such as master, visa, maestro, etc. as these gateways provides single API which supports payment options for all major payment solutions.
Hope this helps!

Google wallet API Integration questions

I am new to integrate Google Wallet and there are some confusion and questions related to that given below:
Is it possible to add multiple items for Google wallet?
How to handle discount by API?
What's the parameter in JWT response on postback URL for success and failure transaction?
Is refund functionality available for a transaction by API call?
Anyone have idea about this. Thanks in advance.
Can you clarify which specific API (Instant Buy or Wallet for Digital)?
Is it possible to add multiple items...
Digital - no, you can however "bundle", see this post for clarification.
Instant Buy - it's just a "layer" on top of your (pre) existing purchase/ordering processes and handles (just) the payment data of a Google Wallet user. The "order details" is something you control. See sample of data you send.
Discounts by API
By API - no. You can pass whatever (pre-calculated) value in both APIs.
Success vs. Failure Postback
Digital - Google will only send HTTP Post to your server URL on successful transaction. See #5: "Google sends an HTTP POST message to the postback URL whenever a purchase completes..."
Instant Buy - not relevant. You are processing the transaction, unlike in Digital where Google is. Instant Buy in a nutshell provides your web site, secure access to a Google Wallet user's data. You need to have your own merchant account/processor, be PCI compliant, etc. That said, you will have the success or failure info that you actually have to send to Google - they need to know if you have successfully processed or not (yup, it's the other way around).
Refund by API
By API - Unless a Googler says otherwise, AFAIK, not at this time, for both APIs.
On that note, for Instant Buy, it's actually unclear to me how to "inform Google" when performing a credit or refund. Its still a "private API" (not GA) so I actually haven't seen its "guts". It's understood that since the merchant uses their own processor that a credit/refund is the same procedure, but letting Google "know" about it (days/weeks after the fact) is something I personally have no actual info on..sorry...I can assume some "button" in merchant center for Instant Buy, but that's just a guess....
Hth....
W.r.t InstantBuy Refunds:
The Refund happens on the virtual one time card that is returned by the Google API. The refund on the card can be done by using any backend payment processor. Once the refund is made to the card, it hits the user's backing card.

Resources