79 lines
1.4 KiB
Markdown
79 lines
1.4 KiB
Markdown
BRIDGE-592: Use validated `req.swagger.params.body.value`
|
|
|
|
# Summary
|
|
|
|
`req.body` is incorrectly being used in multiple places in the controllers for the /dev/ API.
|
|
|
|
These should be changed to use `req.swagger.params.body.value` which is the properly validated version.
|
|
|
|
Anything which was just a `req.body` was changed to `req.swagger.params.body.value`.
|
|
|
|
This affected:
|
|
`worldpayPayment`,
|
|
`saveCardDetails`,
|
|
`saveWorldpayReceivingAccount`,
|
|
`makeWorldpayPaymentWithSavedCard`
|
|
|
|
# Details
|
|
|
|
Any additional details. Specific technical points, etc.
|
|
|
|
# Test Plan
|
|
|
|
* Unit tests run and pass
|
|
* Manual tests for the following were performed
|
|
|
|
|
|
**Make a worldpay payment.** /payments/worldpay
|
|
|
|
Code 200
|
|
|
|
Response body
|
|
|
|
```json
|
|
{
|
|
"transaction": {
|
|
"id": "58b243a2-0d37-4205-a24d-f606a914124e"
|
|
}
|
|
}
|
|
```
|
|
|
|
**Save card details.** /payment-instruments/cards
|
|
|
|
Code 201
|
|
|
|
Response body
|
|
|
|
```json
|
|
{
|
|
"cardUsageKey": "b8a1b1fc-31f2-42f3-be87-8a17b5145ea1",
|
|
"cardID": "5aafc2f6f1e5b108cb6be947"
|
|
}
|
|
```
|
|
|
|
**Save a worldpay receiving account.** /payment-instruments/worldpay-merchants
|
|
|
|
Code 201
|
|
|
|
Response body
|
|
|
|
```json
|
|
{
|
|
"key": "926db588-d800-496f-85ce-0c2c4a203665",
|
|
"ID": "5aafc1e7f1e5b108cb6be943"
|
|
}
|
|
```
|
|
|
|
**Pay using stored card.** /payment-instruments/cards/{instrumentID}/payments
|
|
|
|
Code 200
|
|
|
|
Response body
|
|
|
|
```json
|
|
{
|
|
"transaction": {
|
|
"id": "09f16a90-4328-4625-85b9-995a69ae24b4"
|
|
}
|
|
}
|
|
``` |