{"id":28409256,"url":"https://github.com/paymentwall/paymentwall-ruby","last_synced_at":"2025-06-25T00:31:23.374Z","repository":{"id":44907292,"uuid":"14474647","full_name":"paymentwall/paymentwall-ruby","owner":"paymentwall","description":"Paymentwall Ruby Library","archived":false,"fork":false,"pushed_at":"2022-01-19T13:25:15.000Z","size":31,"stargazers_count":9,"open_issues_count":5,"forks_count":12,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-06-02T15:16:20.242Z","etag":null,"topics":[],"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/paymentwall.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":"2013-11-17T20:51:30.000Z","updated_at":"2021-09-22T09:56:02.000Z","dependencies_parsed_at":"2022-08-26T08:01:20.255Z","dependency_job_id":null,"html_url":"https://github.com/paymentwall/paymentwall-ruby","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/paymentwall/paymentwall-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paymentwall%2Fpaymentwall-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paymentwall%2Fpaymentwall-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paymentwall%2Fpaymentwall-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paymentwall%2Fpaymentwall-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paymentwall","download_url":"https://codeload.github.com/paymentwall/paymentwall-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paymentwall%2Fpaymentwall-ruby/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261782161,"owners_count":23208901,"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":"2025-06-02T06:17:58.440Z","updated_at":"2025-06-25T00:31:23.363Z","avatar_url":"https://github.com/paymentwall.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About Paymentwall\n\n[Paymentwall](http://paymentwall.com/?source=gh) is the leading digital payments platform for globally monetizing digital goods and services. Paymentwall assists game publishers, dating sites, rewards sites, SaaS companies and many other verticals to monetize their digital content and services. \nMerchants can plugin Paymentwall's API to accept payments from over 100 different methods including credit cards, debit cards, bank transfers, SMS/Mobile payments, prepaid cards, eWallets, landline payments and others. \n\nTo sign up for a Paymentwall Merchant Account, [click here](http://paymentwall.com/signup/merchant?source=gh).\n\n# Paymentwall Ruby Library\n\nThis library allows developers to use [Paymentwall APIs](http://paymentwall.com/en/documentation/API-Documentation/722?source=gh) (Virtual Currency, Digital Goods featuring recurring billing, and Virtual Cart).\n\nTo use Paymentwall, all you need to do is to sign up for a Paymentwall Merchant Account so you can setup an Application designed for your site.\nTo open your merchant account and set up an application, you can [sign up here](http://paymentwall.com/signup/merchant?source=gh).\n\n# Installation\n\n```\ngem install paymentwall\n```\n\nAlternatively, you can download the [ZIP archive](https://github.com/paymentwall/paymentwall-ruby/archive/master.zip), unzip it and place into your project.\n\nAlternatively, you can run:\n\n```\ngit clone git://github.com/paymentwall/paymentwall-ruby.git\n```\n\nThen use a code sample below.\n\n# Code Samples\n\n## Digital Goods API\n\n### Initializing Paymentwall\n\n```rb\nrequire 'paymentwall' # alternatively, require_relative '/path/to/paymentwall-ruby/lib/paymentwall.rb'\nPaymentwall::Base::setApiType(Paymentwall::Base::API_GOODS)\nPaymentwall::Base::setAppKey('YOUR_APPLICATION_KEY') # available in your Paymentwall merchant area\nPaymentwall::Base::setSecretKey('YOUR_SECRET_KEY') # available in your Paymentwall merchant area\n```\n\n### Widget Call\n\n[Web API details](http://www.paymentwall.com/en/documentation/Digital-Goods-API/710#paymentwall_widget_call_flexible_widget_call)\n\nThe widget is a payment page hosted by Paymentwall that embeds the entire payment flow: selecting the payment method, completing the billing details, and providing customer support via the Help section. You can redirect the users to this page or embed it via iframe. Below is an example that renders an iframe with Paymentwall Widget.\n\n```rb\nwidget = Paymentwall::Widget.new(\n  'user40012',   # id of the end-user who's making the payment\n  'pw',        # widget code, e.g. pw; can be picked inside of your merchant account\n  [              # product details for Flexible Widget Call. To let users select the product on Paymentwall's end, leave this array empty\n    Paymentwall::Product.new(\n      'product301',                            # id of the product in your system\n      9.99,                                    # price\n      'USD',                                   # currency code\n      'Gold Membership',                       # product name\n      Paymentwall::Product::TYPE_SUBSCRIPTION, # this is a time-based product\n      1,                                       # duration is 1\n      Paymentwall::Product::PERIOD_TYPE_MONTH, #               month\n      true                                     # recurring\n    )\n  ],\n  {'email' =\u003e 'user@hostname.com'}                 # additional parameters\n)\nputs widget.getHtmlCode()\n```\n\n### Pingback Processing\n\nThe Pingback is a webhook notifying about a payment being made. Pingbacks are sent via HTTP/HTTPS to your servers. To process pingbacks use the following code:\n\n```rb\npingback = Paymentwall::Pingback.new(request_get_params, request_ip_address)\nif pingback.validate()\n  productId = pingback.getProduct().getId()\n  if pingback.isDeliverable()\n    # deliver the product\n  elsif pingback.isCancelable()\n    # withdraw the product\n  end \n  puts 'OK' # Paymentwall expects response to be OK, otherwise the pingback will be resent\nelse\n  puts pingback.getErrorSummary()\nend\n```\n\n## Virtual Currency API\n\n### Initializing Paymentwall\n\n```rb\nrequire_relative '/path/to/paymentwall-ruby/lib/paymentwall.rb'\nPaymentwall::Base::setApiType(Paymentwall::Base::API_VC)\nPaymentwall::Base::setAppKey('YOUR_APPLICATION_KEY') # available in your Paymentwall merchant area\nPaymentwall::Base::setSecretKey('YOUR_SECRET_KEY') # available in your Paymentwall merchant area\n```\n\n### Widget Call\n\n```rb\nwidget = Paymentwall::Widget.new(\n  'user40012', # id of the end-user who's making the payment\n  'p1_1',      # widget code, e.g. p1; can be picked inside of your merchant account\n  [],          # array of products - leave blank for Virtual Currency API\n  {'email' =\u003e 'user@hostname.com'} # additional parameters\n)\nputs widget.getHtmlCode()\n```\n\n### Pingback Processing\n\n```rb\npingback = Paymentwall::Pingback.new(request_get_params, request_ip_address)\nif pingback.validate()\n  virtualCurrency = pingback.getVirtualCurrencyAmount()\n  if pingback.isDeliverable()\n    # deliver the virtual currency\n  elsif pingback.isCancelable()\n    # withdraw the virual currency\n  end \n  puts 'OK' # Paymentwall expects response to be OK, otherwise the pingback will be resent\nelse\n  puts pingback.getErrorSummary()\nend\n```\n\n## Cart API\n\n### Initializing Paymentwall\n\n```rb\nrequire_relative '/path/to/paymentwall-ruby/lib/paymentwall.rb'\nPaymentwall::Base::setApiType(Paymentwall::Base::API_CART)\nPaymentwall::Base::setAppKey('YOUR_APPLICATION_KEY') # available in your Paymentwall merchant area\nPaymentwall::Base::setSecretKey('YOUR_SECRET_KEY') # available in your Paymentwall merchant area\n```\n\n### Widget Call\n\n```rb\nwidget = Paymentwall::Widget.new(\n  'user40012', # id of the end-user who's making the payment\n  'p1_1',      # widget code, e.g. p1; can be picked inside of your merchant account,\n  [\n    Paymentwall::Product.new('product301', 3.33, 'EUR'), # first product in cart\n    Paymentwall::Product.new('product607', 7.77, 'EUR')  # second product in cart\n  ],\n  {'email' =\u003e 'user@hostname.com'} # additional params\n)\nputs widget.getHtmlCode()\n```\n\n### Pingback Processing\n\n```rb\npingback = Paymentwall::Pingback.new(request_get_params, request_ip_address)\nif pingback.validate()\n  products = pingback.getProducts()\n  if pingback.isDeliverable()\n    # deliver the products\n  elsif pingback.isCancelable()\n    # withdraw the products\n  end \n  puts 'OK' # Paymentwall expects response to be OK, otherwise the pingback will be resent\nelse\n  puts pingback.getErrorSummary()\nend\n```\n# Testing this gem\n\nTo run this gem's test suite locally, follow the steps below.\n \n```\n# Clone the repository\ngit clone git@github.com:paymentwall/paymentwall-ruby.git\n \n# Install dependencies with Bundler\ncd paymentwall-ruby\nbundle install\n \n# Run tests\nrake\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaymentwall%2Fpaymentwall-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaymentwall%2Fpaymentwall-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaymentwall%2Fpaymentwall-ruby/lists"}