-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: snowpack example #6
Conversation
|
||
async function start() { | ||
const payments = await Square.payments(applicationId, locationId); | ||
const card = await payments.card(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some sort of error handling for the await
statements. I think it is very important that we add it for the tokenize
call.
6553e53
to
afbbca5
Compare
const locationId = 'LKYXSPGPXK05M'; | ||
|
||
async function start() { | ||
const payments = await Square.payments(applicationId, locationId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Square.payments
is not asyc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind this is web-sdk
, the WebPaySDK wrapper, not the underlying SDK itself. But maybe it's a little confusing that the method names are the same, but the signatures are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's some disconnect because of how we're handling loading on behalf of the developer. perhaps examples would be clearer using an import like import { payments }
but still unclear how much overlap there'll be in audiences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this conversation, and see that we are doing this as Square.payments
here actually loads the script. I will give some thought into how we can possibly rectify the web-sdk
package vs the underlying SDK, but this should be fine for right now.
examples/snowpack/pay.js
Outdated
const payments = await Square.payments(applicationId, locationId); | ||
const card = await payments.card(); | ||
|
||
card.attach('#card'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
however attach
is async.
afbbca5
to
701425d
Compare
🎉 This PR is included in version 1.0.0-beta.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
* beta: feat(payments): upgrade Web Payments SDK to v1 (#10) chore(deps): bump @babel/preset-typescript from 7.12.17 to 7.14.5 (#16) chore(deps): bump @types/jest from 26.0.20 to 26.0.23 (#15) chore(deps): bump @babel/core from 7.12.17 to 7.14.5 (#12) ci: add @codecov (#9) chore(deps): add @dependabot (#8) ci: add code scanning action (#7) feat: add typings, and ability to import typings, to package (#11) docs: snowpack example (#6) docs: release process + script to automate (#5)
🎉 This PR is included in version 2.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
adds a simple card payment example using snowpack