square / connect-api-examples

Code samples demonstrating the functionality of the Square Connect API
https://developer.squareup.com/docs/sample-apps
389 stars 792 forks source link

Update invoice sample app #419

Closed barakj closed 1 year ago

barakj commented 1 year ago

This PR updates the invoice sample app and fixes a few issues:

  1. Minimum node version is now V14.15.0.
  2. The sample app is now using the latest SDK version.
  3. Replace deprecated methods such as createCustomerCard and replace them with up-to-date ones (createCard).
  4. Since cards are not part of the customer object anymore, use ListCards with customer ID to fetch cards associated with a certain customer.
  5. Add error handling/retry for cases where the invoice to create contains unsupported/premium features according to this migration guide: https://developer.squareup.com/docs/invoices-api/overview#migration-notes
  6. Fix README.