--- simlet: refund ApplicationID: is: parameter from: body element: ".applicationId" GUID: is: parameter from: body element: ".UUID" TranDateTime: is: parameter from: body element: ".tranDateTime" OriginalTranUUID: is: parameter from: body element: ".originalTranUUID" OTP: is: parameter from: body element: ".OTP" AuthenticationType: is: parameter from: body element: ".authenticationType" request: - method: POST - uriPath: /doQRRefund - header: Content-Type equals: "application/json;charset=UTF-8" responses: #case 1 - when: request: - where: parameter named: OTP exists: false #and #named: AuthenticationType #equals: 03 #then from: template #stub status: 200 headers: - "Content-Type: application/json;charset=UTF-8" body: ` { "applicationId":"${ApplicationID}", "tranDateTime":"${TranDateTime}", "UUID":"${GUID}", "originalTranUUID":"${OriginalTranUUID}", "responseCode":682, "responseMessage":"Transaction Initiated Successfully", "responseStatus":"Successful" } ` # case 2 - when: request: - where: parameter named: OTP exists: true #and - where: parameter named: OTP not equals: "8843" #then from: template status: 200 headers: - "Content-Type: application/json;charset=UTF-8" body: ` { "applicationId":"${ApplicationID}", "tranDateTime":"${TranDateTime}", "UUID":"${GUID}", "originalTranUUID":"${OriginalTranUUID}", "responseCode":936, "responseMessage":"Invalid OTP", "responseStatus":"Failed" } ` # case 3 - when: request: - where: parameter named: OTP exists: true #and - where: parameter named: OTP equals: "8843" #then from: template status: 200 headers: - "Content-Type: application/json;charset=UTF-8" body: ` { "applicationId":"${ApplicationID}", "tranDateTime":"${TranDateTime}", "UUID":"${GUID}", "originalTranUUID":"${OriginalTranUUID}", "responseCode":0, "responseMessage":"Approved", "responseStatus":"Successful", "balance":{ "available":12356.12, "leger":12356.12 }, "acqTranFee":0.0, "issuerTranFee":0.0 } ` ##otherwise - from: template #stub status: 200 headers: - "Content-Type: application/json;charset=UTF-8" body: ` { "applicationId":"${ApplicationID}", "tranDateTime":"${TranDateTime}", "UUID":"${GUID}", "responseCode":835, "responseMessage":"Invalid Original Transaction Id", "responseStatus":"Failed" } ` ---