问题
In my application i need to process Cards from backend, I am already doing this with other payment gateways but for Square Connect I can't find anything.
My Question is how to generate Square Card Nonce from the backend? What API I should call ?
Gone through their entire documentation.
回答1:
We have the same problem. Square seems to be tailored for simple ecom sites. Sites that are not PCI compliant.
We are PCi Level 1. And we have a custom payment form.
Square requires that you have to use their Payment Form to get their nonce (token equivalent ). This obviously means you can’t reuse your existing payment fields.
Moreover their api documentation is poor.
1 they say you can use Checkout api and use their form. In this case you do not need to be pci compliant.
No complaints here
- They also say that if you want to control your UIUX, you can use their Transactions API.
BUT IN THIS CASE THEY FAIL TO MENTION HOW TO GET THE NONCE.
Hunt around and you’ll see that the only way to get a nonce is with payment form.
Obviously, this implies you have to use their payment form fields as an iframe
This is not custom ui/ux.
Payment developer want ApI based card number tokenization. Obviously this requires pCI compliance. Square does not support this.
I suggest you use another payment processing layer for advanced sites.
回答2:
In order to generate a card nonce through Square, you must use the SqPaymentForm. https://docs.connect.squareup.com/payments/sqpaymentform/sqpaymentform-overview
You would then pass the card nonce to the Charge endpoint in the Transactions API: https://docs.connect.squareup.com/payments/transactions/overview
However, you can also take payments using the Checkout API (less customizable, but easier to set up): https://docs.connect.squareup.com/payments/checkout/overview
回答3:
Response from Square's SLACK:
Square is specifically designed so you don’t need to handle client’s credit card details yourself (e.g. don’t need to securely pass it back from the client to your server) and so SqPaymentForm is designed to work client side only, and to then return a card nonce which you can safely pass from client to server. Unfortunately what you want to do is not possible by design.
回答4:
It should be possible to emulate with the virtual terminal over phantom.js
来源:https://stackoverflow.com/questions/49725775/how-to-get-nonce-for-card-using-square-api-from-backend