Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove obsolete data from interface interactions #84

Merged
merged 6 commits into from
Nov 26, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename adyenRequest to adyenRequestBody in tests.
ahmetoz committed Nov 25, 2019
commit 3be539f5d9beffe4d86e5c37798ad0670a8ede92
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
@@ -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)
Original file line number Diff line number Diff line change
@@ -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`)
Original file line number Diff line number Diff line change
@@ -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)