diff --git a/log.md b/log.md index 8639df7..c0096c4 100644 --- a/log.md +++ b/log.md @@ -268,3 +268,8 @@ BRIDGE-973 - Make sure it work Started THX-1138 - Rule can be confirmed with different user / different payee instrument +##### 2018-05-19 // Friday ##### + +*DONE* BRIDGE-1138 - Rule can be confirmed with different user / different payee instrument + +*DONE* BRIDGE-973 - Make sure it work \ No newline at end of file diff --git a/tasks/bridge-973/rework.md b/tasks/bridge-973/rework.md new file mode 100644 index 0000000..c5582a4 --- /dev/null +++ b/tasks/bridge-973/rework.md @@ -0,0 +1,402 @@ +# Acceptance Criteria # + +The following acceptance criteria tests were performed on DEV. + + +## 1. User successfully confirms and activates a rule ## + +Re-authorise with : + +``` +Bearer YTM2ZGQ1NzUtOWFmNS01MjMyLTg5MjYtM2NkZjA5ZDU2ZGU1 + +``` + +Payee Account +``` + +{ + "description": "Silver Carpenter Inc. account.", + "receivingAccountServiceKey": "T_S_7c8551db-2aa0-489d-b80e-d1a8d42e4bfb" +} + +``` + + +created world pay +``` +{ + "key": "768f07ca-5006-475f-812a-46be3cba88e8", + "ID": "5afd571bfb887d13c5f32aa5" +} +``` + +created credit card +``` +{ + "cardUsageKey": "9ca8b121-5543-4629-b53d-087d650ad17a", + "cardID": "5afd5759fb887d13c5f32aa9" +} +``` + +UserID 79a26d981246978135edadf1 + +``` +{ + "trigger": { + "stage": "paymentComplete", + "type": "ruleIdInRtp" + }, + "rule": { + "payerInstrument": { + "ID": "5afd5759fb887d13c5f32aa9", + "key": "9ca8b121-5543-4629-b53d-087d650ad17a" + }, + "payeeID": "79a26d981246978135edadf1", + "percentageShare": 2 + } +} +``` + + +created rule id +``` +{ + "ID": "5afed9a360874a1caa2145a3" +} +``` + +/receivables/rules/{objectID} Confirm a rule in our favour + +ObjectID: 5afed9a360874a1caa2145a3 +``` +{ + "key": "768f07ca-5006-475f-812a-46be3cba88e8", + "ID": "5afd571bfb887d13c5f32aa5" +} +``` + +Code Details +200 + +``` +{ + "_id" : ObjectId("5afed9a360874a1caa2145a3"), + "UserID" : "79a26d981246978135edadf1", + "LastUpdate" : ISODate("2018-05-18T13:49:43.441Z"), + "Trigger" : { + "Stage" : "paymentComplete", + "Type" : "ruleIdInRtp" + }, + "Rule" : { + "PayeeID" : "79a26d981246978135edadf1", + "PercentageShare" : 2, + "PayerInstrument" : { + "_id" : ObjectId("5afd5759fb887d13c5f32aa9"), + "AccountType" : "Credit/Debit Payment Card", + "ReceivingAccount" : 0, + "PaymentsAccount" : 1, + "CreditDebitCardInfo" : { + "CardPANEncrypted" : "3::a8b8d05ec4fcb789078a1f3793fdcaf31b6e71562f6a089f9a417591ecd90c3403da080a0a88ab10c24464be469aa278d7fd7c321536412676840225641152f19aa5537718f55cd0205fa5f7024b3523", + "CardExpiryEncrypted" : "3::1d946ec073fb7c5df493d1136c5b5895c562fd44cd89b28a3831c0f807f7590bd1eda7385ae19fb21baf28397ad3a3213fe0521c76a2ea5dc50c1693f6740893", + "CardValidFromEncrypted" : "3::28429a6df6654a86fbd83ad7ac825c0e73ccb1d4e2c9154dd0be7d95fbc1124c88c45157c92d879b5b4514a2d1a610351e8214eb65c0b0c1698027093c510973", + "IssueNumberEncrypted" : "3::4256e6227b52f6e716a64f9b2480253450685bb483e33bf6e01b1c0447c9b3fc4460e7d50edbb3cecb8b375c39697c9ad456d32dfbe089a1e1d21fe85d9da832", + "NameOnAccount" : "Bob Bobbington", + "CardPAN" : "4*** **** **** *111", + "Email" : "a@b.com", + "FirstName" : "Bob", + "LastName" : "Bobbington", + "address" : { + "_id" : ObjectId("5afd5759fb887d13c5f32aa8"), + "UserID" : "79a26d981246978135edadf1", + "AddressDescription" : "", + "BuildingNameFlat" : "Flat 20", + "Address1" : "Victoria House", + "Address2" : "15 The Street", + "Town" : "Christchurch", + "County" : "Dorset", + "PostCode" : "BH23 6AA", + "Country" : "", + "PhoneNumber" : "+44 123 1110000", + "ResidentTo" : "", + "ResidentFrom" : "", + "DateAdded" : ISODate("2018-05-17T10:20:09.531Z"), + "LastUpdate" : ISODate("2018-05-17T10:20:09.531Z"), + "LastVersion" : 1 + } + }, + "UserID" : "79a26d981246978135edadf1", + "VendorID" : "Visa", + "VendorAccountName" : "Credit/Debit Card", + "Description" : "Bobs account.", + "IconLocation" : "VISA_CREDIT.png", + "APIVersion" : "7.6.4-3121ed79e06cb111db8a6632564a062e633d485d", + "Integrity" : null, + "LastUpdate" : ISODate("2018-05-17T10:20:09.531Z"), + "LastVersion" : 1 + }, + "PayeeInstrument" : { + "_id" : ObjectId("5afd571bfb887d13c5f32aa5"), + "AccountType" : "Worldpay Online Payments Account", + "ReceivingAccount" : 1, + "PaymentsAccount" : 0, + "WorldpayOnlinePaymentsInfo" : { + "ServiceKeyEncrypted" : "3::b043a0b34839e311038c4234e0212b0d910764ea6450f5f222dad65370abcd29b832d37c8928e9a1c1c4523636792c930828ceb09035149bb26dadfde0fb066120879282ab1ff900d1e3a64a5054f9c3b296298a605cdf8cdfd87d50d9e767ae", + "ServiceKey" : "T_S_********-****-****-****-********4bfb" + }, + "UserID" : "79a26d981246978135edadf1", + "VendorID" : "Worldpay", + "VendorAccountName" : "Worldpay Online Payments", + "Description" : "Silver Carpenter Inc. account.", + "IconLocation" : "worldpay-account.png", + "APIVersion" : "7.6.4-3121ed79e06cb111db8a6632564a062e633d485d", + "Integrity" : null, + "LastUpdate" : ISODate("2018-05-17T10:19:07.848Z"), + "LastVersion" : 1 + } + }, + "Status" : "Activated", + "LastVersion" : 2 +} + +``` + + +## 2. I have supplied a saved instrument and the instrument ID is invalid ## + +Create a new rule + +``` +{ + "trigger": { + "stage": "paymentComplete", + "type": "ruleIdInRtp" + }, + "rule": { + "payerInstrument": { + "ID": "5afd5759fb887d13c5f32aa9", + "key": "9ca8b121-5543-4629-b53d-087d650ad17a" + }, + "payeeID": "79a26d981246978135edadf1", + "percentageShare": 2 + } +} +``` + +created rule id +``` +{ + "ID": "5afeda7d60874a1caa2145a8" +} +``` + +/receivables/rules/{objectID} Confirm a rule in our favour + +ObjectID: `5afeda7d60874a1caa2145a8` + +``` +{ + "key": "768f07ca-5006-475f-812a-46be3cba88e8", + "ID": "5afd571bfb887d13c5f32bad" +} +``` + +``` +Result: 400 +Error: Bad Request + +{ + "code": 600, + "info": "The instrument could not be found, has no access or has expired." +} +``` + +## 3. I have supplied a saved payment instrument and the instrument does not belong to me ## + +Re-authorise with : + +``` +Bearer YTM2ZGQ1NzUtOWFmNS01MjMyLTg5MjYtM2NkZjA5ZDU2ZGU2 + +``` + +Create a new world pay merchant + +``` +{ + "description": "Greenock Tin Inc. account.", + "receivingAccountServiceKey": "T_S_7c8551db-2aa0-489d-b80e-d1a8d42e4bfb" +} + +``` +Created: + +``` +{ + "key": "9de916f0-70f0-4199-88ab-14fd4375d9bc", + "ID": "5afd749f59ab4014b6179d55" +} +``` + +Re-authorise with : + +``` +Bearer YTM2ZGQ1NzUtOWFmNS01MjMyLTg5MjYtM2NkZjA5ZDU2ZGU1 + +``` + +Create a new rule + +``` +{ + "trigger": { + "stage": "paymentComplete", + "type": "ruleIdInRtp" + }, + "rule": { + "payerInstrument": { + "ID": "5afd5759fb887d13c5f32aa9", + "key": "9ca8b121-5543-4629-b53d-087d650ad17a" + }, + "payeeID": "79a26d981246978135edadf1", + "percentageShare": 2 + } +} +``` + +Results: +``` +{ + "ID": "5afedadb60874a1caa2145ac" +} +``` +Try to confirm the rule with someone elses instrument details +``` +ObjectID: 5afedadb60874a1caa2145ac + +{ + "key": "9de916f0-70f0-4199-88ab-14fd4375d9bc", + "ID": "5afd749f59ab4014b6179d55" +} +``` + +``` +Code 400 +Error: Bad Request +Response body +{ + "code": 600, + "info": "The instrument could not be found, has no access or has expired." +} +``` + +## 4. I have supplied a saved instrument and the encryption key is not correct ## + +Using rule created in step 2: + +Created rule id +``` +{ + "ID": "5afeda7d60874a1caa2145a8" +} +``` + +/receivables/rules/{objectID} Confirm a rule in our favour + +``` +ObjectID: 5afeda7d60874a1caa2145a8 + +{ + "key": "badbadba-dbad-badb-adba-dbadbadbadba", + "ID": "5afd571bfb887d13c5f32aa5" +} +``` + +``` +Code 401 +Undocumented +Error: Unauthorized +Response body +{ + "code": 602, + "info": "The instrument could not be decrypted." +} +``` + +## 5. the Rule does not exist ## + +Use + +``` +ObjectID: 000000000000000badbadbad + +{ + "key": "768f07ca-5006-475f-812a-46be3cba88e8", + "ID": "5afd571bfb887d13c5f32aa5" +} +``` + +``` +Code 400 +Error: Bad Request +Response body +{ + "code": 627, + "info": "The Rule doesn't exist or you don't have permission to access it." +} +``` + + +## 6. My UserID is not the same as the Payee Instrument's UserID ## + +Create new rule + +``` +{ + "trigger": { + "stage": "paymentComplete", + "type": "ruleIdInRtp" + }, + "rule": { + "payerInstrument": { + "ID": "5afd5759fb887d13c5f32aa9", + "key": "9ca8b121-5543-4629-b53d-087d650ad17a" + }, + "payeeID": "79a26d981246978135edadf1", + "percentageShare": 2 + } +} +``` + +``` +{ + "ID": "5afeddac60874a1caa2145b3" +} +``` + +Re authorise +`Bearer YTM2ZGQ1NzUtOWFmNS01MjMyLTg5MjYtM2NkZjA5ZDU2ZGU2` + +Use worldpay account created in step 3 + +Try to confirm the rule with an account associated with user 'GU2. + +``` +ObjectID: 5afeddac60874a1caa2145b3 + +{ + "key": "9de916f0-70f0-4199-88ab-14fd4375d9bc", + "ID": "5afd749f59ab4014b6179d55" +} +``` + +``` +Code 400 +Error: Bad Request +Response body +{ + "code": 627, + "info": "The Rule doesn't exist or you don't have permission to access it." +} + +``` \ No newline at end of file