Todays update

This commit is contained in:
Martin Donelly 2018-03-19 16:26:05 +00:00
parent f6f3e27f58
commit 72854cd984
3 changed files with 150 additions and 0 deletions

11
work/Comcarde/log.md Normal file
View File

@ -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.

19
work/Comcarde/noted.md Normal file
View File

@ -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
```

View File

@ -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"
}
}
```