(payment)
| 3511 | } |
| 3512 | |
| 3513 | function assertDocumentStructure(payment) { |
| 3514 | assert.equal(payment.paymentFor, 'order'); |
| 3515 | assert.equal(payment.externalServiceResponse.id, '1'); |
| 3516 | assert.equal(payment.externalServiceResponse.resultDetails.clearingInstituteName, 'Our local bank'); |
| 3517 | assert.deepEqual( |
| 3518 | payment.externalServiceResponse.resultDetails.authorizationResponse, |
| 3519 | { stan: '123456' } |
| 3520 | ); |
| 3521 | assert.deepEqual( |
| 3522 | payment.externalServiceResponse.resultDetails.transaction, |
| 3523 | { |
| 3524 | receipt: 'I am a transaction receipt', |
| 3525 | authorizationCode: 'ABCDEF', |
| 3526 | acquirer: { settlementDate: 'February 2021' } |
| 3527 | } |
| 3528 | ); |
| 3529 | assert.deepEqual( |
| 3530 | payment.externalServiceResponse.resultDetails.sourceOfFunds, |
| 3531 | { provided: { card: { issuer: 'Big bank corporation' } } } |
| 3532 | ); |
| 3533 | assert.deepEqual( |
| 3534 | payment.externalServiceResponse.resultDetails.nonExistentField, |
| 3535 | undefined |
| 3536 | ); |
| 3537 | } |
| 3538 | }); |
| 3539 | it('should throw when matchedCount === 0 and using orFail() on the query gh-11620', async function() { |
| 3540 | const schema = new mongoose.Schema({ |
no outgoing calls
no test coverage detected