From 72854cd98494c8704d2480a58a76155d5c2cbbc6 Mon Sep 17 00:00:00 2001 From: Martin Donelly Date: Mon, 19 Mar 2018 16:26:05 +0000 Subject: [PATCH] Todays update --- work/Comcarde/log.md | 11 +++ work/Comcarde/noted.md | 19 ++++ work/Comcarde/tasks/bridge_592/tests.md | 120 ++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 work/Comcarde/log.md create mode 100644 work/Comcarde/noted.md create mode 100644 work/Comcarde/tasks/bridge_592/tests.md diff --git a/work/Comcarde/log.md b/work/Comcarde/log.md new file mode 100644 index 0000000..6dc7fea --- /dev/null +++ b/work/Comcarde/log.md @@ -0,0 +1,11 @@ +## Log ## + + +##### 2018-03-19 // Monday ##### + +**[BRIDGE_592](https://comcarde.atlassian.net/browse/BRIDGE-592) Use validated `req.swagger.params.body.value` not unvalidated `req.body` in controllers** + +Changed body.req in a number of functions to the Swagger validated req.swagger.params.body.value + +Reading documentation. + diff --git a/work/Comcarde/noted.md b/work/Comcarde/noted.md new file mode 100644 index 0000000..2cebd55 --- /dev/null +++ b/work/Comcarde/noted.md @@ -0,0 +1,19 @@ +## WorldPay Keys ## + +#### API Keys #### + +``` +2b8b6d93-131a-45c7-900e-661bb91fe629 +``` + +#### Service Key #### + +``` +T_S_7c8551db-2aa0-489d-b80e-d1a8d42e4bfb +``` + +#### Client Key #### + +``` +T_C_97abb455-15d4-4d1d-9f6c-13aec73c5590 +``` \ No newline at end of file diff --git a/work/Comcarde/tasks/bridge_592/tests.md b/work/Comcarde/tasks/bridge_592/tests.md new file mode 100644 index 0000000..1496685 --- /dev/null +++ b/work/Comcarde/tasks/bridge_592/tests.md @@ -0,0 +1,120 @@ +#### worldpayPayment #### + +Make a payment (not to be confused with making a worldpay payment with a saved instrument!). + +function worldpayPayment(req, res) { + +```javascript +return payDirectly.payment(req.body) +``` + +changed to + +```javascript +return payDirectly.payment(req.swagger.params.body.value) +``` + +/payments/worldpay +Make a worldpay payment. + +Code 200 + +Response body + +```json +{ + "transaction": { + "id": "58b243a2-0d37-4205-a24d-f606a914124e" + } +} +``` + + +#### saveCardDetails #### + +Save the card + +```javascript +return createCard.create(req.body, req.session.data.user) +``` + +changed to + +```javascript +return createCard.create(req.swagger.params.body.value, req.session.data.user) +``` + +/payment-instruments/cards +Save card details. + +Code 201 + +Response body + +```json +{ + "cardUsageKey": "b8a1b1fc-31f2-42f3-be87-8a17b5145ea1", + "cardID": "5aafc2f6f1e5b108cb6be947" +} +``` + +#### saveWorldpayReceivingAccount #### + +Save a worldpay receiving account + +```javascript +return createWorldPayMerchant.create(req.body, req.session.data.user) +``` + +changed to + +```javascript +return createWorldPayMerchant.create(req.swagger.params.body.value, req.session.data.user) +``` + +/payment-instruments/worldpay-merchants +Save a worldpay receiving account. + +Code 201 + +Response body + +```json +{ + "key": "926db588-d800-496f-85ce-0c2c4a203665", + "ID": "5aafc1e7f1e5b108cb6be943" +} +``` + + +#### makeWorldpayPaymentWithSavedCard #### + +Logs the correct information + +```javascript +return payWithSavedCard.payment(req.body, req.swagger.params.instrumentID.value, req.session.data.user) +``` + +changed to + +```javascript +return payWithSavedCard.payment(req.swagger.params.body.value, req.swagger.params.instrumentID.value, req.session.data.user) +``` + +/payment-instruments/cards/{instrumentID}/payments +Pay using stored card. + +Code 200 + +Response body + +```json +{ + "transaction": { + "id": "09f16a90-4328-4625-85b9-995a69ae24b4" + } +} +``` + + +