{"id":27151388,"url":"https://github.com/checkout/checkout-sdk-ruby","last_synced_at":"2026-01-29T14:16:38.320Z","repository":{"id":39024697,"uuid":"211920499","full_name":"checkout/checkout-sdk-ruby","owner":"checkout","description":"Checkout.com SDK for Ruby","archived":false,"fork":false,"pushed_at":"2026-01-21T11:45:54.000Z","size":1176,"stargazers_count":10,"open_issues_count":5,"forks_count":16,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-01-21T23:04:26.623Z","etag":null,"topics":["payment","payments","ruby","sdk"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/checkout.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-30T17:52:26.000Z","updated_at":"2025-12-04T17:32:32.000Z","dependencies_parsed_at":"2023-12-22T14:53:55.968Z","dependency_job_id":"979ca892-5934-4727-8b16-432126457024","html_url":"https://github.com/checkout/checkout-sdk-ruby","commit_stats":{"total_commits":97,"total_committers":11,"mean_commits":8.818181818181818,"dds":0.711340206185567,"last_synced_commit":"c532d7369fffa221de7d62cad15e4ac22205f5d2"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/checkout/checkout-sdk-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-sdk-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-sdk-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-sdk-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-sdk-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/checkout","download_url":"https://codeload.github.com/checkout/checkout-sdk-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/checkout%2Fcheckout-sdk-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28879217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["payment","payments","ruby","sdk"],"created_at":"2025-04-08T14:40:16.981Z","updated_at":"2026-01-29T14:16:38.305Z","avatar_url":"https://github.com/checkout.png","language":"Ruby","readme":"# Checkout.com Ruby SDK\n[![build-status](https://github.com/checkout/checkout-sdk-ruby/workflows/build-master/badge.svg)](https://github.com/checkout/checkout-sdk-ruby/actions/workflows/build-master.yml)\n![CodeQL](https://github.com/checkout/checkout-sdk-ruby/workflows/CodeQL/badge.svg)\n\n[![build-status](https://github.com/checkout/checkout-sdk-ruby/workflows/build-release/badge.svg)](https://github.com/checkout/checkout-sdk-ruby/actions/workflows/build-release.yml)\n[![GitHub release](https://img.shields.io/github/release/checkout/checkout-sdk-ruby.svg)](https://GitHub.com/checkout/checkout-sdk-ruby/releases/)\n[![Gem Version](https://badge.fury.io/rb/checkout_sdk.svg)](https://badge.fury.io/rb/checkout_sdk)\n\n[![GitHub license](https://img.shields.io/github/license/checkout/checkout-sdk-ruby.svg)](https://github.com/checkout/checkout-sdk-ruby/blob/master/LICENSE.md)\n\n## Getting started\n\n\u003e **Version 1.0.0 is here!**\n\u003e \u003cbr/\u003e\u003cbr/\u003e\n\u003e We improved the initialization of SDK making it easier to understand the available options. \u003cbr/\u003e\n\u003e Now `NAS` accounts are the default instance for the SDK and `ABC` structure was moved to a `previous` prefixes. \u003cbr/\u003e\n\n## Requirements\n\n- **Ruby**: 2.7.0 or higher\n- **Tested on**: Ruby 2.7, 3.1, and 3.3\n\n\u003e **Note**: Ruby 2.6 reached end-of-life in March 2022 and is no longer supported. Please upgrade to Ruby 2.7 or later for security and compatibility.\n\n### Gem installer\n\n```sh\ngem install checkout_sdk\n```\n\n### Bundler\n\nBundler provides a consistent environment for Ruby projects by tracking and installing the exact gems and versions that\nyou need.\n\n```ruby\nsource 'https://rubygems.org'\n\ngem 'checkout_sdk'\n```\n\n### :rocket: Please check in [GitHub releases](https://github.com/checkout/checkout-sdk-ruby/releases) for all the versions available.\n\n### :book: Checkout our official documentation.\n\n* [Official Docs (Default)](https://docs.checkout.com/)\n* [Official Docs (Previous)](https://docs.checkout.com/previous)\n\n### :books: Check out our official API documentation guide, where you can also find more usage examples.\n\n* [API Reference (Default)](https://api-reference.checkout.com/)\n* [API Reference (Previous)](https://api-reference.checkout.com/previous)\n\n## How to use the SDK\n\nThis SDK can be used with two different pair of API keys provided by Checkout. However, using different API keys imply\nusing specific API features. \u003c/br\u003e\nPlease find in the table below the types of keys that can be used within this SDK.\n\n| Account System | Public Key (example)                    | Secret Key (example)                    |\n|----------------|-----------------------------------------|-----------------------------------------|\n| Default        | pk_pkhpdtvabcf7hdgpwnbhw7r2uic          | sk_m73dzypy7cf3gf5d2xr4k7sxo4e          |\n| Previous       | pk_g650ff27-7c42-4ce1-ae90-5691a188ee7b | sk_gk3517a8-3z01-45fq-b4bd-4282384b0a64 |\n\nNote: sandbox keys have a `sbox_` or `test_` identifier, for Default and Previous accounts respectively.\n\nIf you don't have your own API keys, you can sign up for a test\naccount [here](https://www.checkout.com/get-test-account).\n\n**PLEASE NEVER SHARE OR PUBLISH YOUR CHECKOUT CREDENTIALS.**\n\n### Default\n\nDefault keys client instantiation can be done as follows:\n\n```ruby\napi = CheckoutSdk.builder\n                 .static_keys\n                 .with_secret_key('secret_key')\n                 .with_public_key('public_key') # optional, only required for operations related with tokens\n                 .with_environment(CheckoutSdk::Environment.sandbox)\n                 .build\n```\n\n### Default OAuth\n\nThe SDK supports client credentials OAuth, when initialized as follows:\n\n```ruby\napi = CheckoutSdk.builder\n                 .oauth\n                 .with_authorization_uri('https://access.sandbox.checkout.com/connect/token') # custom authorization URI, optional\n                 .with_client_credentials(\"client_id\", \"client_secret\")\n                 .with_scopes([CheckoutSdk::OAuthScopes::VAULT, CheckoutSdk::OAuthScopes::GATEWAY]) # array of scopes\n                 .with_environment(CheckoutSdk::Environment.sandbox)\n                 .build\n```\n\n### Previous\n\nIf your pair of keys matches the previous system type, this is how the SDK should be used:\n\n```ruby\napi = CheckoutSdk.builder\n                 .previous\n                 .static_keys\n                 .with_secret_key('secret_key')\n                 .with_public_key('public_key') # optional, only required for operations related with tokens\n                 .with_environment(CheckoutSdk::Environment.sandbox)\n                 .build\n```\n\nThen just get any client, and start making requests:\n\n```ruby\nrequest = {\n  source: {\n    type: 'token',\n    token: 'tok_4gzeau5o2uqubbk6fufs3m7p54',\n  },\n  reference: '9bf2e1e9-193a-400a-86d5-debabc495237',\n  amount: 10,\n  currency: 'GBP',\n}\npayment_response = api.payments.request_payment(request)\n```\n\n## Logging\n\nThe SDK supports custom Log provider, you need to provide your log configuration via SDK initialization by default uses `Logger` from Ruby.\n\n```ruby\napi = CheckoutSdk.builder\n                 .static_keys\n                 .with_secret_key('secret_key')\n                 .with_public_key('public_key') # optional, only required for operations related with tokens\n                 .with_environment(CheckoutSdk::Environment.sandbox)\n                 .with_logger(logger) # your own custom configuration\n                 .build\n```\n\n## Exception handling\n\nAll the API responses that do not fall in the 2** status codes will cause a `CheckoutSdk::CheckoutApiException`. The\nexception\nencapsulates the `http_metadata` and a map of `error_details`, if available.\n\n## Custom Http Client\n\nRuby SDK supports your own configuration for `http client` using `Faraday::Connection` object, you can pass\nthrough the\nSDK instantiation as follows:\n\n```ruby\nhttp_client = Faraday.new do |conn|\n  conn.options.timeout = 10\n  conn.proxy \"http://localhost:8080\"\nend\n\napi = CheckoutSdk.builder\n                 .static_keys\n                 .with_secret_key('secret_key')\n                 .with_public_key('public_key') # optional, only required for operations related with tokens\n                 .with_environment(CheckoutSdk::Environment.sandbox)\n                 .with_http_client(http_client)\n                 .build\n```\n\nYou don't need to specify the URL for Faraday constructor the SDK grabs the belong URI from `CheckoutSdk::Environment`\nhowever if you want to\nuse specific URI's without a proxy you can create the `Environment` object as follows.\n\n```ruby\nenvironment = CheckoutSdk::Environment.new('https://the.base.uri/', # the uri for all CKO operations\n                                           'https://the.oauth.uri/connect/token', # the uri used for OAUTH authorization, only required for OAuth operations\n                                           'https://the.files.uri/', # the uri used for Files operations, only required for Accounts module\n                                           'https://the.transfers.uri/', # the uri used for Transfer operations, only required for Transfers module\n                                           'https://the.balances.uri/', # the uri used for Balances operations, only required for Balances module\n                                           false)\n```\n\nIf you want to provide your own `http client` and wants to use the `upload_file` functionality from `Disputes` or `Accounts` modules, you\nalso need to specify the custom `http client` for `multipart requests`:\n\n```ruby\nhttp_client = Faraday.new do |conn|\n  conn.options.timeout = 10\n  conn.proxy \"http://localhost:8080\"\n  conn.response :raise_error\nend\n\nmultipart_client = Faraday.new do |f|\n  f.request :multipart\nend\n\napi = CheckoutSdk.builder\n                 .static_keys\n                 .with_secret_key('secret_key')\n                 .with_public_key('public_key') # optional, only required for operations related with tokens\n                 .with_environment(CheckoutSdk::Environment.sandbox)\n                 .with_http_client(http_client)\n                 .with_multipart_http_client(multipart_client)\n                 .build\n```\n\nIf you want to use your own `http_client` and wants to use `Reports` module, the `get_report_file` function follows a redirect URL from Checkout, \nRuby SDK uses `faraday-follow-redirects` which is an [open source](https://github.com/tisba/faraday-follow-redirects) solution that came after Faraday 2.0 deprecation, \nyou must add it otherwise Ruby SDK will not be able to download the contents file, or provide your custom redirect adapter.\n\n```ruby\nhttp_client = Faraday.new do |f|\n  f.response :follow_redirects\n  f.response :raise_error\nend\n\napi = CheckoutSdk.builder\n                 .static_keys\n                 .with_secret_key('secret_key')\n                 .with_public_key('public_key') # optional, only required for operations related with tokens\n                 .with_environment(CheckoutSdk::Environment.sandbox)\n                 .with_http_client(http_client)\n                 .build\n```\n\n## Building from source\n\nOnce you check out the code from GitHub, the project can be built using gem:\n\n```sh\ngem build checkout_sdk.gemspec\n```\n\nThe execution of integration tests require the following environment variables set in your system:\n\n* For default account systems (NAS): `CHECKOUT_DEFAULT_PUBLIC_KEY` \u0026 `CHECKOUT_DEFAULT_SECRET_KEY`\n* For default account systems (OAuth): `CHECKOUT_DEFAULT_OAUTH_CLIENT_ID` \u0026 `CHECKOUT_DEFAULT_OAUTH_CLIENT_SECRET`\n* For Previous account systems (ABC): `CHECKOUT_PREVIOUS_PUBLIC_KEY` \u0026 `CHECKOUT_PREVIOUS_SECRET_KEY`\n\n## Development Setup\n\n### Git Hooks with Overcommit\n\nThis project uses [Overcommit](https://github.com/sds/overcommit) to manage Git hooks and ensure code quality.\n\nAfter cloning the repository, install the hooks:\n\n```bash\nbundle install\nbundle exec overcommit --install\n```\n\nThis will automatically run RuboCop on staged Ruby files before each commit. If there are any offenses, the commit will be blocked.\n\n#### Auto-fixing issues\n\nTo automatically fix some RuboCop offenses:\n\n```bash\nbundle exec rubocop -a\n```\n\n#### Skipping hooks (not recommended)\n\nIf you absolutely need to skip the pre-commit hooks:\n\n```bash\nOVERCOMMIT_DISABLE=1 git commit -m \"your message\"\n```\n\n## Code of Conduct\n\nPlease refer to [Code of Conduct](CODE_OF_CONDUCT.md)\n\n## Licensing\n\n[MIT](LICENSE.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckout%2Fcheckout-sdk-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheckout%2Fcheckout-sdk-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheckout%2Fcheckout-sdk-ruby/lists"}