Skip to content

Commit

Permalink
style: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Beatty committed Oct 20, 2023
1 parent 2421e35 commit 763ede1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ async function createPayment(req, res) {
payment.verificationToken = payload.verificationToken;
}

const { result, statusCode } = await square.paymentsApi.createPayment(
payment
);
const { result, statusCode } =
await square.paymentsApi.createPayment(payment);

logger.info('Payment succeeded!', { result, statusCode });

Expand Down Expand Up @@ -131,7 +130,7 @@ async function storeCard(req, res) {
} else {
// IDEA: send to error reporting service
logger.error(
`Error creating card-on-file on attempt ${attempt}: ${ex}`
`Error creating card-on-file on attempt ${attempt}: ${ex}`,
);
throw ex; // to attempt retry
}
Expand All @@ -151,5 +150,5 @@ async function serveStatic(req, res) {
module.exports = router(
post('/payment', createPayment),
post('/card', storeCard),
get('/*', serveStatic)
get('/*', serveStatic),
);
12 changes: 6 additions & 6 deletions server/schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test('validatePaymentPayload returns true if valid payload', (t) => {
locationId: 'LKYXSPGPXK05M',
sourceId: 't0k3n',
idempotencyKey: 'idempot5cyK3y',
})
}),
);
});

Expand All @@ -19,15 +19,15 @@ test('validatePaymentPayload returns false if invalid amount', (t) => {
amount: '$2.34',
locationId: 'LKYXSPGPXK05M',
sourceId: 't0k3n',
})
}),
);
});

test('validatePaymentPayload returns false if incomplete payload', (t) => {
t.false(
schema.validatePaymentPayload({
locationId: 'LKYXSPGPXK05M',
})
}),
);
});

Expand All @@ -42,7 +42,7 @@ test('validateCreateCardPayload returns true if valid payload', (t) => {
locationId: 'LKYXSPGPXK05M',
customerId: 'customer123',
idempotencyKey: 'idempot5cyK3y',
})
}),
);
});

Expand All @@ -51,7 +51,7 @@ test('validateCreateCardPayload returns false if missing sourceId', (t) => {
schema.validateCreateCardPayload({
locationId: 'LKYXSPGPXK05M',
customerId: 'customer123',
})
}),
);
});

Expand All @@ -60,7 +60,7 @@ test('validateCreateCardPayload returns false if missing customerId', (t) => {
schema.validateCreateCardPayload({
sourceId: 't0k3n',
locationId: 'LKYXSPGPXK05M',
})
}),
);
});

Expand Down

0 comments on commit 763ede1

Please sign in to comment.