{"id":39296791,"url":"https://github.com/scanpay/ruby-scanpay","last_synced_at":"2026-01-18T01:26:43.735Z","repository":{"id":56894394,"uuid":"82654481","full_name":"scanpay/ruby-scanpay","owner":"scanpay","description":"Scanpay ruby client library","archived":false,"fork":false,"pushed_at":"2022-05-21T22:37:56.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-28T14:43:44.696Z","etag":null,"topics":["payments","ruby","scanpay"],"latest_commit_sha":null,"homepage":"https://docs.scanpay.dk","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/scanpay.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":"2017-02-21T08:21:28.000Z","updated_at":"2022-04-25T17:54:27.000Z","dependencies_parsed_at":"2022-08-20T17:10:21.412Z","dependency_job_id":null,"html_url":"https://github.com/scanpay/ruby-scanpay","commit_stats":null,"previous_names":["scanpaydk/ruby-scanpay"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/scanpay/ruby-scanpay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scanpay%2Fruby-scanpay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scanpay%2Fruby-scanpay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scanpay%2Fruby-scanpay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scanpay%2Fruby-scanpay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scanpay","download_url":"https://codeload.github.com/scanpay/ruby-scanpay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scanpay%2Fruby-scanpay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28526439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"ssl_error","status_checked_at":"2026-01-18T00:39:39.467Z","response_time":85,"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":["payments","ruby","scanpay"],"created_at":"2026-01-18T01:26:43.649Z","updated_at":"2026-01-18T01:26:43.714Z","avatar_url":"https://github.com/scanpay.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scanpay ruby client\n\nThe official Ruby client library for the Scanpay API ([docs](https://docs.scanpay.dk)). You can always e-mail us at [help@scanpay.dk](mailto:help@scanpay.dk), or chat with us on IRC at libera.chat #scanpay\n\n## Installation\n\nYou need Ruby version \u003e= 2.0 with [httpclient](https://github.com/nahi/httpclient). The code is published at [rubygems](https://rubygems.org/gems/scanpay) and you can install it with:\n\n```bash\ngem install scanpay\n```\nAnd include it in your project:\n\n```ruby\nrequire 'scanpay'\nclient = Scanpay::Client.new('API key')\n```\n\n### Manual installation\n\nDownload the [latest release](https://github.com/scanpaydk/ruby-scanpay/releases) and include in into your project:\n\n```ruby\nrequire_relative 'lib/scanpay'\nscanpay = Scanpay::Client.new('API key')\n```\n\n## Usage\nThe API documentation is available [here](https://docs.scanpay.dk/). Most methods accept an optional per-request object with [options](#options), here referred to as `options`.\n\nCreate a Scanpay client to start using this library:\n```ruby\nscanpay = Scanpay::Client.new(' APIKEY ')\n```\n### Payment Link\n\n#### newURL(Object, options)\n\nCreate a link to our hosted payment window ([docs](https://docs.scanpay.dk/payment-link) \\| [example](tests/newURL.rb)).\n\n```ruby\norder = {\n    'items' =\u003e [{ 'total' =\u003e '199.99 DKK' }]\n];\nputs \"Payment url: #{scanpay.newURL(order, options)}\"\n```\n### Synchronization\nTo know when transactions, charges, subscribers and subscriber renewal succeeds, you need to use the synchronization API. It consists of pings which notify you of changes, and the seq request which allows you to pull changes.\n#### handlePing(String, String)\nHandle and validate synchronization pings. The method accepts two arguments, the body of the received ping and the `X-Signature` HTTP header. The method returns a hash ([docs](https://docs.scanpay.dk/synchronization#ping-service) \\| [example](tests/handlePing.rb)).\n\n```ruby\njson = scanpay.handlePing(body, signature)\n```\n\n#### seq(Integer, options)\n\nMake a sequence request to pull changes after a specified sequence number ([docs](https://docs.scanpay.dk/synchronization#sequence-request) \\| [example](tests/seq.rb)).\n\n```ruby\nlocalSeq = 921;\nseqobj = scanpay.seq(localSeq, options)\n```\n\n### Transactions\n\n#### capture(Integer, Object, options)\nUse Capture to capture a transaction. ([docs](https://docs.scanpay.dk/transactions) \\| [example](tests/capture.rb)).\n```ruby\ntransactionId = 5;\ndata = {\n    'total' =\u003e '123 DKK',\n    'index' =\u003e 0,\n];\nscanpay.capture(transactionId, data, options)\n```\n\n#### refund(Integer, Object, options)\nUse Refund to refund a captured transaction ([docs](https://docs.scanpay.dk/transactions) \\| [example](tests/refund.rb)).\n```ruby\ntransactionId = 5;\ndata = {\n    'total' =\u003e '123 DKK',\n    'index' =\u003e 0,\n];\nscanpay.refund(transactionId, data, options)\n```\n\n#### void(Integer, Object, options)\nUse Void to void the amount authorized by the transaction ([docs](https://docs.scanpay.dk/transactions) \\| [example](tests/void.rb)).\n```ruby\ntransactionId = 5;\ndata = {\n    'index' =\u003e 0,\n];\nscanpay.void(transactionId, data, options)\n```\n\n### Subscriber\nCreate a subscriber by using newURL with a Subscriber parameter ([docs](https://docs.scanpay.dk/subscriptions/) \\| [example](tests/newURL-subscriber.rb)).\n```ruby\norder = {\n    'subscriber' =\u003e { 'ref' =\u003e 'sub123' },\n];\nputs \"Payment url: #{scanpay.newURL(order, options)}\"\n```\n#### charge(Integer, Object, options)\nUse charge to charge a subscriber. The subscriber id is obtained with seq ([docs](https://docs.scanpay.dk/subscriptions/charge-subscriber) \\| [example](tests/charge.rb)).\n```ruby\nsubscriberId = 11;\ndata = {\n    'items' =\u003e [{ 'total' =\u003e '199.99 DKK' }],\n];\nscanpay.charge(subscriberId, data, options)\n```\n#### renew(Integer, Object, options)\nUse renew to renew a subscriber, i.e. to attach a new card, if it has expired [docs](https://docs.scanpay.dk/subscriptions/renew-subscriber) \\| [example](tests/renew.rb)).\n```ruby\nsubscriberId = 11;\ndata = {\n    'successurl' =\u003e 'https://scanpay.dk',\n];\nscanpay.renew(subscriberId, data, options)\n```\n\n## Options\n\nAll methods, except `handlePing`, accept an optional per-request `options` hash. You can use this to:\n\n* Set the API key for this request ([example](tests/newURL.rb#L11))\n* Set HTTP headers, e.g. the highly recommended `X-Cardholder-IP` ([example](tests/newURL.rb#L10-L13))\n* Change the hostname to use our test environment `api.test.scanpay.dk` ([example](tests/newURL.rb#L9))\n* Enable debugging mode ([example](tests/newURL.rb#L14))\n\n## License\n\nEverything in this repository is licensed under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscanpay%2Fruby-scanpay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscanpay%2Fruby-scanpay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscanpay%2Fruby-scanpay/lists"}