{"id":17464487,"url":"https://github.com/overbryd/adyen_client","last_synced_at":"2026-01-07T11:47:04.519Z","repository":{"id":62553038,"uuid":"48141725","full_name":"Overbryd/adyen_client","owner":"Overbryd","description":"A simple client that talks to the Adyen API","archived":false,"fork":false,"pushed_at":"2018-07-24T11:22:17.000Z","size":46,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T16:49:50.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Overbryd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-16T23:51:48.000Z","updated_at":"2016-04-15T08:43:48.000Z","dependencies_parsed_at":"2022-11-03T04:15:29.630Z","dependency_job_id":null,"html_url":"https://github.com/Overbryd/adyen_client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Overbryd%2Fadyen_client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Overbryd%2Fadyen_client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Overbryd%2Fadyen_client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Overbryd%2Fadyen_client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Overbryd","download_url":"https://codeload.github.com/Overbryd/adyen_client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245985892,"owners_count":20705098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-18T10:45:57.313Z","updated_at":"2026-01-07T11:47:04.477Z","avatar_url":"https://github.com/Overbryd.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A simple client that talks to the Adyen API\n\n[![Inline docs](http://inch-ci.org/github/Overbryd/adyen_client.svg?branch=master)](http://inch-ci.org/github/Overbryd/adyen_client)\n\n\u003e Does not try to be smart, stays close to the documentation while adhering to Ruby conventions.\n\n## Setup \u0026 Configuration\n\n`gem install adyen_client`\n\nIn your Gemfile:\n\n`gem \"adyen_client\"`\n\nRequire and configure the client:\n\n```ruby\nrequire \"adyen_client\"\n\n# Block style\nAdyenClient.configure do |c|\n  c.environment = :test\n  c.username = \"ws_123456@Company.FooBar\"\n  c.password = \"correctbatteryhorsestaple\"\n  c.cse_public_key = \"10001|...\"\n  c.default_merchant_account = \"FooBar123\"\n  c.default_currency = \"EUR\"\nend\n\n# Hash style works too, string or symbol keys\nAdyenClient.configure(environment: :test, username: \"ws_123456@Company.FooBar\", ...)\n\n# That comes in handy to configure the client from a YAML file\nAdyenClient.configure(YAML.load_file(Rails.root.join(\"config\", \"adyen.yml\"))[Rails.env.to_s])\n\n# You can override all default_* options for each instance of a client\nclient = AdyenClient.new(merchant_account: \"FooBarSubMerchant123\")\neur_client = AdyenClient.new(currency: \"EUR\")\n```\n\n## Examples\n\n### Simple payment\n\n```ruby\nclient = AdyenClient.new\nresponse = client.authorise(amount: 100, encrypted_card: \"adyenjs_0_1_15$OlmG...\")\nif response.authorised?\n  puts \"( ﾉ ﾟｰﾟ)ﾉ\"\nelse\n  puts \"(－‸ლ)\"\nend\n```\n\n### Setup a recurring contract, charge users later\n\n```ruby\nuser = User.create(email: \"john@doe.com\", last_ip: request.remote_ip)\n\nclient = AdyenClient.new\nresponse = client.create_recurring_contract(encrypted_card: \"adyenjs_0_1_15$OlmG...\", shopper: {\n  reference: user.id,\n  email: user.email,\n  ip: user.last_ip # optional but recommended\n})\nif response.authorised?\n  # now we know the users card is valid\nelse\n  # something is wrong with the users card or we got an error\nend\n```\n\nLater, we want to charge the user based on that contract.\n\n```ruby\nuser = User.find_by_email(\"john@doe.com\")\n\nclient = AdyenClient.new\nresponse = client.authorise_recurring_payment(amount: 1699, shopper: { reference: user.id })\nif response.authorised?\n  # we know the payment is on its way\nelse\n  # something is wrong, maybe we got an error\nend\n```\n\n## Documentation\n\nAll publicly usable [methods and classes are documented here](http://rdoc.info/projects/Overbryd/adyen_client).\n\nThis library does not try to be too smart, it simply provides a layer of abstraction on top of the Adyen JSON API.\nAlso the default `AdyenClient::Response` class basically just wraps the JSON response.\nThe only work it does is converting `camelCase` keys to `sneak_case`, removing unnecessary object nestings and providing you with a convenience `authorised?` method. \n\nIf you want a more sophisticated response class, you can easily hook up your own.\nThe only method you need to provide is `::parse`. It will receive one argument, the [`HTTParty::Response`](http://www.rubydoc.info/github/jnunemaker/httparty/HTTParty/Response) for the given request.\n\n```ruby\nclass MyAdyenResponse\n  def self.parse(http_response)\n    # ... your fancy code\n  end\nend\n```\n\nHook it up by initialising the client like this: `AdyenClient.new(response_class: MyAdyenResponse)`.\n\nSimilar, if you want nothing else than the bare `HTTParty::Response`, initialise the client with: `response_class: nil`.\n\n\n## Contributing\n\nI am very happy to receive pull requests or bug reports for problems with the library.\nPlease make sure you are only reporting an actual issue with the library itself, I cannot help with your payment flow or advise you on anything related to the Adyen API.\n\n## Disclaimer\n\nI am not associated with Adyen in any way.\nIf you have problems with your adyen account or your payment flow, please contact the very helpful Adyen support using `support ät adyen.com`.\n\nPlease make yourself comfortable [with the Adyen documentation](https://docs.adyen.com/) on how you want to setup your payment flow.\n\n## License\n\nThe MIT License (MIT), Copyright (c) 2015 Lukas Rieder\n\nSee [`LICENSE`](https://github.com/Overbryd/adyen_client/blob/master/LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foverbryd%2Fadyen_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foverbryd%2Fadyen_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foverbryd%2Fadyen_client/lists"}