adyen-ruby-api-library 6.3.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/Makefile +72 -0
  4. data/README.md +20 -18
  5. data/lib/adyen/client.rb +66 -38
  6. data/lib/adyen/services/balanceControlService.rb +28 -0
  7. data/lib/adyen/services/balancePlatform/account_holders_api.rb +63 -0
  8. data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +123 -0
  9. data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +27 -0
  10. data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +27 -0
  11. data/lib/adyen/services/balancePlatform/grant_offers_api.rb +39 -0
  12. data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +51 -0
  13. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +75 -0
  14. data/lib/adyen/services/balancePlatform/platform_api.rb +39 -0
  15. data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +63 -0
  16. data/lib/adyen/services/balancePlatform.rb +61 -0
  17. data/lib/adyen/services/binLookup.rb +40 -0
  18. data/lib/adyen/services/checkout/classic_checkout_sdk_api.rb +39 -0
  19. data/lib/adyen/services/checkout/modifications_api.rb +87 -0
  20. data/lib/adyen/services/checkout/orders_api.rb +51 -0
  21. data/lib/adyen/services/checkout/payment_links_api.rb +51 -0
  22. data/lib/adyen/services/checkout/payments_api.rb +87 -0
  23. data/lib/adyen/services/checkout/recurring_api.rb +39 -0
  24. data/lib/adyen/services/checkout/utility_api.rb +39 -0
  25. data/lib/adyen/services/checkout.rb +38 -211
  26. data/lib/adyen/services/dataProtection.rb +28 -0
  27. data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +63 -0
  28. data/lib/adyen/services/legalEntityManagement/documents_api.rb +63 -0
  29. data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +51 -0
  30. data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +75 -0
  31. data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +63 -0
  32. data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +51 -0
  33. data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +63 -0
  34. data/lib/adyen/services/legalEntityManagement.rb +51 -0
  35. data/lib/adyen/services/management/account_company_level_api.rb +51 -0
  36. data/lib/adyen/services/management/account_merchant_level_api.rb +63 -0
  37. data/lib/adyen/services/management/account_store_level_api.rb +111 -0
  38. data/lib/adyen/services/management/allowed_origins_company_level_api.rb +63 -0
  39. data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +63 -0
  40. data/lib/adyen/services/management/api_credentials_company_level_api.rb +63 -0
  41. data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +63 -0
  42. data/lib/adyen/services/management/api_key_company_level_api.rb +27 -0
  43. data/lib/adyen/services/management/api_key_merchant_level_api.rb +27 -0
  44. data/lib/adyen/services/management/client_key_company_level_api.rb +27 -0
  45. data/lib/adyen/services/management/client_key_merchant_level_api.rb +27 -0
  46. data/lib/adyen/services/management/my_api_credential_api.rb +75 -0
  47. data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +87 -0
  48. data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +75 -0
  49. data/lib/adyen/services/management/terminal_actions_company_level_api.rb +63 -0
  50. data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +27 -0
  51. data/lib/adyen/services/management/terminal_orders_company_level_api.rb +135 -0
  52. data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +135 -0
  53. data/lib/adyen/services/management/terminal_settings_company_level_api.rb +63 -0
  54. data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +63 -0
  55. data/lib/adyen/services/management/terminal_settings_store_level_api.rb +111 -0
  56. data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +63 -0
  57. data/lib/adyen/services/management/terminals_terminal_level_api.rb +27 -0
  58. data/lib/adyen/services/management/users_company_level_api.rb +63 -0
  59. data/lib/adyen/services/management/users_merchant_level_api.rb +63 -0
  60. data/lib/adyen/services/management/webhooks_company_level_api.rb +99 -0
  61. data/lib/adyen/services/management/webhooks_merchant_level_api.rb +99 -0
  62. data/lib/adyen/services/management.rb +151 -0
  63. data/lib/adyen/services/payment.rb +172 -0
  64. data/lib/adyen/services/payout/initialization_api.rb +51 -0
  65. data/lib/adyen/services/payout/instant_payouts_api.rb +27 -0
  66. data/lib/adyen/services/payout/reviewing_api.rb +39 -0
  67. data/lib/adyen/services/payout.rb +31 -0
  68. data/lib/adyen/services/posTerminalManagement.rb +76 -0
  69. data/lib/adyen/services/recurring.rb +81 -13
  70. data/lib/adyen/services/service.rb +2 -2
  71. data/lib/adyen/services/storedValue.rb +88 -0
  72. data/lib/adyen/services/transfers/transactions_api.rb +39 -0
  73. data/lib/adyen/services/transfers/transfers_api.rb +27 -0
  74. data/lib/adyen/services/transfers.rb +26 -0
  75. data/lib/adyen/version.rb +1 -1
  76. data/lib/adyen-ruby-api-library.rb +11 -5
  77. data/spec/account_spec.rb +1 -1
  78. data/spec/balance_control_spec.rb +44 -0
  79. data/spec/balance_platform_spec.rb +123 -0
  80. data/spec/bin_lookup_spec.rb +68 -10
  81. data/spec/checkout_spec.rb +39 -66
  82. data/spec/client_spec.rb +88 -9
  83. data/spec/fund_spec.rb +1 -1
  84. data/spec/hop_spec.rb +1 -1
  85. data/spec/lem_spec.rb +68 -0
  86. data/spec/management_spec.rb +68 -0
  87. data/spec/mocks/requests/BalanceControl/balance_transfer.json +10 -0
  88. data/spec/mocks/requests/BalancePlatform/create_account_holder.json +5 -0
  89. data/spec/mocks/requests/BalancePlatform/update_account_holder.json +10 -0
  90. data/spec/mocks/requests/LegalEntityManagement/create_business_line.json +15 -0
  91. data/spec/mocks/requests/Management/create_store.json +15 -0
  92. data/spec/mocks/requests/Recurring/create_permit.json +6 -0
  93. data/spec/mocks/requests/StoredValue/issue_giftcard.json +12 -0
  94. data/spec/mocks/requests/Transfers/get_transactions.json +82 -0
  95. data/spec/mocks/requests/Transfers/make_transfer.json +32 -0
  96. data/spec/mocks/responses/BalanceControl/balance_transfer.json +14 -0
  97. data/spec/mocks/responses/BalancePlatform/create_account_holder.json +41 -0
  98. data/spec/mocks/responses/BalancePlatform/get_balance_account.json +15 -0
  99. data/spec/mocks/responses/BalancePlatform/update_account_holder.json +16 -0
  100. data/spec/mocks/responses/LegalEntityManagement/create_business_line.json +17 -0
  101. data/spec/mocks/responses/Management/create_store.json +23 -0
  102. data/spec/mocks/responses/Management/get_companies.json +42 -0
  103. data/spec/mocks/responses/Recurring/create_permit.json +4 -0
  104. data/spec/mocks/responses/StoredValue/issue_giftcard.json +13 -0
  105. data/spec/mocks/responses/Transfers/get_transactions.json +82 -0
  106. data/spec/mocks/responses/Transfers/make_transfer.json +36 -0
  107. data/spec/notification_spec.rb +1 -1
  108. data/spec/payments_spec.rb +41 -23
  109. data/spec/payouts_spec.rb +43 -16
  110. data/spec/pos_terminal_management_spec.rb +46 -0
  111. data/spec/recurring_spec.rb +2 -2
  112. data/spec/spec_helper.rb +0 -10
  113. data/spec/stored_value_spec.rb +43 -0
  114. data/spec/transfers_spec.rb +63 -0
  115. data/templates/api-single.mustache +29 -0
  116. data/templates/api-small.mustache +37 -0
  117. data/templates/api.mustache +36 -0
  118. data/templates/config.yaml +10 -0
  119. metadata +101 -11
  120. data/lib/adyen/services/bin_lookup.rb +0 -18
  121. data/lib/adyen/services/data_protection.rb +0 -17
  122. data/lib/adyen/services/payments.rb +0 -34
  123. data/lib/adyen/services/payouts.rb +0 -22
  124. data/lib/adyen/services/postfmapi.rb +0 -19
  125. data/spec/mocks/requests/Recurring/store_token.json +0 -15
  126. data/spec/mocks/responses/Recurring/store_token.json +0 -7
  127. data/spec/postfmapi_spec.rb +0 -16
@@ -0,0 +1,82 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "accountHolderId": "AHA1B2C3D4E5F6G7H8I9J0",
5
+ "amount": {
6
+ "currency": "EUR",
7
+ "value": -9
8
+ },
9
+ "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4",
10
+ "balancePlatform": "YOUR_BALANCE_PLATFORM",
11
+ "bookingDate": "2022-03-11T11:21:24+01:00",
12
+ "category": "internal",
13
+ "counterparty": {
14
+ "balanceAccountId": "BA00000000000000000000001"
15
+ },
16
+ "createdAt": "2022-03-11T11:21:24+01:00",
17
+ "id": "1VVF0D5U66PIUIVP",
18
+ "instructedAmount": {
19
+ "currency": "EUR",
20
+ "value": -9
21
+ },
22
+ "reference": "REFERENCE_46e8c40e",
23
+ "status": "booked",
24
+ "transferId": "1VVF0D5U66PIUIVP",
25
+ "type": "fee",
26
+ "valueDate": "2022-03-11T11:21:24+01:00"
27
+ },
28
+ {
29
+ "accountHolderId": "AHA1B2C3D4E5F6G7H8I9J0",
30
+ "amount": {
31
+ "currency": "EUR",
32
+ "value": -46
33
+ },
34
+ "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4",
35
+ "balancePlatform": "YOUR_BALANCE_PLATFORM",
36
+ "bookingDate": "2022-03-12T14:22:52+01:00",
37
+ "category": "internal",
38
+ "counterparty": {
39
+ "balanceAccountId": "BA00000000000000000000001"
40
+ },
41
+ "createdAt": "2022-03-12T14:22:52+01:00",
42
+ "id": "1WEPGD5U6MS1CFK3",
43
+ "instructedAmount": {
44
+ "currency": "EUR",
45
+ "value": -46
46
+ },
47
+ "reference": "YOUR_REFERENCE",
48
+ "status": "booked",
49
+ "transferId": "1WEPGD5U6MS1CFK3",
50
+ "type": "fee",
51
+ "valueDate": "2022-03-12T14:22:52+01:00"
52
+ },
53
+ {
54
+ "accountHolderId": "AHA1B2C3D4E5F6G7H8I9J0",
55
+ "amount": {
56
+ "currency": "EUR",
57
+ "value": -8
58
+ },
59
+ "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4",
60
+ "balancePlatform": "YOUR_BALANCE_PLATFORM",
61
+ "bookingDate": "2022-03-14T21:00:48+01:00",
62
+ "createdAt": "2022-03-14T15:00:00+01:00",
63
+ "description": "YOUR_DESCRIPTION_2",
64
+ "id": "2QP32A5U7IWC5WKG",
65
+ "counterparty": {
66
+ "balanceAccountId": "BA00000000000000000000001"
67
+ },
68
+ "reference": "REFERENCE_46e8c40e",
69
+ "instructedAmount": {
70
+ "currency": "EUR",
71
+ "value": -8
72
+ },
73
+ "status": "booked",
74
+ "valueDate": "2022-03-14T21:00:48+01:00"
75
+ }
76
+ ],
77
+ "_links": {
78
+ "next": {
79
+ "href": "https://balanceplatform-api-test.adyen.com/btl/v2/transactions?balancePlatform=Bastronaut&createdUntil=2022-03-21T00%3A00%3A00Z&createdSince=2022-03-11T00%3A00%3A00Z&limit=3&cursor=S2B-TSAjOkIrYlIlbjdqe0RreHRyM32lKRSxubXBHRkhHL2E32XitQQz5SfzpucD5HbHwpM1p6NDR1eXVQLFF6MmY33J32sobDxQYT90MHIud1hwLnd6JitcX32xJ"
80
+ }
81
+ }
82
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "amount": {
3
+ "value": 110000,
4
+ "currency": "EUR"
5
+ },
6
+ "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4",
7
+ "category": "bank",
8
+ "counterparty": {
9
+ "bankAccount": {
10
+ "accountHolder": {
11
+ "fullName": "A. Klaassen",
12
+ "address": {
13
+ "city": "San Francisco",
14
+ "country": "US",
15
+ "postalCode": "94678",
16
+ "stateOrProvince": "CA",
17
+ "street": "Brannan Street",
18
+ "street2": "274"
19
+ }
20
+ },
21
+ "accountIdentification": {
22
+ "type": "numberAndBic",
23
+ "accountNumber": "123456789",
24
+ "bic": "BOFAUS3NXXX"
25
+ }
26
+ }
27
+ },
28
+ "priority": "crossBorder",
29
+ "referenceForBeneficiary": "Your-reference-sent-to-the-beneficiary",
30
+ "reference": "Your internal reference for the transfer",
31
+ "description": "Your description for the transfer"
32
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "amount": {
3
+ "value": 50000,
4
+ "currency": "EUR"
5
+ },
6
+ "createdAt": "2022-01-24T14:59:11+01:00",
7
+ "description": "Your description for the transfer",
8
+ "fromMerchant": "MerchantAccount_NL",
9
+ "toMerchant": "MerchantAccount_DE",
10
+ "type": "debit",
11
+ "reference": "Unique reference for the transfer",
12
+ "pspReference": "8816080397613514",
13
+ "status": "transferred"
14
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "balancePlatform": "YOUR_BALANCE_PLATFORM",
3
+ "description": "Liable account holder used for international payments and payouts",
4
+ "legalEntityId": "LE322JV223222D5GG42KN6869",
5
+ "reference": "S.Eller-001",
6
+ "capabilities": {
7
+ "receiveFromPlatformPayments": {
8
+ "enabled": true,
9
+ "requested": true,
10
+ "allowed": false,
11
+ "verificationStatus": "pending"
12
+ },
13
+ "receiveFromBalanceAccount": {
14
+ "enabled": true,
15
+ "requested": true,
16
+ "allowed": false,
17
+ "verificationStatus": "pending"
18
+ },
19
+ "sendToBalanceAccount": {
20
+ "enabled": true,
21
+ "requested": true,
22
+ "allowed": false,
23
+ "verificationStatus": "pending"
24
+ },
25
+ "sendToTransferInstrument": {
26
+ "enabled": true,
27
+ "requested": true,
28
+ "allowed": false,
29
+ "requestedSettings": {
30
+ "interval": "daily",
31
+ "maxAmount": {
32
+ "currency": "EUR",
33
+ "value": 0
34
+ }
35
+ },
36
+ "verificationStatus": "pending"
37
+ }
38
+ },
39
+ "id": "AH32272223222G5HNCR9S3M5Z",
40
+ "status": "active"
41
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "accountHolderId": "AH32272223222B59K6RTQBFNZ",
3
+ "defaultCurrencyCode": "EUR",
4
+ "timeZone": "Europe/Amsterdam",
5
+ "balances": [
6
+ {
7
+ "available": 0,
8
+ "balance": 0,
9
+ "currency": "EUR",
10
+ "reserved": 0
11
+ }
12
+ ],
13
+ "id": "BA3227C223222B5BLP6JQC3FD",
14
+ "status": "active"
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "balancePlatform": "YOUR_BALANCE_PLATFORM",
3
+ "description": "Liable account holder used for international payments and payouts",
4
+ "legalEntityId": "LE322JV223222F5GKQZZ9DS99",
5
+ "reference": "S.Eller-001",
6
+ "capabilities": {
7
+ "receivePayments": {
8
+ "enabled": false,
9
+ "requested": true,
10
+ "allowed": false,
11
+ "verificationStatus": "pending"
12
+ }
13
+ },
14
+ "id": "AH3227C223222C5GKR23686TF",
15
+ "status": "active"
16
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "industryCode": "4531",
3
+ "legalEntityId": "YOUR_LEGAL_ENTITY",
4
+ "service": "banking",
5
+ "sourceOfFunds": {
6
+ "adyenProcessedFunds": false,
7
+ "description": "Funds from my flower shop business",
8
+ "type": "business"
9
+ },
10
+ "webData": [
11
+ {
12
+ "webAddress": "https://www.adyen.com",
13
+ "webAddressId": "SE322KH223222N5HN4HP54PZC"
14
+ }
15
+ ],
16
+ "id": "SE322KH223222N5HN4HP54PXD"
17
+ }
@@ -0,0 +1,23 @@
1
+ {
2
+ "id": "YOUR_STORE_ID",
3
+ "address": {
4
+ "country": "US",
5
+ "line1": "200 Main Street",
6
+ "line2": "Building 5A",
7
+ "line3": "Suite 3",
8
+ "city": "Springfield",
9
+ "stateOrProvince": "NY",
10
+ "postalCode": "20250"
11
+ },
12
+ "description": "City centre store",
13
+ "merchantId": "YOUR_MERCHANT_ACCOUNT_ID",
14
+ "shopperStatement": "Springfield Shop",
15
+ "phoneNumber": "1813702551707653",
16
+ "reference": "Spring_store_2",
17
+ "status": "active",
18
+ "_links": {
19
+ "self": {
20
+ "href": "https://management-test.adyen.com/v1/stores/YOUR_STORE_ID"
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "_links": {
3
+ "first": {
4
+ "href": "https://management-test.adyen.com/v1/companies?pageNumber=1&pageSize=10"
5
+ },
6
+ "last": {
7
+ "href": "https://management-test.adyen.com/v1/companies?pageNumber=1&pageSize=10"
8
+ },
9
+ "self": {
10
+ "href": "https://management-test.adyen.com/v1/companies?pageNumber=1&pageSize=10"
11
+ }
12
+ },
13
+ "itemsTotal": 1,
14
+ "pagesTotal": 1,
15
+ "data": [
16
+ {
17
+ "id": "YOUR_COMPANY_ACCOUNT",
18
+ "name": "YOUR_COMPANY_NAME",
19
+ "status": "Active",
20
+ "dataCenters": [
21
+ {
22
+ "name": "default",
23
+ "livePrefix": ""
24
+ }
25
+ ],
26
+ "_links": {
27
+ "self": {
28
+ "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT"
29
+ },
30
+ "apiCredentials": {
31
+ "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/apiCredentials"
32
+ },
33
+ "users": {
34
+ "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/users"
35
+ },
36
+ "webhooks": {
37
+ "href": "https://management-test.adyen.com/v1/companies/YOUR_COMPANY_ACCOUNT/webhooks"
38
+ }
39
+ }
40
+ }
41
+ ]
42
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "pspReference": "8815260599791117",
3
+ "permitResultList": [{"yadayada": "yadayada"}]
4
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "currentBalance": {
3
+ "currency": "EUR",
4
+ "value": 1000
5
+ },
6
+ "pspReference": "851564651069192J",
7
+ "resultCode": "Success",
8
+ "paymentMethod": {
9
+ "number": "7219627091701347",
10
+ "securityCode": "0140",
11
+ "type": "givex"
12
+ }
13
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "accountHolderId": "AHA1B2C3D4E5F6G7H8I9J0",
5
+ "amount": {
6
+ "currency": "EUR",
7
+ "value": -9
8
+ },
9
+ "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4",
10
+ "balancePlatform": "YOUR_BALANCE_PLATFORM",
11
+ "bookingDate": "2022-03-11T11:21:24+01:00",
12
+ "category": "internal",
13
+ "counterparty": {
14
+ "balanceAccountId": "BA00000000000000000000001"
15
+ },
16
+ "createdAt": "2022-03-11T11:21:24+01:00",
17
+ "id": "1VVF0D5U66PIUIVP",
18
+ "instructedAmount": {
19
+ "currency": "EUR",
20
+ "value": -9
21
+ },
22
+ "reference": "REFERENCE_46e8c40e",
23
+ "status": "booked",
24
+ "transferId": "1VVF0D5U66PIUIVP",
25
+ "type": "fee",
26
+ "valueDate": "2022-03-11T11:21:24+01:00"
27
+ },
28
+ {
29
+ "accountHolderId": "AHA1B2C3D4E5F6G7H8I9J0",
30
+ "amount": {
31
+ "currency": "EUR",
32
+ "value": -46
33
+ },
34
+ "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4",
35
+ "balancePlatform": "YOUR_BALANCE_PLATFORM",
36
+ "bookingDate": "2022-03-12T14:22:52+01:00",
37
+ "category": "internal",
38
+ "counterparty": {
39
+ "balanceAccountId": "BA00000000000000000000001"
40
+ },
41
+ "createdAt": "2022-03-12T14:22:52+01:00",
42
+ "id": "1WEPGD5U6MS1CFK3",
43
+ "instructedAmount": {
44
+ "currency": "EUR",
45
+ "value": -46
46
+ },
47
+ "reference": "YOUR_REFERENCE",
48
+ "status": "booked",
49
+ "transferId": "1WEPGD5U6MS1CFK3",
50
+ "type": "fee",
51
+ "valueDate": "2022-03-12T14:22:52+01:00"
52
+ },
53
+ {
54
+ "accountHolderId": "AHA1B2C3D4E5F6G7H8I9J0",
55
+ "amount": {
56
+ "currency": "EUR",
57
+ "value": -8
58
+ },
59
+ "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4",
60
+ "balancePlatform": "YOUR_BALANCE_PLATFORM",
61
+ "bookingDate": "2022-03-14T21:00:48+01:00",
62
+ "createdAt": "2022-03-14T15:00:00+01:00",
63
+ "description": "YOUR_DESCRIPTION_2",
64
+ "id": "2QP32A5U7IWC5WKG",
65
+ "counterparty": {
66
+ "balanceAccountId": "BA00000000000000000000001"
67
+ },
68
+ "reference": "REFERENCE_46e8c40e",
69
+ "instructedAmount": {
70
+ "currency": "EUR",
71
+ "value": -8
72
+ },
73
+ "status": "booked",
74
+ "valueDate": "2022-03-14T21:00:48+01:00"
75
+ }
76
+ ],
77
+ "_links": {
78
+ "next": {
79
+ "href": "https://balanceplatform-api-test.adyen.com/btl/v2/transactions?balancePlatform=Bastronaut&createdUntil=2022-03-21T00%3A00%3A00Z&createdSince=2022-03-11T00%3A00%3A00Z&limit=3&cursor=S2B-TSAjOkIrYlIlbjdqe0RreHRyM32lKRSxubXBHRkhHL2E32XitQQz5SfzpucD5HbHwpM1p6NDR1eXVQLFF6MmY33J32sobDxQYT90MHIud1hwLnd6JitcX32xJ"
80
+ }
81
+ }
82
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "id": "1W1UG35U8A9J5ZLG",
3
+ "amount": {
4
+ "value": 110000,
5
+ "currency": "EUR"
6
+ },
7
+ "balanceAccountId": "BAB8B2C3D4E5F6G7H8D9J6GD4",
8
+ "category": "bank",
9
+ "counterparty": {
10
+ "bankAccount": {
11
+ "accountHolder": {
12
+ "fullName": "A. Klaassen",
13
+ "address": {
14
+ "city": "San Francisco",
15
+ "country": "US",
16
+ "postalCode": "94678",
17
+ "stateOrProvince": "CA",
18
+ "street": "Brannan Street",
19
+ "street2": "274"
20
+ }
21
+ },
22
+ "accountIdentification": {
23
+ "type": "numberAndBic",
24
+ "accountNumber": "123456789",
25
+ "bic": "BOFAUS3NXXX"
26
+ }
27
+ },
28
+ "priority": "crossBorder",
29
+ "referenceForBeneficiary": "Your-reference-sent-to-the-beneficiary",
30
+ "reference": "Your internal reference for the transfer",
31
+ "description": "Your description for the transfer",
32
+ "direction": "outgoing",
33
+ "reason": "approved",
34
+ "status": "authorised"
35
+ }
36
+ }
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Adyen::Payments, service: "marketpay fund service" do
3
+ RSpec.describe Adyen::Payment, service: "marketpay fund service" do
4
4
  # client instance to be used in dynamically generated tests
5
5
  client = create_client(:basic)
6
6
 
@@ -1,26 +1,44 @@
1
1
  require "spec_helper"
2
+ require "json"
3
+
4
+ RSpec.describe Adyen::Payment, service: "Payment" do
5
+ before(:all) do
6
+ @shared_values = {
7
+ client: create_client(:api_key),
8
+ service: "Payment",
9
+ }
10
+ end
11
+
12
+ # must be created manually because every field in the response is an array
13
+ it "makes an adjust_authorisation POST call" do
14
+ request_body = JSON.parse(json_from_file("mocks/requests/Payment/adjust_authorisation.json"))
15
+
16
+ response_body = json_from_file("mocks/responses/Payment/adjust_authorisation.json")
17
+
18
+ url = @shared_values[:client].service_url(@shared_values[:service], "adjustAuthorisation", @shared_values[:client].payment.version)
19
+ WebMock.stub_request(:post, url).
20
+ with(
21
+ body: request_body,
22
+ headers: {
23
+ "x-api-key" => @shared_values[:client].api_key
24
+ }
25
+ ).
26
+ to_return(
27
+ body: response_body
28
+ )
29
+
30
+ result = @shared_values[:client].payment.adjust_authorisation(request_body)
31
+ response_hash = result.response
32
+
33
+ expect(result.status).
34
+ to eq(200)
35
+ expect(response_hash).
36
+ to eq(JSON.parse(response_body))
37
+ expect(response_hash).
38
+ to be_a Adyen::HashWithAccessors
39
+ expect(response_hash).
40
+ to be_a_kind_of Hash
41
+ end
2
42
 
3
- RSpec.describe Adyen::Payments, service: "payments service" do
4
- # client instance to be used in dynamically generated tests
5
- client = create_client(:basic)
6
-
7
- # methods / values to test for
8
- # format is defined in spec_helper
9
- test_sets = [
10
- ["authorise", "resultCode", "Authorised"],
11
- ["adjust_authorisation", "response", "[adjustAuthorisation-received]"],
12
- ["authorise3d", "resultCode", "Authorised"],
13
- ["authorise3ds2", "resultCode", "ChallengeShopper"],
14
- ["cancel", "response", "[cancel-received]"],
15
- ["cancel_or_refund", "response", "[cancelOrRefund-received]"],
16
- ["capture", "response", "[capture-received]"],
17
- ["refund", "response", "[refund-received]"],
18
- ["donate", "response", "[donation-received]"],
19
- ["get_authentication_result", "threeDS2Result", {"transStatus" => "Y"}],
20
- ["retrieve_3ds2_result", "threeDS2Result", {"transStatus" => "Y"}],
21
- ["technical_cancel", "originalReference", "9914694372990637"],
22
- ["void_pending_refund", "pspReference", "9914694372990637"]
23
- ]
24
-
25
- generate_tests(client, "Payment", test_sets, client.payments)
26
43
  end
44
+
data/spec/payouts_spec.rb CHANGED
@@ -1,19 +1,46 @@
1
1
  require "spec_helper"
2
+ require "json"
3
+
4
+ # rubocop:disable Metrics/BlockLength
5
+
6
+ RSpec.describe Adyen::Payout, service: "Payout" do
7
+ before(:all) do
8
+ @shared_values = {
9
+ client: create_client(:api_key),
10
+ service: "Payout",
11
+ }
12
+ end
13
+
14
+ # must be created manually because every field in the response is an array
15
+ it "makes a business_lines POST call" do
16
+ request_body = JSON.parse(json_from_file("mocks/requests/Payout/confirm_third_party.json"))
17
+
18
+ response_body = json_from_file("mocks/responses/Payout/confirm_third_party.json")
19
+
20
+ url = @shared_values[:client].service_url(@shared_values[:service], "confirmThirdParty", @shared_values[:client].payout.version)
21
+ WebMock.stub_request(:post, url).
22
+ with(
23
+ body: request_body,
24
+ headers: {
25
+ "x-api-key" => @shared_values[:client].api_key
26
+ }
27
+ ).
28
+ to_return(
29
+ body: response_body
30
+ )
31
+
32
+ result = @shared_values[:client].payout.reviewing_api.confirm_third_party(request_body)
33
+ response_hash = result.response
34
+
35
+ expect(result.status).
36
+ to eq(200)
37
+ expect(response_hash).
38
+ to eq(JSON.parse(response_body))
39
+ expect(response_hash).
40
+ to be_a Adyen::HashWithAccessors
41
+ expect(response_hash).
42
+ to be_a_kind_of Hash
43
+ end
2
44
 
3
- RSpec.describe Adyen::Payments, service: "payouts service" do
4
- # client instance to be used in dynamically generated tests
5
- client = create_client(:basic)
6
-
7
- # methods / values to test for
8
- # format is defined in spec_helper
9
- test_sets = [
10
- ["store_detail", "resultCode", "Success"],
11
- ["store_detail_and_submit_third_party", "resultCode", "[payout-submit-received]"],
12
- ["submit_third_party", "resultCode", "[payout-submit-received]"],
13
- ["confirm_third_party", "response", "[payout-confirm-received]"],
14
- ["decline_third_party", "response", "[payout-decline-received]"],
15
- ["payout", "resultCode", "Success"]
16
- ]
17
-
18
- generate_tests(client, "Payout", test_sets, client.payouts)
19
45
  end
46
+
@@ -0,0 +1,46 @@
1
+ require "spec_helper"
2
+ require "json"
3
+
4
+ # rubocop:disable Metrics/BlockLength
5
+
6
+ RSpec.describe Adyen::PosTerminalManagement, service: "PosTerminalManagement" do
7
+ before(:all) do
8
+ @shared_values = {
9
+ client: create_client(:api_key),
10
+ service: "LegalEntityManagement",
11
+ }
12
+ end
13
+
14
+ # must be created manually because every field in the response is an array
15
+ it "makes a assign_terminals POST call" do
16
+ request_body = JSON.parse(json_from_file("mocks/requests/Terminal/assign_terminals.json"))
17
+
18
+ response_body = json_from_file("mocks/responses/Terminal/assign_terminals.json")
19
+
20
+ url = @shared_values[:client].service_url(@shared_values[:service], "assignTerminals", @shared_values[:client].pos_terminal_management.version)
21
+ WebMock.stub_request(:post, url).
22
+ with(
23
+ body: request_body,
24
+ headers: {
25
+ "x-api-key" => @shared_values[:client].api_key
26
+ }
27
+ ).
28
+ to_return(
29
+ body: response_body
30
+ )
31
+
32
+ result = @shared_values[:client].pos_terminal_management.assign_terminals(request_body)
33
+ response_hash = result.response
34
+
35
+ expect(result.status).
36
+ to eq(200)
37
+ expect(response_hash).
38
+ to eq(JSON.parse(response_body))
39
+ expect(response_hash).
40
+ to be_a Adyen::HashWithAccessors
41
+ expect(response_hash).
42
+ to be_a_kind_of Hash
43
+ end
44
+
45
+ end
46
+
@@ -1,7 +1,7 @@
1
1
  require "spec_helper"
2
2
  require_relative "../lib/adyen/errors"
3
3
 
4
- RSpec.describe Adyen::Payments, service: "recurring service" do
4
+ RSpec.describe Adyen::Payment, service: "recurring service" do
5
5
  # client instance to be used in dynamically generated tests
6
6
  client = create_client(:basic)
7
7
 
@@ -10,7 +10,7 @@ RSpec.describe Adyen::Payments, service: "recurring service" do
10
10
  test_sets = [
11
11
  ["list_recurring_details", "creationDate", "2017-03-01T11:53:11+01:00"],
12
12
  ["disable", "response", "[detail-successfully-disabled]"],
13
- ["store_token", "result", "Success"],
13
+ ["create_permit", "pspReference", "8815260599791117"],
14
14
  ["schedule_account_updater", "result", "Success"]
15
15
  ]
16
16
 
data/spec/spec_helper.rb CHANGED
@@ -18,16 +18,6 @@ def create_test(client, service, method_name, parent_object)
18
18
  request_body = JSON.parse(json_from_file("mocks/requests/#{service}/#{method_name}.json"))
19
19
  response_body = json_from_file("mocks/responses/#{service}/#{method_name}.json")
20
20
 
21
- with_application_info = [
22
- "authorise",
23
- "authorise3d",
24
- "authorise3ds2",
25
- "payments",
26
- "payment_session",
27
- ]
28
- if with_application_info.include?(method_name)
29
- client.add_application_info(request_body)
30
- end
31
21
 
32
22
  # client-generated headers
33
23
  headers = {