Skip to content

Commit

Permalink
rename adyenRequest to adyenRequestBody in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetoz committed Nov 25, 2019
1 parent db59654 commit 3be539f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions extension/test/integration/cancel-or-refund.handler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ describe('Cancel or refund', () => {
expect(refundTransaction.state).to.equal('Pending')

const interfaceInteractionFields = updatedPayment.interfaceInteractions[1].fields
const adyenRequest = JSON.parse(interfaceInteractionFields.request)
const adyenRequestBody = JSON.parse(adyenRequest)
//interfaceInteractionFields.request is a stringify json
const adyenRequestBody = JSON.parse(JSON.parse(interfaceInteractionFields.request))
expect(adyenRequestBody.originalReference).to.equal(chargeTransaction.interactionId)

const adyenResponse = JSON.parse(interfaceInteractionFields.response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ describe('credit card payment', () => {
})

const response = await ctpClient.create(ctpClient.builder.payments, JSON.parse(paymentDraft))
const adyenRequest = JSON.parse(response.body.interfaceInteractions[0].fields.request)

const adyenRequestBody = JSON.parse(adyenRequest)
const adyenRequestBody = JSON.parse(JSON.parse(response.body.interfaceInteractions[0].fields.request))
expect(adyenRequestBody.merchantAccount).to.be.equal(process.env.ADYEN_MERCHANT_ACCOUNT)
expect(adyenRequestBody.reference).to.be.equal(paymentTemplate.custom.fields.merchantReference)
expect(adyenRequestBody.returnUrl).to.be.equal(`${process.env.API_EXTENSION_BASE_URL}/test-return-url`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ describe('fetch payment', () => {

const interfaceInteractionFields = response.body.interfaceInteractions[0].fields
expect(interfaceInteractionFields.type).to.be.equal('getAvailablePaymentMethods')
const adyenRequest = JSON.parse(interfaceInteractionFields.request)

const adyenRequestBody = JSON.parse(adyenRequest)
const adyenRequestBody = JSON.parse(JSON.parse(interfaceInteractionFields.request))
expect(adyenRequestBody.merchantAccount).to.be.equal(process.env.ADYEN_MERCHANT_ACCOUNT)
expect(adyenRequestBody.countryCode).to.be.equal(paymentTemplate.custom.fields.countryCode)
expect(adyenRequestBody.amount.currency).to.be.equal(paymentTemplate.amountPlanned.currencyCode)
Expand Down

0 comments on commit 3be539f

Please sign in to comment.