adyen-ruby-api-library 4.0.2 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -1
- data/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +7 -0
- data/.github/dependabot.yml +8 -0
- data/.gitignore +2 -0
- data/README.md +72 -110
- data/lib/adyen-ruby-api-library.rb +4 -12
- data/lib/adyen/client.rb +57 -24
- data/lib/adyen/services/bin_lookup.rb +18 -0
- data/lib/adyen/services/checkout.rb +88 -8
- data/lib/adyen/services/{checkout_utility.rb → data_protection.rb} +4 -3
- data/lib/adyen/services/dispute.rb +20 -0
- data/lib/adyen/services/marketpay.rb +26 -6
- data/lib/adyen/services/payments.rb +15 -5
- data/lib/adyen/services/payouts.rb +3 -2
- data/lib/adyen/services/postfmapi.rb +19 -0
- data/lib/adyen/services/recurring.rb +3 -2
- data/lib/adyen/services/service.rb +2 -2
- data/lib/adyen/version.rb +1 -1
- data/spec/account_spec.rb +3 -1
- data/spec/bin_lookup_spec.rb +15 -0
- data/spec/checkout_spec.rb +247 -5
- data/spec/data_protection_spec.rb +14 -0
- data/spec/dispute_spec.rb +17 -0
- data/spec/fund_spec.rb +2 -1
- data/spec/hop_spec.rb +14 -0
- data/spec/mocks/requests/Account/check_account_holder.json +5 -0
- data/spec/mocks/requests/Account/delete_payout_methods.json +6 -0
- data/spec/mocks/requests/BinLookup/get_3ds_availability.json +4 -0
- data/spec/mocks/requests/BinLookup/get_cost_estimate.json +8 -0
- data/spec/mocks/requests/Checkout/orders.json +6 -0
- data/spec/mocks/requests/Checkout/orders_cancel.json +7 -0
- data/spec/mocks/requests/Checkout/origin_keys.json +3 -0
- data/spec/mocks/requests/Checkout/payment_methods_balance.json +9 -0
- data/spec/mocks/requests/DataProtectionService/request_subject_erasure.json +5 -0
- data/spec/mocks/requests/DisputeService/defend_dispute.json +5 -0
- data/spec/mocks/requests/DisputeService/delete_dispute_defense_document.json +5 -0
- data/spec/mocks/requests/DisputeService/retrieve_applicable_defense_reasons.json +4 -0
- data/spec/mocks/requests/DisputeService/supply_defense_document.json +11 -0
- data/spec/mocks/requests/Fund/refund_funds_transfer.json +7 -0
- data/spec/mocks/requests/Hop/get_onboarding_url.json +4 -0
- data/spec/mocks/requests/Payment/donate.json +10 -0
- data/spec/mocks/requests/Payment/get_authentication_result.json +4 -0
- data/spec/mocks/requests/Payment/retrieve_3ds2_result.json +4 -0
- data/spec/mocks/requests/Payment/technical_cancel.json +4 -0
- data/spec/mocks/requests/Payment/void_pending_refund.json +4 -0
- data/spec/mocks/requests/Payout/payout.json +8 -0
- data/spec/mocks/requests/Recurring/schedule_account_updater.json +12 -0
- data/spec/mocks/requests/Terminal/assign_terminals.json +6 -0
- data/spec/mocks/requests/Terminal/find_terminal.json +3 -0
- data/spec/mocks/requests/Terminal/get_terminals_under_account.json +4 -0
- data/spec/mocks/responses/Account/check_account_holder.json +3 -0
- data/spec/mocks/responses/Account/delete_payout_methods.json +3 -0
- data/spec/mocks/responses/BinLookup/get_3ds_availability.json +8 -0
- data/spec/mocks/responses/BinLookup/get_cost_estimate.json +8 -0
- data/spec/mocks/responses/Checkout/get-payment-link.json +11 -0
- data/spec/mocks/responses/Checkout/orders.json +8 -0
- data/spec/mocks/responses/Checkout/orders_cancel.json +4 -0
- data/spec/mocks/responses/Checkout/origin_keys.json +5 -0
- data/spec/mocks/responses/Checkout/payment_methods_balance.json +3 -0
- data/spec/mocks/responses/Checkout/update-payment-link.json +11 -0
- data/spec/mocks/responses/DataProtectionService/request_subject_erasure.json +3 -0
- data/spec/mocks/responses/DisputeService/defend_dispute.json +5 -0
- data/spec/mocks/responses/DisputeService/delete_dispute_defense_document.json +5 -0
- data/spec/mocks/responses/DisputeService/retrieve_applicable_defense_reasons.json +28 -0
- data/spec/mocks/responses/DisputeService/supply_defense_document.json +5 -0
- data/spec/mocks/responses/Fund/refund_funds_transfer.json +5 -0
- data/spec/mocks/responses/Hop/get_onboarding_url.json +7 -0
- data/spec/mocks/responses/Payment/donate.json +4 -0
- data/spec/mocks/responses/Payment/get_authentication_result.json +5 -0
- data/spec/mocks/responses/Payment/retrieve_3ds2_result.json +5 -0
- data/spec/mocks/responses/Payment/technical_cancel.json +3 -0
- data/spec/mocks/responses/Payment/void_pending_refund.json +3 -0
- data/spec/mocks/responses/Payout/payout.json +3 -0
- data/spec/mocks/responses/Recurring/schedule_account_updater.json +4 -0
- data/spec/mocks/responses/Terminal/assign_terminals.json +5 -0
- data/spec/mocks/responses/Terminal/find_terminal.json +6 -0
- data/spec/mocks/responses/Terminal/get_terminals_under_account.json +11 -0
- data/spec/payments_spec.rb +6 -1
- data/spec/payouts_spec.rb +2 -1
- data/spec/postfmapi_spec.rb +16 -0
- data/spec/recurring_spec.rb +2 -1
- data/spec/service_spec.rb +2 -0
- data/spec/spec_helper.rb +18 -12
- metadata +69 -7
- data/spec/checkout_utility_spec.rb +0 -29
- data/spec/mocks/requests/CheckoutUtility/origin_keys.json +0 -7
- data/spec/mocks/responses/CheckoutUtility/origin_keys.json +0 -7
@@ -0,0 +1,14 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe Adyen::DataProtection, service: "Data Protection 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
|
+
["request_subject_erasure", "result", "SUCCESS"],
|
11
|
+
]
|
12
|
+
|
13
|
+
generate_tests(client, "DataProtectionService", test_sets, client.data_protection)
|
14
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe Adyen::Dispute, service: "dispute 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
|
+
["retrieve_applicable_defense_reasons", "disputeServiceResult", { "success" => true }],
|
11
|
+
["supply_defense_document", "disputeServiceResult", { "success" => true }],
|
12
|
+
["delete_dispute_defense_document", "disputeServiceResult", { "success" => true }],
|
13
|
+
["defend_dispute", "disputeServiceResult", { "success" => true }],
|
14
|
+
]
|
15
|
+
|
16
|
+
generate_tests(client, "DisputeService", test_sets, client.dispute)
|
17
|
+
end
|
data/spec/fund_spec.rb
CHANGED
@@ -12,7 +12,8 @@ RSpec.describe Adyen::Payments, service: "marketpay fund service" do
|
|
12
12
|
["account_holder_transaction_list", "pspReference", "9914721175530029"],
|
13
13
|
["refund_not_paid_out_transfers", "pspReference", "9915090894215323"],
|
14
14
|
["setup_beneficiary", "pspReference", "9914860354282596"],
|
15
|
-
["transfer_funds", "pspReference", "9915090893984580"]
|
15
|
+
["transfer_funds", "pspReference", "9915090893984580"],
|
16
|
+
["refund_funds_transfer", "pspReference", "9915090893984580"]
|
16
17
|
]
|
17
18
|
|
18
19
|
generate_tests(client, "Fund", test_sets, client.marketpay.fund)
|
data/spec/hop_spec.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe Adyen::Payments, service: "marketpay hop 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
|
+
["get_onboarding_url", "pspReference", "8815850625171183"]
|
11
|
+
]
|
12
|
+
|
13
|
+
generate_tests(client, "Hop", test_sets, client.marketpay.hop)
|
14
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
{
|
2
|
+
"defenseDocuments": [
|
3
|
+
{
|
4
|
+
"content": "JVBERi0xLjMKJcTl8uXrp...",
|
5
|
+
"contentType": "application/pdf",
|
6
|
+
"defenseDocumentTypeCode": "MerchandiseDescription"
|
7
|
+
}
|
8
|
+
],
|
9
|
+
"disputePspReference": "9913486733050065",
|
10
|
+
"merchantAccountCode": "YOUR_MERCHANT_ACCOUNT"
|
11
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"card": {
|
3
|
+
"number": "4111111111111111",
|
4
|
+
"expiryMonth": "8",
|
5
|
+
"expiryYear": "2018",
|
6
|
+
"cvc": "737",
|
7
|
+
"holderName": "John Smith"
|
8
|
+
},
|
9
|
+
"reference": "Merchant Reference",
|
10
|
+
"merchantAccount": "TestMerchant",
|
11
|
+
"shopperReference": "shopperReference"
|
12
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
{
|
2
|
+
"defenseReasons": [
|
3
|
+
{
|
4
|
+
"defenseDocumentTypes": [
|
5
|
+
{
|
6
|
+
"available": false,
|
7
|
+
"defenseDocumentTypeCode": "TIDorInvoice",
|
8
|
+
"requirementLevel": "Optional"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"available": false,
|
12
|
+
"defenseDocumentTypeCode": "DefenseMaterial",
|
13
|
+
"requirementLevel": "Required"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"available": false,
|
17
|
+
"defenseDocumentTypeCode": "AlternativeDefenseMaterial",
|
18
|
+
"requirementLevel": "AlternativeRequired"
|
19
|
+
}
|
20
|
+
],
|
21
|
+
"defenseReasonCode": "SupplyDefenseMaterial",
|
22
|
+
"satisfied": false
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"disputeServiceResult": {
|
26
|
+
"success": true
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"pspReference": "8815850625171183",
|
3
|
+
"resultCode": "Success",
|
4
|
+
"submittedAsync": "false",
|
5
|
+
"invalidFields": [],
|
6
|
+
"redirectUrl": "https://hop-test.adyen.com/hop/view/?token=BQABAQANDBQftSiV8pqlYYFRjIZmBIhE3Ls%2FgdLQ3kcTbflt4FDPves0B9kq7aSZUqKwRciwBEN3PX23ZPqGmYXTb7QklLY5YdEXvUdEgtFnJl9uDWK09texQ3djnTPW6JKrok5svw%2FGZyGHqF1NAbuqPPPLF8o5Jzzri8AqyQKig%2BtMmEibuCuZrIvMbJjcINfDk0OBHir8bNjHgMGFiDBOXdkiww%2FB1VXP2MMqSB1yqcXiKL1o%2B12czdB9wJ5wwsQLGlcuE2Z0%2BZNIQL3MdRomkphpkIWBPFN9YmyGS0Wel6trve6ghBl4q4e1C%2B9BMQKc4P0jrC9FrkBZvhtBYoN%2BfUfrEDbgXpXjXYa1tlfU53XoD%2FsAAA1n2PuQSyfTxEf8qpwAcB9oDN%2BrbpwxYwIk42kCGztAQShTwZzx%2B4VifKpjBdtHA4bSHEqOzGPvpQ6bk4viluLn9Ealv0ylf%2FC3w%2BZCmThg8%2B2EIiABmMK8Jbfijl%2FM%2FqE43F0QN9SveJjwkN5IYGra5QbErUdAPDMfDksPjy%2FY8j%2B2XT1kMwSOLbWTCfhP%2FM%2F68Ll50RuhfJOkgfdP%2BfSxbK9i9uAmEsJ980cABWPpB4MH27asGfZ17mCM3TavaiI9d9Gs3X1HIoEZehFKWEhoaGsEaoSBQ6ut6VnZoOCCBsvssg9aqi1LJKpwwWg4CjS9Ygrw1dnSYjyFO2HeKGXf4TUS7DSCF7tpUJlBen69Xaqbwg%2BHfNfmgcCoZwSgvg%3D%3D"
|
7
|
+
}
|