# Acceptance Criteria # The following acceptance criteria tests were performed on DEV. ### 1. User redeems receivecode with given credit or debit card ### Authorise with : ``` Bearer YTM2ZGQ1NzUtOWFmNS01MjMyLTg5MjYtM2NkZjA5ZDU2ZGU1 ``` Create Worldpay Merchant ```json { "key": "1ae580b2-0b9e-4864-a0f8-a4db14e4495a", "ID": "5ac3587872999f1ef044d2d5" } ``` Create Receive Code Using : `/receivecodes` ```json { "key": "1ae580b2-0b9e-4864-a0f8-a4db14e4495a", "ID": "5ac3587872999f1ef044d2d5" } ``` Response ```json { "receivecode": "SAE7K" } ``` Redeem Receive Code using Credit card details ```json { "receivecode": "SAE7K", "paymentDetails": { "payer": { "email": "a@b.com", "firstName": "John", "lastName": "Doe" }, "card": { "nameOnCard": "John E Doe", "PAN": "4444 3333 2222 1111", "expiryDate": "01-20", "startDate": "01-00", "issueNumber": 1, "address": { "address1": "Flat 20", "address2": "Victoria House", "address3": "15 The Street", "town": "Christchurch", "county": "Dorset", "postcode": "BH23 6AA", "phoneNumber": "+44 123 1110000" } } }, "amount": { "value": 1 }, "transactionDetails": { "worldpay": { "orderDescription": "2 Calling Birds, 1 Partridge in a Pear tree" } } } ``` Server Response ```json { "transaction": { "id": "714d09e0-bd85-4588-9ed9-444316030f1b" } } ``` ### 2. Receivecode does not exist ### Use non-existent receivecode: `F2EE5` Redeem Receive Code using Credit card details ```json { "receivecode": "F2EE5", "paymentDetails": { "payer": { "email": "a@b.com", "firstName": "John", "lastName": "Doe" }, "card": { "nameOnCard": "John E Doe", "PAN": "4444 3333 2222 1111", "expiryDate": "01-20", "startDate": "01-00", "issueNumber": 1, "address": { "address1": "Flat 20", "address2": "Victoria House", "address3": "15 The Street", "town": "Christchurch", "county": "Dorset", "postcode": "BH23 6AA", "phoneNumber": "+44 123 1110000" } } }, "amount": { "value": 1 }, "transactionDetails": { "worldpay": { "orderDescription": "2 Calling Birds, 1 Partridge in a Pear tree" } } } ``` Server Response ```json { "code": 608, "info": "The receivecode could not be found or has expired." } ``` ### 3. Receivecode has expired ### Create Receive Code Using : `/receivecodes` ```json { "key": "1ae580b2-0b9e-4864-a0f8-a4db14e4495a", "ID": "5ac3587872999f1ef044d2d5" } ``` Response ```json { "receivecode": "VPCHT" } ``` Wait for 4 minutes Redeem Receive Code using Credit card details ```json { "receivecode": "VPCHT", "paymentDetails": { "payer": { "email": "a@b.com", "firstName": "John", "lastName": "Doe" }, "card": { "nameOnCard": "John E Doe", "PAN": "4444 3333 2222 1111", "expiryDate": "01-20", "startDate": "01-00", "issueNumber": 1, "address": { "address1": "Flat 20", "address2": "Victoria House", "address3": "15 The Street", "town": "Christchurch", "county": "Dorset", "postcode": "BH23 6AA", "phoneNumber": "+44 123 1110000" } } }, "amount": { "value": 1 }, "transactionDetails": { "worldpay": { "orderDescription": "2 Calling Birds, 1 Partridge in a Pear tree" } } } ``` Server Response ```json { "code": 608, "info": "The receivecode could not be found or has expired." } ``` ### 4. Receivecode has already been redeemed ### Create Receive Code Using : `/receivecodes` ```json { "key": "1ae580b2-0b9e-4864-a0f8-a4db14e4495a", "ID": "5ac3587872999f1ef044d2d5" } ``` Response ```json { "receivecode": "HJ571" } ``` Redeem Receive Code using Credit card details ```json { "receivecode": "HJ571", "paymentDetails": { "payer": { "email": "a@b.com", "firstName": "John", "lastName": "Doe" }, "card": { "nameOnCard": "John E Doe", "PAN": "4444 3333 2222 1111", "expiryDate": "01-20", "startDate": "01-00", "issueNumber": 1, "address": { "address1": "Flat 20", "address2": "Victoria House", "address3": "15 The Street", "town": "Christchurch", "county": "Dorset", "postcode": "BH23 6AA", "phoneNumber": "+44 123 1110000" } } }, "amount": { "value": 1 }, "transactionDetails": { "worldpay": { "orderDescription": "2 Calling Birds, 1 Partridge in a Pear tree" } } } ``` Server Response ```json { "transaction": { "id": "1a553300-7bd4-4fc6-8f8b-23eccea76963" } } ``` Redeem Receive Code a second time using Credit card details ```json { "receivecode": "HJ571", "paymentDetails": { "payer": { "email": "a@b.com", "firstName": "John", "lastName": "Doe" }, "card": { "nameOnCard": "John E Doe", "PAN": "4444 3333 2222 1111", "expiryDate": "01-20", "startDate": "01-00", "issueNumber": 1, "address": { "address1": "Flat 20", "address2": "Victoria House", "address3": "15 The Street", "town": "Christchurch", "county": "Dorset", "postcode": "BH23 6AA", "phoneNumber": "+44 123 1110000" } } }, "amount": { "value": 1 }, "transactionDetails": { "worldpay": { "orderDescription": "2 Calling Birds, 1 Partridge in a Pear tree" } } } ``` Server Response ```json { "code": 608, "info": "The receivecode could not be found or has expired." } ``` ### 5. Request should be logged ### ##### 1. User redeems receivecode with given credit or debit card ##### ```json { "_id" : ObjectId("5ac35c6772999f1ef044d342"), "timestamp" : ISODate("2018-04-03T10:50:15.806Z"), "level" : "info", "message" : "Successful redeemed a receivecode", "meta" : { "logId" : "payments:receivecodes", "ip" : "62.232.80.210", "reqId" : "921e72ab-c093-4a8c-8bd7-14dff2dd83a2", "userId" : "79a26d981246978135edadf1", "file" : "/home/flexops/node_server/dev_api/controllers/receivecode_controller.js", "_payerDetailsPAN" : "4*** **** **** 22 1", "_receivecode" : "SAE7K", "_totalAmount" : 1, "_currency" : "GBP", "_worldpayOrderCode" : "714d09e0-bd85-4588-9ed9-444316030f1b", "_cardSchemeName" : "VISA CREDIT", "_riskScore" : "1" }, "hostname" : "node01-cl01-cc" } ``` ##### 2. Receivecode does not exist ##### ```json { "_id" : ObjectId("5ac35d1372999f1ef044d345"), "timestamp" : ISODate("2018-04-03T10:53:07.954Z"), "level" : "error", "message" : "Unsuccessful redeemed a receivecode", "meta" : { "logId" : "payments:receivecodes", "ip" : "62.232.80.210", "reqId" : "117d2f1b-0650-4f1b-811a-64ed4baef740", "userId" : "79a26d981246978135edadf1", "file" : "/home/flexops/node_server/dev_api/controllers/receivecode_controller.js", "_payerDetailsPAN" : "4*** **** **** 22 1", "_receivecode" : "F2EE5", "_totalAmount" : 1, "_currency" : "GBP", "_extraInfo" : {}, "_internalError" : "Error: BRIDGE: INVALID RECEIVECODE", "_httpCode" : 400, "_info" : "The receivecode could not be found or has expired.", "_code" : 608 }, "hostname" : "node01-cl01-cc" } ``` ##### 3. Receivecode has expired ##### ```json { "_id" : ObjectId("5ac35e9b72999f1ef044d355"), "timestamp" : ISODate("2018-04-03T10:59:39.994Z"), "level" : "error", "message" : "Unsuccessful redeemed a receivecode", "meta" : { "logId" : "payments:receivecodes", "ip" : "62.232.80.210", "reqId" : "c7d8c892-6946-4039-ab05-032deb3eea2f", "userId" : "79a26d981246978135edadf1", "file" : "/home/flexops/node_server/dev_api/controllers/receivecode_controller.js", "_payerDetailsPAN" : "4*** **** **** 22 1", "_receivecode" : "VPCHT", "_totalAmount" : 1, "_currency" : "GBP", "_extraInfo" : {}, "_internalError" : "Error: BRIDGE: INVALID RECEIVECODE", "_httpCode" : 400, "_info" : "The receivecode could not be found or has expired.", "_code" : 608 }, "hostname" : "node01-cl01-cc" } ``` ##### 4. Receivecode has already been redeemed ##### First use: ```json { "_id" : ObjectId("5ac35dda72999f1ef044d34e"), "timestamp" : ISODate("2018-04-03T10:56:26.800Z"), "level" : "info", "message" : "Successful redeemed a receivecode", "meta" : { "logId" : "payments:receivecodes", "ip" : "62.232.80.210", "reqId" : "2eeded01-fa80-4070-b422-b7fcf889d4c7", "userId" : "79a26d981246978135edadf1", "file" : "/home/flexops/node_server/dev_api/controllers/receivecode_controller.js", "_payerDetailsPAN" : "4*** **** **** 22 1", "_receivecode" : "HJ571", "_totalAmount" : 1, "_currency" : "GBP", "_worldpayOrderCode" : "1a553300-7bd4-4fc6-8f8b-23eccea76963", "_cardSchemeName" : "VISA CREDIT", "_riskScore" : "1" }, "hostname" : "node01-cl01-cc" } ``` Second use: ```json { "_id" : ObjectId("5ac35e0472999f1ef044d351"), "timestamp" : ISODate("2018-04-03T10:57:08.340Z"), "level" : "error", "message" : "Unsuccessful redeemed a receivecode", "meta" : { "logId" : "payments:receivecodes", "ip" : "62.232.80.210", "reqId" : "0ee62f01-2e15-442c-a271-d11dbc2669fe", "userId" : "79a26d981246978135edadf1", "file" : "/home/flexops/node_server/dev_api/controllers/receivecode_controller.js", "_payerDetailsPAN" : "4*** **** **** 22 1", "_receivecode" : "HJ571", "_totalAmount" : 1, "_currency" : "GBP", "_extraInfo" : {}, "_internalError" : "Error: BRIDGE: INVALID RECEIVECODE", "_httpCode" : 400, "_info" : "The receivecode could not be found or has expired.", "_code" : 608 }, "hostname" : "node01-cl01-cc" } ```