Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ adyen.checkout.version = 50
- update_notification_configuration
- delete_notification_configurations

**marketpay.hop:**
- get_onboarding_url

## Support

If you have any problems, questions or suggestions, create an issue here or send your inquiry to support@adyen.com.
Expand Down
2 changes: 1 addition & 1 deletion lib/adyen/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def service_url_base(service)
when "CheckoutUtility"
url = "https://checkout-#{@env}.adyen.com/checkout"
supports_live_url_prefix = true
when "Account", "Fund", "Notification"
when "Account", "Fund", "Notification", "Hop"
url = "https://cal-#{@env}.adyen.com/cal/services"
supports_live_url_prefix = false
when "Recurring", "Payment", "Payout"
Expand Down
18 changes: 18 additions & 0 deletions lib/adyen/services/marketpay.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def fund
def notification
@notification ||= Adyen::Marketpay::Notification.new(@client)
end

def hop
@hop ||= Adyen::Marketpay::Hop.new(@client)
end
end

class Account < Service
Expand Down Expand Up @@ -88,5 +92,19 @@ def initialize(client, version = DEFAULT_VERSION)
super(client, version, service, method_names)
end
end

class Hop < Service
attr_accessor :version
DEFAULT_VERSION = 1

def initialize(client, version = DEFAULT_VERSION)
service = 'Hop'
method_names = [
:get_onboarding_url
]

super(client, version, service, method_names)
end
end
end
end
14 changes: 14 additions & 0 deletions spec/hop_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require "spec_helper"

RSpec.describe Adyen::Payments, service: "marketpay hop service" do
# client instance to be used in dynamically generated tests
client = create_client(:basic)

# methods / values to test for
# format is defined in spec_helper
test_sets = [
["get_onboarding_url", "pspReference", "8815850625171183"]
]

generate_tests(client, "Hop", test_sets, client.marketpay.hop)
end
4 changes: 4 additions & 0 deletions spec/mocks/requests/Hop/get_onboarding_url.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"accountHolderCode": "YourUniqueAccountHolderCode",
"returnUrl": "https://your.return-url.com/?submerchant=123"
}
7 changes: 7 additions & 0 deletions spec/mocks/responses/Hop/get_onboarding_url.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"pspReference": "8815850625171183",
"resultCode": "Success",
"submittedAsync": "false",
"invalidFields": [],
"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"
}
1 change: 1 addition & 0 deletions spec/service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
expect(described_class.action_for_method_name(:update_account_holder)).to eq 'updateAccountHolder'
expect(described_class.action_for_method_name(:update_account_holder_state)).to eq 'updateAccountHolderState'
expect(described_class.action_for_method_name(:upload_document)).to eq 'uploadDocument'
expect(described_class.action_for_method_name(:get_onboarding_url)).to eq 'getOnboardingUrl'
end
end
end