{"id":34331163,"url":"https://github.com/rorkjop/klarna-checkout-ruby","last_synced_at":"2025-12-17T18:05:28.201Z","repository":{"id":13715726,"uuid":"16409786","full_name":"rorkjop/klarna-checkout-ruby","owner":"rorkjop","description":"Ruby Wrapper for Klarna Checkout Rest API","archived":false,"fork":false,"pushed_at":"2017-11-10T09:51:16.000Z","size":106,"stargazers_count":8,"open_issues_count":4,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-12-11T05:59:40.125Z","etag":null,"topics":["gem","klarna","ruby"],"latest_commit_sha":null,"homepage":null,"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/rorkjop.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-31T14:14:47.000Z","updated_at":"2022-04-12T21:22:50.000Z","dependencies_parsed_at":"2022-09-14T09:21:42.753Z","dependency_job_id":null,"html_url":"https://github.com/rorkjop/klarna-checkout-ruby","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/rorkjop/klarna-checkout-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorkjop%2Fklarna-checkout-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorkjop%2Fklarna-checkout-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorkjop%2Fklarna-checkout-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorkjop%2Fklarna-checkout-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rorkjop","download_url":"https://codeload.github.com/rorkjop/klarna-checkout-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rorkjop%2Fklarna-checkout-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27785333,"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","status":"online","status_checked_at":"2025-12-17T02:00:08.291Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gem","klarna","ruby"],"created_at":"2025-12-17T18:05:19.889Z","updated_at":"2025-12-17T18:05:28.187Z","avatar_url":"https://github.com/rorkjop.png","language":"Ruby","readme":"[![Build Status](https://travis-ci.org/rorkjop/klarna-checkout-ruby.svg?branch=master)](https://travis-ci.org/rorkjop/klarna-checkout-ruby)\n[![Code Climate](https://codeclimate.com/github/rorkjop/klarna-checkout-ruby/badges/gpa.svg)](https://codeclimate.com/github/rorkjop/klarna-checkout-ruby)\n[![Test Coverage](https://codeclimate.com/github/rorkjop/klarna-checkout-ruby/badges/coverage.svg)](https://codeclimate.com/github/rorkjop/klarna-checkout-ruby/coverage)\n[![Gem Version](https://badge.fury.io/rb/klarna-checkout.png)](http://badge.fury.io/rb/klarna-checkout)\n\n# Klarna Checkout\n\nUnofficial Ruby Wrapper for Klarnas Checkout Rest API.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'klarna-checkout'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install klarna-checkout\n\n## Usage\n\n```ruby\nrequire 'klarna/checkout'\n\n# a) Create a client with shared_secret directly\nclient = Klarna::Checkout::Client.new({\n  shared_secret: 'your-shared-secret',\n  environment: :test # or :production\n})\n\n# b) Create a client with shared_secret from module configuration\nKlarna::Checkout.configure do |config|\n  config.shared_secret = 'your-shared-secret'\nend\n\nclient = Klarna::Checkout::Client.new(environment: :test)\nclient.shared_secret\n# =\u003e 'your-shared-secret'\n\n\n# Initialize an order\norder = Klarna::Checkout::Order.new({\n  purchase_country: 'NO',\n  purchase_currency: 'NOK',\n  locale: 'nb-no',\n  cart: {\n    items: [{\n      reference:  '1123581220325',\n      name:       'Widget',\n      quantity:   1,\n      unit_price: 666,\n      tax_rate:   2500\n    }]\n  },\n  merchant: {\n    id: '1337',\n    terms_uri:        'http://www.example.com/terms',\n    checkout_uri:     'http://www.example.com/checkout',\n    confirmation_uri: 'http://www.example.com/confirmation_uri',\n    push_uri:         'http://www.example.com/push'\n  }\n})\n\n\n# Create the order with Klarna\nclient.create_order(order)\norder.id\n# =\u003e ID of the order (no other attributes are updated)\n\n\n# Read an order from Klarna\norder = client.read_order(\"1234ABCD\")\n\n\n# Configuring some global variables\nKlarna::Checkout.configure do |config|\n  config.shared_secret = 'your-shared-secret'\n  config.merchant_id   = '12345'\n  config.default_country  = 'NO'\n  config.default_currency = 'NOK'\nend\n\n\n# Instead of repeating yourself with supplying the same attributes for each\n# order you can configure some default attributes\nKlarna::Checkout::Order.defaults = {\n  purchase_country: 'NO',\n  purchase_currency: 'NOK',\n  locale: 'nb-no',\n  merchant: {\n    id: '1337',\n    terms_uri:        'http://www.example.com/terms',\n    checkout_uri:     'http://www.example.com/checkout',\n    confirmation_uri: 'http://www.example.com/confirmation_uri',\n    push_uri:         'http://www.example.com/push'\n  }\n}\n\n# All newly created orders will then have these attributes\norder = Klarna::Checkout::Order.new\norder.purchase_country\n# =\u003e 'NO'\n```\n\n## TODO\n\n* Validation of objects according to documentation\n* Respect readonly attributes\n\n## Supported Rubies\n\n* 2.2\n* 2.4\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes, don't forget to add tests (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frorkjop%2Fklarna-checkout-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frorkjop%2Fklarna-checkout-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frorkjop%2Fklarna-checkout-ruby/lists"}