1+ @base @shared
2+ Feature : Merchants
3+
4+ Background :
5+
6+ Given the following security roles exist
7+ | Role Name |
8+ | Merchant |
9+
10+ Given I create the following api scopes
11+ | Name | DisplayName | Description |
12+ | estateManagement | Estate Managememt REST Scope | A scope for Estate Managememt REST |
13+ | transactionProcessor | Transaction Processor REST Scope | A scope for Transaction Processor REST |
14+ | transactionProcessorACL | Transaction Processor ACL REST Scope | A scope for Transaction Processor ACL REST |
15+
16+ Given the following api resources exist
17+ | Name | DisplayName | Secret | Scopes | UserClaims |
18+ | estateManagement | Estate Managememt REST | Secret1 | estateManagement | merchantId , estateId , role |
19+ | transactionProcessor | Transaction Processor REST | Secret1 | transactionProcessor | |
20+ | transactionProcessorACL | Transaction Processor ACL REST | Secret1 | transactionProcessorACL | merchantId , estateId , role |
21+
22+ Given the following clients exist
23+ | ClientId | ClientName | Secret | Scopes | GrantTypes |
24+ | serviceClient | Service Client | Secret1 | estateManagement ,transactionProcessor ,transactionProcessorACL | client_credentials |
25+ | merchantClient | Merchant Client | Secret1 | transactionProcessorACL | password |
26+
27+ Given I have a token to access the estate management and transaction processor acl resources
28+ | ClientId |
29+ | serviceClient |
30+
31+ Given I have created the following estates
32+ | EstateName |
33+ | Test Estate 1 |
34+ | Test Estate 2 |
35+
36+ Given I have created the following operators
37+ | EstateName | OperatorName | RequireCustomMerchantNumber | RequireCustomTerminalNumber |
38+ | Test Estate 1 | Safaricom | True | True |
39+ | Test Estate 1 | Voucher | True | True |
40+ | Test Estate 2 | Safaricom | True | True |
41+ | Test Estate 2 | Voucher | True | True |
42+
43+ And I have assigned the following operators to the estates
44+ | EstateName | OperatorName |
45+ | Test Estate 1 | Safaricom |
46+ | Test Estate 1 | Voucher |
47+ | Test Estate 2 | Safaricom |
48+ | Test Estate 2 | Voucher |
49+
50+ Given I create the following merchants
51+ | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress | EstateName |
52+ | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1 @merchant1 .co .uk | Test Estate 1 |
53+ | Test Merchant 2 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 2 | testcontact2 @merchant2 .co .uk | Test Estate 1 |
54+ | Test Merchant 3 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 3 | testcontact3 @merchant2 .co .uk | Test Estate 2 |
55+
56+ Given I have assigned the following operator to the merchants
57+ | OperatorName | MerchantName | MerchantNumber | TerminalNumber | EstateName |
58+ | Safaricom | Test Merchant 1 | 00000001 | 10000001 | Test Estate 1 |
59+ | Voucher | Test Merchant 1 | 00000001 | 10000001 | Test Estate 1 |
60+ | Safaricom | Test Merchant 2 | 00000002 | 10000002 | Test Estate 1 |
61+ | Voucher | Test Merchant 2 | 00000002 | 10000002 | Test Estate 1 |
62+ | Safaricom | Test Merchant 3 | 00000003 | 10000003 | Test Estate 2 |
63+ | Voucher | Test Merchant 3 | 00000003 | 10000003 | Test Estate 2 |
64+
65+ Given I have created the following security users
66+ | EmailAddress | Password | GivenName | FamilyName | EstateName | MerchantName |
67+ | merchantuser @testmerchant1 .co .uk | 123456 | TestMerchant | User1 | Test Estate 1 | Test Merchant 1 |
68+ | merchantuser @testmerchant2 .co .uk | 123456 | TestMerchant | User2 | Test Estate 1 | Test Merchant 2 |
69+ | merchantuser @testmerchant3 .co .uk | 123456 | TestMerchant | User3 | Test Estate 2 | Test Merchant 3 |
70+
71+ Given I create a contract with the following values
72+ | EstateName | OperatorName | ContractDescription |
73+ | Test Estate 1 | Safaricom | Safaricom Contract |
74+ | Test Estate 1 | Voucher | Hospital 1 Contract |
75+ | Test Estate 2 | Safaricom | Safaricom Contract |
76+ | Test Estate 2 | Voucher | Hospital 1 Contract |
77+
78+ When I create the following Products
79+ | EstateName | OperatorName | ContractDescription | ProductName | DisplayText | Value | ProductType |
80+ | Test Estate 1 | Safaricom | Safaricom Contract | Variable Topup | Custom | | MobileTopup |
81+ | Test Estate 1 | Voucher | Hospital 1 Contract | 10 KES | 10 KES | | Voucher |
82+ | Test Estate 2 | Safaricom | Safaricom Contract | Variable Topup | Custom | | MobileTopup |
83+ | Test Estate 2 | Voucher | Hospital 1 Contract | 10 KES | 10 KES | | Voucher |
84+
85+ When I add the following Transaction Fees
86+ | EstateName | OperatorName | ContractDescription | ProductName | CalculationType | FeeDescription | Value |
87+ | Test Estate 1 | Safaricom | Safaricom Contract | Variable Topup | Fixed | Merchant Commission | 2 .50 |
88+ | Test Estate 2 | Safaricom | Safaricom Contract | Variable Topup | Percentage | Merchant Commission | 0 .85 |
89+
90+ When I add the following contracts to the following merchants
91+ | EstateName | MerchantName | ContractDescription |
92+ | Test Estate 1 | Test Merchant 1 | Safaricom Contract |
93+ | Test Estate 1 | Test Merchant 1 | Hospital 1 Contract |
94+ | Test Estate 1 | Test Merchant 2 | Safaricom Contract |
95+ | Test Estate 1 | Test Merchant 2 | Hospital 1 Contract |
96+ | Test Estate 2 | Test Merchant 3 | Safaricom Contract |
97+ | Test Estate 2 | Test Merchant 3 | Hospital 1 Contract |
98+
99+
100+ Scenario : Get Merchant
101+ Given I am logged in as
"[email protected] " with password
"123456" for Merchant
"Test Merchant 1" for Estate
"Test Estate 1" with client
"merchantClient" 102+ When I get the merchant information for Merchant "Test Merchant 1" for Estate "Test Estate 1" the response should contain the following information
103+ | MerchantName | AddressLine1 | Town | Region | Country | ContactName | EmailAddress |
104+ | Test Merchant 1 | Address Line 1 | TestTown | Test Region | United Kingdom | Test Contact 1 | testcontact1 @merchant1 .co .uk |
105+
106+ Scenario : Get Merchant Contracts
107+ Given I am logged in as
"[email protected] " with password
"123456" for Merchant
"Test Merchant 1" for Estate
"Test Estate 1" with client
"merchantClient" 108+ When I get the merchant contract information for Merchant "Test Merchant 1" for Estate "Test Estate 1" the response should contain the following information
109+ | MerchantName | ContractDescription |
110+ | Test Merchant 1 | Safaricom Contract |
111+ | Test Merchant 1 | Hospital 1 Contract |
0 commit comments