adyen-ruby-api-library 4.0.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/CODEOWNERS +1 -0
- 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/CODE_OF_CONDUCT.md +76 -0
- data/Gemfile +2 -2
- data/README.md +16 -2
- data/docs/checkout.html +17 -0
- data/lib/adyen-ruby-api-library.rb +4 -11
- data/lib/adyen/client.rb +16 -3
- data/lib/adyen/errors.rb +44 -2
- data/lib/adyen/hash_with_accessors.rb +38 -0
- data/lib/adyen/result.rb +2 -2
- data/lib/adyen/services/checkout.rb +2 -1
- data/lib/adyen/services/data_protection.rb +17 -0
- data/lib/adyen/services/marketpay.rb +18 -0
- data/lib/adyen/services/payments.rb +2 -1
- data/lib/adyen/services/postfmapi.rb +19 -0
- data/lib/adyen/services/service.rb +10 -1
- data/lib/adyen/utils/hmac_validator.rb +48 -0
- data/lib/adyen/version.rb +2 -2
- data/renovate.json +5 -0
- data/spec/checkout_spec.rb +13 -4
- data/spec/checkout_utility_spec.rb +4 -2
- data/spec/data_protection_spec.rb +14 -0
- data/spec/errors_spec.rb +33 -3
- data/spec/hash_with_accessors_spec.rb +127 -0
- data/spec/hop_spec.rb +14 -0
- data/spec/mocks/requests/Checkout/payment_links.json +9 -0
- data/spec/mocks/requests/DataProtectionService/request_subject_erasure.json +5 -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/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/Checkout/payment_links.json +9 -0
- data/spec/mocks/responses/DataProtectionService/request_subject_erasure.json +3 -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/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 +2 -1
- data/spec/postfmapi_spec.rb +16 -0
- data/spec/service_spec.rb +45 -0
- data/spec/spec_helper.rb +7 -4
- data/spec/utils/hmac_validator_spec.rb +52 -0
- metadata +34 -5
- data/lib/adyen/util.rb +0 -21
| @@ -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 | 
            +
            }
         | 
    
        data/spec/payments_spec.rb
    CHANGED
    
    | @@ -14,7 +14,8 @@ 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]"]
         | 
| 18 19 | 
             
              ]
         | 
| 19 20 |  | 
| 20 21 | 
             
              generate_tests(client, "Payment", test_sets, client.payments)
         | 
| @@ -0,0 +1,16 @@ | |
| 1 | 
            +
            require "spec_helper"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            RSpec.describe Adyen::PosTerminalManagement, service: "POS Terminal Management 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 | 
            +
                ["find_terminal", "merchantAccount", "TestMerchant"],
         | 
| 11 | 
            +
                ["get_terminals_under_account", "merchantAccounts", [{ "merchantAccount" => "TestMerchant", "inStoreTerminals" => ["P400Plus-123456789"] }]],
         | 
| 12 | 
            +
                ["assign_terminals", "results", { "e285-123456789" => "Done" }]
         | 
| 13 | 
            +
              ]
         | 
| 14 | 
            +
             | 
| 15 | 
            +
              generate_tests(client, "Terminal", test_sets, client.postfmapi)
         | 
| 16 | 
            +
            end
         | 
| @@ -0,0 +1,45 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            RSpec.describe Adyen::Service do
         | 
| 4 | 
            +
              describe '.action_for_method_name' do
         | 
| 5 | 
            +
                it 'handles all methods that exist currently' do
         | 
| 6 | 
            +
                  expect(described_class.action_for_method_name(:adjust_authorisation)).to eq 'adjustAuthorisation'
         | 
| 7 | 
            +
                  expect(described_class.action_for_method_name(:authorise)).to eq 'authorise'
         | 
| 8 | 
            +
                  expect(described_class.action_for_method_name(:authorise3d)).to eq 'authorise3d'
         | 
| 9 | 
            +
                  expect(described_class.action_for_method_name(:authorise3ds2)).to eq 'authorise3ds2'
         | 
| 10 | 
            +
                  expect(described_class.action_for_method_name(:cancel)).to eq 'cancel'
         | 
| 11 | 
            +
                  expect(described_class.action_for_method_name(:cancel_or_refund)).to eq 'cancelOrRefund'
         | 
| 12 | 
            +
                  expect(described_class.action_for_method_name(:capture)).to eq 'capture'
         | 
| 13 | 
            +
                  expect(described_class.action_for_method_name(:close_account)).to eq 'closeAccount'
         | 
| 14 | 
            +
                  expect(described_class.action_for_method_name(:close_account_holder)).to eq 'closeAccountHolder'
         | 
| 15 | 
            +
                  expect(described_class.action_for_method_name(:confirm_third_party)).to eq 'confirmThirdParty'
         | 
| 16 | 
            +
                  expect(described_class.action_for_method_name(:create_account)).to eq 'createAccount'
         | 
| 17 | 
            +
                  expect(described_class.action_for_method_name(:create_account_holder)).to eq 'createAccountHolder'
         | 
| 18 | 
            +
                  expect(described_class.action_for_method_name(:decline_third_party)).to eq 'declineThirdParty'
         | 
| 19 | 
            +
                  expect(described_class.action_for_method_name(:delete_bank_accounts)).to eq 'deleteBankAccounts'
         | 
| 20 | 
            +
                  expect(described_class.action_for_method_name(:delete_shareholders)).to eq 'deleteShareholders'
         | 
| 21 | 
            +
                  expect(described_class.action_for_method_name(:disable)).to eq 'disable'
         | 
| 22 | 
            +
                  expect(described_class.action_for_method_name(:donate)).to eq 'donate'
         | 
| 23 | 
            +
                  expect(described_class.action_for_method_name(:get_account_holder)).to eq 'getAccountHolder'
         | 
| 24 | 
            +
                  expect(described_class.action_for_method_name(:get_tier_configuration)).to eq 'getTierConfiguration'
         | 
| 25 | 
            +
                  expect(described_class.action_for_method_name(:get_uploaded_documents)).to eq 'getUploadedDocuments'
         | 
| 26 | 
            +
                  expect(described_class.action_for_method_name(:list_recurring_details)).to eq 'listRecurringDetails'
         | 
| 27 | 
            +
                  expect(described_class.action_for_method_name(:origin_keys)).to eq 'originKeys'
         | 
| 28 | 
            +
                  expect(described_class.action_for_method_name(:payment_methods)).to eq 'paymentMethods'
         | 
| 29 | 
            +
                  expect(described_class.action_for_method_name(:payment_session)).to eq 'paymentSession'
         | 
| 30 | 
            +
                  expect(described_class.action_for_method_name(:payment_links)).to eq 'paymentLinks'
         | 
| 31 | 
            +
                  expect(described_class.action_for_method_name(:refund)).to eq 'refund'
         | 
| 32 | 
            +
                  expect(described_class.action_for_method_name(:store_detail)).to eq 'storeDetail'
         | 
| 33 | 
            +
                  expect(described_class.action_for_method_name(:store_detail_and_submit_third_party)).to eq 'storeDetailAndSubmitThirdParty'
         | 
| 34 | 
            +
                  expect(described_class.action_for_method_name(:store_token)).to eq 'storeToken'
         | 
| 35 | 
            +
                  expect(described_class.action_for_method_name(:submit_third_party)).to eq 'submitThirdParty'
         | 
| 36 | 
            +
                  expect(described_class.action_for_method_name(:suspend_account_holder)).to eq 'suspendAccountHolder'
         | 
| 37 | 
            +
                  expect(described_class.action_for_method_name(:un_suspend_account_holder)).to eq 'unSuspendAccountHolder'
         | 
| 38 | 
            +
                  expect(described_class.action_for_method_name(:update_account)).to eq 'updateAccount'
         | 
| 39 | 
            +
                  expect(described_class.action_for_method_name(:update_account_holder)).to eq 'updateAccountHolder'
         | 
| 40 | 
            +
                  expect(described_class.action_for_method_name(:update_account_holder_state)).to eq 'updateAccountHolderState'
         | 
| 41 | 
            +
                  expect(described_class.action_for_method_name(:upload_document)).to eq 'uploadDocument'
         | 
| 42 | 
            +
                  expect(described_class.action_for_method_name(:get_onboarding_url)).to eq 'getOnboardingUrl'
         | 
| 43 | 
            +
                end
         | 
| 44 | 
            +
              end
         | 
| 45 | 
            +
            end
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | @@ -39,7 +39,8 @@ def create_test(client, service, method_name, parent_object) | |
| 39 39 | 
             
              end
         | 
| 40 40 |  | 
| 41 41 | 
             
              # stub request
         | 
| 42 | 
            -
               | 
| 42 | 
            +
              action = Adyen::Service.action_for_method_name(method_name)
         | 
| 43 | 
            +
              url = client.service_url(service, action, parent_object.version)
         | 
| 43 44 | 
             
              WebMock.stub_request(:post, url).
         | 
| 44 45 | 
             
                with(
         | 
| 45 46 | 
             
                  body: request_body,
         | 
| @@ -50,7 +51,7 @@ def create_test(client, service, method_name, parent_object) | |
| 50 51 | 
             
                )
         | 
| 51 52 | 
             
              result = parent_object.public_send(method_name, request_body)
         | 
| 52 53 |  | 
| 53 | 
            -
              # result.response is already a Ruby  | 
| 54 | 
            +
              # result.response is already a Ruby object (Adyen::HashWithAccessors) (rather than an unparsed JSON string)
         | 
| 54 55 | 
             
              response_hash = result.response
         | 
| 55 56 |  | 
| 56 57 | 
             
              # boilerplate error checks
         | 
| @@ -58,8 +59,10 @@ def create_test(client, service, method_name, parent_object) | |
| 58 59 | 
             
                to eq(200)
         | 
| 59 60 | 
             
              expect(response_hash).
         | 
| 60 61 | 
             
                to eq(JSON.parse(response_body))
         | 
| 61 | 
            -
              expect(response_hash | 
| 62 | 
            -
                to  | 
| 62 | 
            +
              expect(response_hash).
         | 
| 63 | 
            +
                to be_a Adyen::HashWithAccessors
         | 
| 64 | 
            +
              expect(response_hash).
         | 
| 65 | 
            +
                to be_a_kind_of Hash
         | 
| 63 66 |  | 
| 64 67 | 
             
              response_hash
         | 
| 65 68 | 
             
            end
         | 
| @@ -0,0 +1,52 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            RSpec.describe Adyen::Utils::HmacValidator do
         | 
| 4 | 
            +
              let(:validator) { described_class.new }
         | 
| 5 | 
            +
              let(:key) { '44782DEF547AAA06C910C43932B1EB0C71FC68D9D0C057550C48EC2ACF6BA056' }
         | 
| 6 | 
            +
              let(:expected_sign) { 'coqCmt/IZ4E3CzPvMY8zTjQVL5hYJUiBRg8UU+iCWo0=' }
         | 
| 7 | 
            +
              let(:notification_request_item) do
         | 
| 8 | 
            +
                {
         | 
| 9 | 
            +
                  additionalData: {
         | 
| 10 | 
            +
                    hmacSignature: expected_sign
         | 
| 11 | 
            +
                  },
         | 
| 12 | 
            +
                  amount: {
         | 
| 13 | 
            +
                    value: 1130,
         | 
| 14 | 
            +
                    currency: 'EUR'
         | 
| 15 | 
            +
                  },
         | 
| 16 | 
            +
                  pspReference: '7914073381342284',
         | 
| 17 | 
            +
                  eventCode: 'AUTHORISATION',
         | 
| 18 | 
            +
                  merchantAccountCode: 'TestMerchant',
         | 
| 19 | 
            +
                  merchantReference: 'TestPayment-1407325143704',
         | 
| 20 | 
            +
                  paymentMethod: 'visa',
         | 
| 21 | 
            +
                  success: 'true'
         | 
| 22 | 
            +
                }
         | 
| 23 | 
            +
              end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
              describe 'HMAC Validator' do
         | 
| 26 | 
            +
                it 'should get correct data' do
         | 
| 27 | 
            +
                  data_to_sign = validator.data_to_sign(notification_request_item)
         | 
| 28 | 
            +
                  expect(data_to_sign).to eq '7914073381342284::TestMerchant:TestPayment-1407325143704:1130:EUR:AUTHORISATION:true'
         | 
| 29 | 
            +
                end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
                it 'should get correct data with escaped characters' do
         | 
| 32 | 
            +
                  notification_request_item['merchantAccountCode'] = 'Test:\\Merchant'
         | 
| 33 | 
            +
                  data_to_sign = validator.data_to_sign(notification_request_item)
         | 
| 34 | 
            +
                  expect(data_to_sign).to eq '7914073381342284::Test\\:\\Merchant:TestPayment-1407325143704:1130:EUR:AUTHORISATION:true'
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                it 'should encrypt properly' do
         | 
| 38 | 
            +
                  encrypted = validator.calculate_notification_hmac(notification_request_item, key)
         | 
| 39 | 
            +
                  expect(encrypted).to eq expected_sign
         | 
| 40 | 
            +
                end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                it 'should have a valid hmac' do
         | 
| 43 | 
            +
                  expect(validator.valid_notification_hmac?(notification_request_item, key)).to be true
         | 
| 44 | 
            +
                end
         | 
| 45 | 
            +
             | 
| 46 | 
            +
                it 'should have an invalid hmac' do
         | 
| 47 | 
            +
                  notification_request_item['additionalData'] = { 'hmacSignature' => 'invalidHMACsign' }
         | 
| 48 | 
            +
             | 
| 49 | 
            +
                  expect(validator.valid_notification_hmac?(notification_request_item, key)).to be false
         | 
| 50 | 
            +
                end
         | 
| 51 | 
            +
              end
         | 
| 52 | 
            +
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: adyen-ruby-api-library
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 4. | 
| 4 | 
            +
              version: 4.3.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Adyen
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2020-07-13 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: faraday
         | 
| @@ -76,8 +76,14 @@ executables: [] | |
| 76 76 | 
             
            extensions: []
         | 
| 77 77 | 
             
            extra_rdoc_files: []
         | 
| 78 78 | 
             
            files:
         | 
| 79 | 
            +
            - ".github/CODEOWNERS"
         | 
| 80 | 
            +
            - ".github/ISSUE_TEMPLATE/bug_report.md"
         | 
| 81 | 
            +
            - ".github/ISSUE_TEMPLATE/feature_request.md"
         | 
| 82 | 
            +
            - ".github/PULL_REQUEST_TEMPLATE.md"
         | 
| 83 | 
            +
            - ".github/dependabot.yml"
         | 
| 79 84 | 
             
            - ".gitignore"
         | 
| 80 85 | 
             
            - ".travis.yml"
         | 
| 86 | 
            +
            - CODE_OF_CONDUCT.md
         | 
| 81 87 | 
             
            - CONTRIBUTING.md
         | 
| 82 88 | 
             
            - Gemfile
         | 
| 83 89 | 
             
            - LICENSE
         | 
| @@ -103,22 +109,29 @@ files: | |
| 103 109 | 
             
            - lib/adyen-ruby-api-library.rb
         | 
| 104 110 | 
             
            - lib/adyen/client.rb
         | 
| 105 111 | 
             
            - lib/adyen/errors.rb
         | 
| 112 | 
            +
            - lib/adyen/hash_with_accessors.rb
         | 
| 106 113 | 
             
            - lib/adyen/result.rb
         | 
| 107 114 | 
             
            - lib/adyen/services/checkout.rb
         | 
| 108 115 | 
             
            - lib/adyen/services/checkout_utility.rb
         | 
| 116 | 
            +
            - lib/adyen/services/data_protection.rb
         | 
| 109 117 | 
             
            - lib/adyen/services/marketpay.rb
         | 
| 110 118 | 
             
            - lib/adyen/services/payments.rb
         | 
| 111 119 | 
             
            - lib/adyen/services/payouts.rb
         | 
| 120 | 
            +
            - lib/adyen/services/postfmapi.rb
         | 
| 112 121 | 
             
            - lib/adyen/services/recurring.rb
         | 
| 113 122 | 
             
            - lib/adyen/services/service.rb
         | 
| 114 | 
            -
            - lib/adyen/ | 
| 123 | 
            +
            - lib/adyen/utils/hmac_validator.rb
         | 
| 115 124 | 
             
            - lib/adyen/version.rb
         | 
| 125 | 
            +
            - renovate.json
         | 
| 116 126 | 
             
            - spec/account_spec.rb
         | 
| 117 127 | 
             
            - spec/checkout_spec.rb
         | 
| 118 128 | 
             
            - spec/checkout_utility_spec.rb
         | 
| 119 129 | 
             
            - spec/client_spec.rb
         | 
| 130 | 
            +
            - spec/data_protection_spec.rb
         | 
| 120 131 | 
             
            - spec/errors_spec.rb
         | 
| 121 132 | 
             
            - spec/fund_spec.rb
         | 
| 133 | 
            +
            - spec/hash_with_accessors_spec.rb
         | 
| 134 | 
            +
            - spec/hop_spec.rb
         | 
| 122 135 | 
             
            - spec/mocks/requests/Account/close_account.json
         | 
| 123 136 | 
             
            - spec/mocks/requests/Account/close_account_holder.json
         | 
| 124 137 | 
             
            - spec/mocks/requests/Account/create_account.json
         | 
| @@ -135,17 +148,20 @@ files: | |
| 135 148 | 
             
            - spec/mocks/requests/Account/upload_document.json
         | 
| 136 149 | 
             
            - spec/mocks/requests/Checkout/payment-details.json
         | 
| 137 150 | 
             
            - spec/mocks/requests/Checkout/payment-result.json
         | 
| 151 | 
            +
            - spec/mocks/requests/Checkout/payment_links.json
         | 
| 138 152 | 
             
            - spec/mocks/requests/Checkout/payment_methods.json
         | 
| 139 153 | 
             
            - spec/mocks/requests/Checkout/payment_session.json
         | 
| 140 154 | 
             
            - spec/mocks/requests/Checkout/payments.json
         | 
| 141 155 | 
             
            - spec/mocks/requests/Checkout/verify.json
         | 
| 142 156 | 
             
            - spec/mocks/requests/CheckoutUtility/origin_keys.json
         | 
| 157 | 
            +
            - spec/mocks/requests/DataProtectionService/request_subject_erasure.json
         | 
| 143 158 | 
             
            - spec/mocks/requests/Fund/account_holder_balance.json
         | 
| 144 159 | 
             
            - spec/mocks/requests/Fund/account_holder_transaction_list.json
         | 
| 145 160 | 
             
            - spec/mocks/requests/Fund/payout_account_holder.json
         | 
| 146 161 | 
             
            - spec/mocks/requests/Fund/refund_not_paid_out_transfers.json
         | 
| 147 162 | 
             
            - spec/mocks/requests/Fund/setup_beneficiary.json
         | 
| 148 163 | 
             
            - spec/mocks/requests/Fund/transfer_funds.json
         | 
| 164 | 
            +
            - spec/mocks/requests/Hop/get_onboarding_url.json
         | 
| 149 165 | 
             
            - spec/mocks/requests/Notification/create_notification_configuration.json
         | 
| 150 166 | 
             
            - spec/mocks/requests/Notification/delete_notification_configurations.json
         | 
| 151 167 | 
             
            - spec/mocks/requests/Notification/get_notification_configuration.json
         | 
| @@ -159,6 +175,7 @@ files: | |
| 159 175 | 
             
            - spec/mocks/requests/Payment/cancel.json
         | 
| 160 176 | 
             
            - spec/mocks/requests/Payment/cancel_or_refund.json
         | 
| 161 177 | 
             
            - spec/mocks/requests/Payment/capture.json
         | 
| 178 | 
            +
            - spec/mocks/requests/Payment/donate.json
         | 
| 162 179 | 
             
            - spec/mocks/requests/Payment/refund.json
         | 
| 163 180 | 
             
            - spec/mocks/requests/Payout/confirm_third_party.json
         | 
| 164 181 | 
             
            - spec/mocks/requests/Payout/decline_third_party.json
         | 
| @@ -168,6 +185,9 @@ files: | |
| 168 185 | 
             
            - spec/mocks/requests/Recurring/disable.json
         | 
| 169 186 | 
             
            - spec/mocks/requests/Recurring/list_recurring_details.json
         | 
| 170 187 | 
             
            - spec/mocks/requests/Recurring/store_token.json
         | 
| 188 | 
            +
            - spec/mocks/requests/Terminal/assign_terminals.json
         | 
| 189 | 
            +
            - spec/mocks/requests/Terminal/find_terminal.json
         | 
| 190 | 
            +
            - spec/mocks/requests/Terminal/get_terminals_under_account.json
         | 
| 171 191 | 
             
            - spec/mocks/responses/Account/close_account.json
         | 
| 172 192 | 
             
            - spec/mocks/responses/Account/close_account_holder.json
         | 
| 173 193 | 
             
            - spec/mocks/responses/Account/create_account.json
         | 
| @@ -184,17 +204,20 @@ files: | |
| 184 204 | 
             
            - spec/mocks/responses/Account/upload_document.json
         | 
| 185 205 | 
             
            - spec/mocks/responses/Checkout/payment-details.json
         | 
| 186 206 | 
             
            - spec/mocks/responses/Checkout/payment-result.json
         | 
| 207 | 
            +
            - spec/mocks/responses/Checkout/payment_links.json
         | 
| 187 208 | 
             
            - spec/mocks/responses/Checkout/payment_methods.json
         | 
| 188 209 | 
             
            - spec/mocks/responses/Checkout/payment_session.json
         | 
| 189 210 | 
             
            - spec/mocks/responses/Checkout/payments.json
         | 
| 190 211 | 
             
            - spec/mocks/responses/Checkout/verify.json
         | 
| 191 212 | 
             
            - spec/mocks/responses/CheckoutUtility/origin_keys.json
         | 
| 213 | 
            +
            - spec/mocks/responses/DataProtectionService/request_subject_erasure.json
         | 
| 192 214 | 
             
            - spec/mocks/responses/Fund/account_holder_balance.json
         | 
| 193 215 | 
             
            - spec/mocks/responses/Fund/account_holder_transaction_list.json
         | 
| 194 216 | 
             
            - spec/mocks/responses/Fund/payout_account_holder.json
         | 
| 195 217 | 
             
            - spec/mocks/responses/Fund/refund_not_paid_out_transfers.json
         | 
| 196 218 | 
             
            - spec/mocks/responses/Fund/setup_beneficiary.json
         | 
| 197 219 | 
             
            - spec/mocks/responses/Fund/transfer_funds.json
         | 
| 220 | 
            +
            - spec/mocks/responses/Hop/get_onboarding_url.json
         | 
| 198 221 | 
             
            - spec/mocks/responses/Notification/create_notification_configuration.json
         | 
| 199 222 | 
             
            - spec/mocks/responses/Notification/delete_notification_configurations.json
         | 
| 200 223 | 
             
            - spec/mocks/responses/Notification/get_notification_configuration.json
         | 
| @@ -208,6 +231,7 @@ files: | |
| 208 231 | 
             
            - spec/mocks/responses/Payment/cancel.json
         | 
| 209 232 | 
             
            - spec/mocks/responses/Payment/cancel_or_refund.json
         | 
| 210 233 | 
             
            - spec/mocks/responses/Payment/capture.json
         | 
| 234 | 
            +
            - spec/mocks/responses/Payment/donate.json
         | 
| 211 235 | 
             
            - spec/mocks/responses/Payment/refund.json
         | 
| 212 236 | 
             
            - spec/mocks/responses/Payout/confirm_third_party.json
         | 
| 213 237 | 
             
            - spec/mocks/responses/Payout/decline_third_party.json
         | 
| @@ -217,11 +241,17 @@ files: | |
| 217 241 | 
             
            - spec/mocks/responses/Recurring/disable.json
         | 
| 218 242 | 
             
            - spec/mocks/responses/Recurring/list_recurring_details.json
         | 
| 219 243 | 
             
            - spec/mocks/responses/Recurring/store_token.json
         | 
| 244 | 
            +
            - spec/mocks/responses/Terminal/assign_terminals.json
         | 
| 245 | 
            +
            - spec/mocks/responses/Terminal/find_terminal.json
         | 
| 246 | 
            +
            - spec/mocks/responses/Terminal/get_terminals_under_account.json
         | 
| 220 247 | 
             
            - spec/notification_spec.rb
         | 
| 221 248 | 
             
            - spec/payments_spec.rb
         | 
| 222 249 | 
             
            - spec/payouts_spec.rb
         | 
| 250 | 
            +
            - spec/postfmapi_spec.rb
         | 
| 223 251 | 
             
            - spec/recurring_spec.rb
         | 
| 252 | 
            +
            - spec/service_spec.rb
         | 
| 224 253 | 
             
            - spec/spec_helper.rb
         | 
| 254 | 
            +
            - spec/utils/hmac_validator_spec.rb
         | 
| 225 255 | 
             
            homepage: https://www.adyen.com
         | 
| 226 256 | 
             
            licenses:
         | 
| 227 257 | 
             
            - MIT
         | 
| @@ -244,8 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 244 274 | 
             
                - !ruby/object:Gem::Version
         | 
| 245 275 | 
             
                  version: '0'
         | 
| 246 276 | 
             
            requirements: []
         | 
| 247 | 
            -
             | 
| 248 | 
            -
            rubygems_version: 2.2.0
         | 
| 277 | 
            +
            rubygems_version: 3.1.2
         | 
| 249 278 | 
             
            signing_key: 
         | 
| 250 279 | 
             
            specification_version: 4
         | 
| 251 280 | 
             
            summary: Official Adyen  Ruby API Library
         | 
    
        data/lib/adyen/util.rb
    DELETED
    
    | @@ -1,21 +0,0 @@ | |
| 1 | 
            -
            # This utility method monkey-patches Ruby's Hash class to allow keys to be read
         | 
| 2 | 
            -
            # and updated with dot notation. Usage is entirely optional (i.e.,  hash values
         | 
| 3 | 
            -
            # can still be accessed via symbol and string keys).
         | 
| 4 | 
            -
            #
         | 
| 5 | 
            -
            # Credit: https://gist.github.com/winfred/2185384#file-ruby-dot-hash-access-rb
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            class Hash
         | 
| 8 | 
            -
              class NoKeyOrMethodError < NoMethodError; end
         | 
| 9 | 
            -
              def method_missing(method,*args)
         | 
| 10 | 
            -
                m = method.to_s
         | 
| 11 | 
            -
                string_key = m.gsub(/=$/,'')
         | 
| 12 | 
            -
                sym_key = string_key.to_sym
         | 
| 13 | 
            -
                if self.has_key? string_key
         | 
| 14 | 
            -
                  m.match(/=$/) ? self.send("[#{string_key}]=", *args) : self[string_key]
         | 
| 15 | 
            -
                elsif self.has_key? sym_key
         | 
| 16 | 
            -
                  m.match(/=$/) ? self.send("[#{sym_key}]=", *args) : self[sym_key]
         | 
| 17 | 
            -
                else
         | 
| 18 | 
            -
                  raise NoKeyOrMethodError
         | 
| 19 | 
            -
                end
         | 
| 20 | 
            -
              end
         | 
| 21 | 
            -
            end
         |