cc-tracking/tasks/bridge-973/work.md
2018-05-18 11:37:52 +01:00

9.4 KiB

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"
}
{
  "trigger": {
    "stage": "paymentComplete",
    "type": "ruleIdInRtp"
  },
  "rule": {
    "payerInstrument": {
      "ID": "5afd5759fb887d13c5f32aa9",
      "key": "9ca8b121-5543-4629-b53d-087d650ad17a"
    },
    "payeeID": "5afd571bfb887d13c5f32aa5",
    "percentageShare": 2
  }
}

created rule id

{
  "ID": "5afd5880fb887d13c5f32aac"
}

/receivables/rules/{objectID} Confirm a rule in our favour

ObjectID: 5afd5880fb887d13c5f32aac

{
  "key": "768f07ca-5006-475f-812a-46be3cba88e8",
  "ID": "5afd571bfb887d13c5f32aa5"
}

Response code Code 200

{
   "_id" : ObjectId("5afd5880fb887d13c5f32aac"),
   "UserID" : "79a26d981246978135edadf1",
   "LastUpdate" : ISODate("2018-05-17T10:34:30.131Z"),
   "Trigger" : {
       "Stage" : "paymentComplete",
       "Type" : "ruleIdInRtp"
   },
   "Rule" : {
       "PayeeID" : "5afd571bfb887d13c5f32aa5",
       "PercentageShare" : 2,
       "PayerInstrument" : {
           "_id" : ObjectId("5afd5759fb887d13c5f32aa9"),
           "AccountType" : "Credit/Debit Payment Card",
           "ReceivingAccount" : 0,
           "PaymentsAccount" : 1,
           "CreditDebitCardInfo" : {
               "CardPANEncrypted" : "3::993f7cc9b0d92aace06ee198cbb9491220241faee0186ee42d59c8cd6e63ce59521e07914466daad3ea07f3d8a5a625d070032c3e25c865487c2db7c682cba8822b4c1f7e1728cda54e7fb2578fe5871",
               "CardExpiryEncrypted" : "3::5b0b083cb527fcb0948b48a6a2fd17d99703cb9ce8af3e0b5479fa8020422aae97c1b0b0ae2ac29a068066d7236b5959653396fedc329f25446c2121a575de76",
               "CardValidFromEncrypted" : "3::aa50a37353fd5a6360cf8f2c42a9d0010824a022f564f708c46d6a7a2e7978c2053a23de5a4101b6947c576800be29ac7289f984d9f94cfcf1a49cacd8d5a45c",
               "IssueNumberEncrypted" : "3::1570a87022f074b0920dce5c38038740d8c33960c8fea69854a44384dbd924e127eb06366fc864e0cb7325e5622763676d24b13f5455bf7337a45f0aec33c3fd",
               "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::2d9cb94eea114811464269fce613fa9c2176fa8e742d059ff889367a275852811d02a6a126703ead7dbe6dcacebe60e9aa60613a3858a24540862e1aeef5e57c763c48af749e359c24406eac01b78270945530325bb96f203ee6e0549ea3fb76",
               "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": "5afd571bfb887d13c5f32aa5",
    "percentageShare": 2
  }
}

created rule id

{
  "ID": "5afd5e0afb887d13c5f32ab2"
}

/receivables/rules/{objectID} Confirm a rule in our favour

ObjectID: 5afd5e0afb887d13c5f32ab2

{
  "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": "5afd571bfb887d13c5f32aa5",
    "percentageShare": 2
  }
}

Results:

{
  "ID": "5afd761c59ab4014b6179d58"
}

Try to confirm the rule with someone elses instrument details

ObjectID: 5afd761c59ab4014b6179d58

{
  "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": "5afd5e0afb887d13c5f32ab2"
}

/receivables/rules/{objectID} Confirm a rule in our favour

ObjectID: 5afd5e0afb887d13c5f32ab2

{
  "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

Payee Account


{
  "description": "Alaska-Zinc Inc. account.",
  "receivingAccountServiceKey": "T_S_7c8551db-2aa0-489d-b80e-d1a8d42e4bfb"
}

{ "key": "55c2de8e-ef07-4232-903c-efc67041261c", "ID": "5afd78c059ab4014b6179d61" }

Create a rule for this payee account

{ "trigger": { "stage": "paymentComplete", "type": "ruleIdInRtp" }, "rule": { "payerInstrument": { "ID": "5afd5759fb887d13c5f32aa9", "key": "9ca8b121-5543-4629-b53d-087d650ad17a" }, "payeeID": "5afd78c059ab4014b6179d61", "percentageShare": 2 } }

results:

{ "ID": "5afd78f459ab4014b6179d64" }

Try to confirm with a different payee account

Using Silver Carpenter account:

created world pay

{
  "key": "768f07ca-5006-475f-812a-46be3cba88e8",
  "ID": "5afd571bfb887d13c5f32aa5"
}

ObjectID: 5afd78f459ab4014b6179d64

{ "key": "768f07ca-5006-475f-812a-46be3cba88e8", "ID": "5afd571bfb887d13c5f32aa5" }

{ "trigger": { "stage": "paymentComplete", "type": "ruleIdInRtp" }, "rule": { "payerInstrument": { "ID": "5afd5759fb887d13c5f32aa9", "key": "9ca8b121-5543-4629-b53d-087d650ad17a" }, "payeeID": "5afd571bfb887d13c5f32aa5", "percentageShare": 2 } }

{ "ID": "5afd79ff59ab4014b6179d68" }

Re autorize Bearer YTM2ZGQ1NzUtOWFmNS01MjMyLTg5MjYtM2NkZjA5ZDU2ZGU2

Use worldpay account created in step 3

{ "key": "9de916f0-70f0-4199-88ab-14fd4375d9bc", "ID": "5afd749f59ab4014b6179d55" }