Open oshihirii opened 2 years ago
Hey there @oshihirii!
If you figured it out already, feel free to close this issue. In case you are still struggling, I'll try my best to help!
So from my understanding, you are trying to get the subscriptions sign-up functionality to work for your users. The web-payment SDK is just a simple way to take a payment on the client-side. You would still need a backend in order to make actual API calls to the square service. Reading through the tutorial you have linked, it seems like two different use-cases are being shown:
createCard
API call to create a card on file. Once this card on file is created for the customer, you can sign them up for the subscription by using the card ID returned in the response. This will charge their card that was created using the web-payment SDK. In short, with this option you are using the web-payments SDK to get the payment token, but using your backend to make the additional API calls (with our server side SDK).I hope this helps, if not please feel free to reach out again!. In general though, I'd recommend reaching out in the forums or our support slack channel: https://developer.squareup.com/forums/ https://squ.re/2Hks3YE
I am trying to allow users to sign up for a subscription on a website.
I can see there is a
server-side
SDK forNode.js
here:https://github.com/square/square-nodejs-sdk
And so I went looking for a related
client-side
SDK which led me to this:https://developer.squareup.com/reference/sdks/web/payments
I was following the process there and got to the point where I got a
payment token
returned from:After entering test card details, ie:
See: https://developer.squareup.com/reference/sdks/web/payments/objects/Card#Card.tokenize
But then I got lost when referring to:
https://developer.squareup.com/docs/subscriptions-api/walkthrough#step-3-create-subscriptions
As it doesn't seem to mention a
payment token
at all.I am fearing that the
Web Payments SDK
is not related to subscriptions at all?If that is the case, is there a client-side SDK for subscriptions?
It looks like someone else was having the same confusion here:
https://developer.squareup.com/forums/t/front-end-code-subscriptions-api/2659
But I couldn't figure out what the resolution was there - as the square support person referred back to the
Web Payments SDK
.Below is where I got up to using the
Web Payments SDK
:HTML - index.html
JavaScript - index.js
Thanks for help, I am in a glass case of emotion right now: