-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update bookings example * update order ahead example * update invoice sample
- Loading branch information
1 parent
7520234
commit 330fcd9
Showing
5 changed files
with
18 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ limitations under the License. | |
|
||
const { Client, Environment } = require("square"); | ||
const readline = require("readline"); | ||
const { v4: uuidv4 } = require("uuid"); | ||
const crypto = require("crypto"); | ||
const { program } = require("commander"); | ||
require("dotenv").config(); | ||
|
||
|
@@ -44,14 +44,14 @@ async function addCustomers() { | |
try { | ||
// Create first customer with card on file | ||
const { result : { customer } } = await customersApi.createCustomer({ | ||
idempotencyKey: uuidv4(), | ||
idempotencyKey: crypto.randomUUID(), | ||
givenName: "Ryan", | ||
familyName: "Nakamura", | ||
emailAddress: "[email protected]" // it is a fake email | ||
}); | ||
|
||
await cardsApi.createCard({ | ||
idempotencyKey: uuidv4(), | ||
idempotencyKey: crypto.randomUUID(), | ||
sourceId: "cnon:card-nonce-ok", | ||
card: { | ||
customerId: customer.id | ||
|
@@ -60,7 +60,7 @@ async function addCustomers() { | |
|
||
// create second customer with no card on file | ||
await customersApi.createCustomer({ | ||
idempotencyKey: uuidv4(), | ||
idempotencyKey: crypto.randomUUID(), | ||
givenName: "Kaitlyn", | ||
familyName: "Spindel", | ||
emailAddress: "[email protected]" // it is a fake email | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters