adyen-ruby-api-library 4.1.0 → 5.1.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 -119
- data/docs/marketpay.html +2 -0
- data/lib/adyen-ruby-api-library.rb +3 -12
- data/lib/adyen/client.rb +49 -23
- 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 +10 -7
- data/lib/adyen/services/payments.rb +15 -5
- data/lib/adyen/services/payouts.rb +3 -2
- 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 +4 -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/mocks/requests/Account/check_account_holder.json +5 -0
- data/spec/mocks/requests/Account/delete_payout_methods.json +6 -0
- data/spec/mocks/requests/Account/delete_signatories.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/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/responses/Account/check_account_holder.json +3 -0
- data/spec/mocks/responses/Account/delete_payout_methods.json +3 -0
- data/spec/mocks/responses/Account/delete_signatories.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/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/payments_spec.rb +6 -1
- data/spec/payouts_spec.rb +2 -1
- data/spec/recurring_spec.rb +2 -1
- data/spec/service_spec.rb +2 -0
- data/spec/spec_helper.rb +18 -12
- metadata +60 -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)
|
@@ -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
|
+
}
|
data/spec/payments_spec.rb
CHANGED
@@ -14,7 +14,12 @@ RSpec.describe Adyen::Payments, service: "payments service" do
|
|
14
14
|
["cancel", "response", "[cancel-received]"],
|
15
15
|
["cancel_or_refund", "response", "[cancelOrRefund-received]"],
|
16
16
|
["capture", "response", "[capture-received]"],
|
17
|
-
["refund", "response", "[refund-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"]
|
18
23
|
]
|
19
24
|
|
20
25
|
generate_tests(client, "Payment", test_sets, client.payments)
|