(payment)
| 3491 | } |
| 3492 | |
| 3493 | function assertDocumentStructure(payment) { |
| 3494 | assert.equal(payment.paymentFor, 'order'); |
| 3495 | assert.equal(payment.externalServiceResponse.id, '1'); |
| 3496 | assert.equal(payment.externalServiceResponse.resultDetails.clearingInstituteName, 'Our local bank'); |
| 3497 | assert.deepEqual( |
| 3498 | payment.externalServiceResponse.resultDetails.authorizationResponse, |
| 3499 | { stan: '123456' } |
| 3500 | ); |
| 3501 | assert.deepEqual( |
| 3502 | payment.externalServiceResponse.resultDetails.transaction, |
| 3503 | { |
| 3504 | receipt: 'I am a transaction receipt', |
| 3505 | authorizationCode: 'ABCDEF', |
| 3506 | acquirer: { settlementDate: 'February 2021' } |
| 3507 | } |
| 3508 | ); |
| 3509 | assert.deepEqual( |
| 3510 | payment.externalServiceResponse.resultDetails.sourceOfFunds, |
| 3511 | { provided: { card: { issuer: 'Big bank corporation' } } } |
| 3512 | ); |
| 3513 | assert.deepEqual( |
| 3514 | payment.externalServiceResponse.resultDetails.nonExistentField, |
| 3515 | undefined |
| 3516 | ); |
| 3517 | } |
| 3518 | }); |
| 3519 | it('should throw when matchedCount === 0 and using orFail() on the query gh-11620', async function() { |
| 3520 | const schema = new mongoose.Schema({ |
no outgoing calls
no test coverage detected