3

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.

Mian.Ammar
  • 663
  • 1
  • 9
  • 22
  • Just like the other answers, it doesn't seem possible. We're not going with square because of this, it's an insane limitation. – Kevin Parker Mar 11 '20 at 16:32

5 Answers5

17

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

  1. 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.

frank f
  • 186
  • 1
  • 4
  • 1
    This should really be marked as answer. Saved me additional wasted time. – Kevin Feb 06 '19 at 19:48
  • 1
    The way to get the nonce is to use the square payment form. To reuse card details, you can save the nonce as a customer card and then re-charge by using a customer nonce instead (which refers back to the card details saved under the customer). – Brian C Jul 31 '20 at 02:48
  • Its 2022, still no API has been created for this. Stripe and Authorize.net are the best if we need to full-fill our requirement. – Shubham Mar 24 '22 at 12:57
5

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

sjosey
  • 1,360
  • 1
  • 6
  • 7
  • Thanks for above links, But i need to process Cards on my server side, I would like to generate Card Nonce on my server side (At Backend). – Mian.Ammar Apr 10 '18 at 06:40
  • 1
    That's currently not possible using Square. The only way to generate the card nonce is using the SqPaymentForm so that Square handles all the confidential related information, and developers do not need to worry about it. – sjosey Apr 10 '18 at 16:43
  • 1
    I'm pretty sure what you want is possible via saving the card info under a Customer. You can then re-charge the card, eg for a monthly subscription. – Brian C Jul 31 '20 at 02:49
4

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.

Mian.Ammar
  • 663
  • 1
  • 9
  • 22
0

It should be possible to emulate with the virtual terminal over phantom.js

Sam Washington
  • 626
  • 4
  • 12
0

You don’t get a nonce, you create a nonce. It can be any character string but must be unique from all other nonce strings used. I use my customer ID concatenated with the date because in my case I know a customer only gets an invoice once a month.

Mark Clayton
  • 21
  • 2
  • 2