obtasks/archive/bridge_592/tests.md
2019-04-29 14:49:56 +01:00

1.9 KiB

worldpayPayment

Make a payment (not to be confused with making a worldpay payment with a saved instrument!).

function worldpayPayment(req, res) {

return payDirectly.payment(req.body)

changed to

return payDirectly.payment(req.swagger.params.body.value)

/payments/worldpay Make a worldpay payment.

Code 200

Response body

{
  "transaction": {
    "id": "58b243a2-0d37-4205-a24d-f606a914124e"
  }
}

saveCardDetails

Save the card

return createCard.create(req.body, req.session.data.user)

changed to

return createCard.create(req.swagger.params.body.value, req.session.data.user)

/payment-instruments/cards Save card details.

Code 201

Response body

{
  "cardUsageKey": "b8a1b1fc-31f2-42f3-be87-8a17b5145ea1",
  "cardID": "5aafc2f6f1e5b108cb6be947"
}

saveWorldpayReceivingAccount

Save a worldpay receiving account

return createWorldPayMerchant.create(req.body, req.session.data.user)

changed to

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

{
  "key": "926db588-d800-496f-85ce-0c2c4a203665",
  "ID": "5aafc1e7f1e5b108cb6be943"
}

makeWorldpayPaymentWithSavedCard

Logs the correct information

return payWithSavedCard.payment(req.body, req.swagger.params.instrumentID.value, req.session.data.user) 

changed to

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

{
  "transaction": {
    "id": "09f16a90-4328-4625-85b9-995a69ae24b4"
  }
}