Web Payments SDK takes an application ID and location Id. However, this sets up for payments on my account. I want my customers to be able take payments with my application ID but it seems they would each need to create their own “application”. We would like to avoid this like we do with Reader SDK-- use our app to do transactions on their behalf using access tokens.
Is this possible?
(Oh, and also Apple Pay and In-App Payments SDK)
Yeah, you can use OAuth to connect to other merchants Square account without having them creating an application.
Awesome! I have OAuth all set up. I already tried sending in an access token to this:
const payments = window.Square.payments(appId, locationId);
…and it said the app id was in the wrong format. How do I initialize the Web Payments API using their access token?
Nevermind… it appears I’m getting somewhere by just passing in my own application Id. I guess I figured I would have to identify the vendor somehow but maybe the location takes care of that already?
You would use your
applicationId and their
locationId to generate the
source_id with the Web Payments SDK. Once you have the
source_id you will then make the payment with the CreatePayment request with the access token you got from when they OAuthed your application.
Yeah, glad to see you figured it out.