Skip to content

Commit

Permalink
Remove outdated comment from server.js (#284)
Browse files Browse the repository at this point in the history
Hello! The original comment implies that a `Payment` can be created by
passing `order_id` alone. This is incorrect:`amount_money` must be
passed. I suggest removing the comment to reduce confusion.

Please let me know of any questions. Thank you! 

- [x] [Individual Contributor License Agreement
(CLA)](https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1)
signed

Co-authored-by: Abhishek Pillai <[email protected]>
  • Loading branch information
kimberleehowley and abhipillai authored Feb 4, 2025
1 parent 47465a1 commit 0a75e4b
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ async function createPayment(req, res) {
idempotencyKey: payload.idempotencyKey,
locationId: payload.locationId,
sourceId: payload.sourceId,
// While it's tempting to pass this data from the client
// Doing so allows bad actor to modify these values
// Instead, leverage Orders to create an order on the server
// and pass the Order ID to createPayment rather than raw amounts
// See Orders documentation: https://developer.squareup.com/docs/orders-api/what-it-does
amountMoney: {
// the expected amount is in cents, meaning this is $1.00.
amount: '100',
Expand Down

0 comments on commit 0a75e4b

Please sign in to comment.