{"id":19599353,"url":"https://github.com/kaakati/hyperpay_ruby","last_synced_at":"2025-04-27T16:32:04.308Z","repository":{"id":226184470,"uuid":"767988999","full_name":"Kaakati/hyperpay_ruby","owner":"Kaakati","description":"HyperPay is a powerful payment gateway, transforming the online buying experience in the MENA region. HyperPay enable internet businesses to accept and manage payments online, with more flexibility, security and ease.  HyperPay have been processing online payments since 2014.","archived":false,"fork":false,"pushed_at":"2024-03-08T11:59:59.000Z","size":51,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-15T12:08:49.239Z","etag":null,"topics":["hyperpay","hyperpay-sdk","hyperpaysdk","ruby","rubygem","rubygems"],"latest_commit_sha":null,"homepage":"https://hyperpay.com","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/Kaakati.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-03-06T09:11:19.000Z","updated_at":"2024-03-06T11:47:10.000Z","dependencies_parsed_at":"2024-03-10T03:45:22.567Z","dependency_job_id":null,"html_url":"https://github.com/Kaakati/hyperpay_ruby","commit_stats":null,"previous_names":["kaakati/hyperpay_ruby"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kaakati%2Fhyperpay_ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kaakati%2Fhyperpay_ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kaakati%2Fhyperpay_ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kaakati%2Fhyperpay_ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kaakati","download_url":"https://codeload.github.com/Kaakati/hyperpay_ruby/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251171441,"owners_count":21547112,"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":["hyperpay","hyperpay-sdk","hyperpaysdk","ruby","rubygem","rubygems"],"created_at":"2024-11-11T09:09:49.978Z","updated_at":"2025-04-27T16:32:03.948Z","avatar_url":"https://github.com/Kaakati.png","language":"Ruby","readme":"\n# HyperPay \u0026 PeachPayments\n\nThis Ruby Gem will work with any of the payment gateways provided by **Open Payment Platform (OPP) COPYandPAY**, such as HyperPay and PeachPayments,\nInitially, it was built to work with HyperPay, but it can be easily used to work with PeachPayments.\n\n\u003cimg src=\"peachpayments-logo.svg\" height=\"70\"\u003e\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cimg src=\"Hyperpay-logo-svg-1.png\" height=\"120\"\u003e\n\nHyperPay is a powerful payment gateway, transforming the online buying experience in the MENA region. HyperPay enable internet businesses to accept and manage payments online, with more flexibility, security and ease.\n\nHyperPay have been processing online payments since 2014. Today, HyperPay go beyond the payment gateway, as we provide merchants across almost every industry, a full-suite of online payment solutions, to serve every need.\n\n---\n\n- [HyperPay API Documentation](https://wordpresshyperpay.docs.oppwa.com/)\n- [PeachPayments API Documentation](https://peachpayments.docs.oppwa.com/)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage Example](#usage-example)\n- [Generate Checkout ID Response](#response)\n- [Payment Success Response](#success-response)\n- [Response Code Interpretation](#response-code-interpretation)\n- [BackOffice Operations](#backoffice-operations)\n\n---\n## Installation\n\n```ruby\ngem 'HyperPay'\n```\n\n---\n\n## Configuration\n\n`config/initializers/hyperpay.rb`\n```ruby\nrequire 'hyper_pay'\n\nHyperPay.configure do |config|\n  config.authorization = \"HYPER_PAY_AUTH_TOKEN\"\n  config.environment = :sandbox\nend\n```\n\n---\n\n## Usage example\n\n### Generate Checkout ID\n```ruby\n  checkout = HyperPay::CopyAndPay.new.create_checkout_id do |params|\n    params.add \"entityId\", \"HYPER_PAY_ENTITY_ID\"\n    params.add \"customer.email\", \"john@doe.com\"\n    params.add \"customer.mobile\", \"9665xxxxxxxx\"\n    params.add \"customer.givenName\", \"John\"\n    params.add \"customer.surname\", \"Doe\"\n    params.add \"billing.street1\", \"STREET_NAME\"\n    params.add \"billing.country\", \"SA\"\n    params.add \"billing.city\", \"Riyadh\"\n    params.add \"billing.state\", \"\"\n    params.add \"billing.postcode\", \"00000\"\n    params.add \"customParameters[3DS2_enrolled]\", \"true\"\n    params.add \"merchantTransactionId\", \"YOUR_INVOICE_NUMBER\"\n    params.add \"paymentType\", \"DB\"\n    params.add \"currency\", \"SAR\"\n    params.add \"amount\", \"100\" # On Sandbox, HyperPay Can process non-decimal numbers only.\n  end\n\n  p checkout['id']\n  p checkout['result']['code']\n  p checkout['result']['description']\n\n```\n\n### Response\n```ruby\n{\n  \"result\"=\u003e{\n    \"code\"=\u003e\"000.200.100\", \n    \"description\"=\u003e\"successfully created checkout\"\n  }, \n  \"buildNumber\"=\u003e\"a58fee65f51ad5776b3c44e9929ca39a62a7cb43@2024-03-04 12:55:38 +0000\", \n  \"timestamp\"=\u003e\"2024-03-05 13:50:22+0000\", \n  \"ndc\"=\u003e\"ABCE449B5FC84ED5A1C7174840C7A3F8.uat01-vm-tx03\", \n  \"id\"=\u003e\"ABCE449B5FC84ED5A1C7174840C7A3F8.uat01-vm-tx03\"\n}\n```\n\n-----\n### Get Payment Status for Checkout ID\n[Code Interpretation](#response-code-interpretation)\n```ruby\n  checkout = HyperPay::CopyAndPay.new.get_status(entity_id: \"\", checkout_id: \"\")\n  p checkout['id']\n  p checkout['result']['code']\n  p checkout['result']['description']\n```\n\n### Pending Response\n```ruby\n{\n  \"result\"=\u003e{\n    \"code\"=\u003e\"000.200.000\", \n    \"description\"=\u003e\"transaction pending\"\n  }, \n  \"buildNumber\"=\u003e\"a58fee65f51ad5776b3c44e9929ca39a62a7cb43@2024-03-04 12:55:38 +0000\", \n  \"timestamp\"=\u003e\"2024-03-05 13:50:29+0000\", \n  \"ndc\"=\u003e\"ABCE449B5FC84ED5A1C7174840C7A3F8.uat01-vm-tx03\"\n}\n```\n\n### Success Response\n```ruby\n{ \n  \"id\"=\u003e\"8ac7a4a08e10b158018e1486506e0397\",\n  \"paymentType\"=\u003e\"DB\", \n  \"paymentBrand\"=\u003e\"VISA\", \n  \"amount\"=\u003e\"600.00\", \n  \"currency\"=\u003e\"SAR\", \n  \"descriptor\"=\u003e\"0000.0000.0000 Company Name\",\n  \"merchantTransactionId\"=\u003e\"139895288\", \n  \"result\"=\u003e{\n    \"code\"=\u003e\"000.000.000\", \n    \"description\"=\u003e\"Transaction succeeded\"\n  },\n  \"resultDetails\"=\u003e{\n    \"ExtendedDescription\"=\u003e\"Successfully processed\", \n    \"ProcStatus\"=\u003e\"0\", \n    \"clearingInstituteName\"=\u003e\"NCB BANK\", \n    \"AuthCode\"=\u003e\"f2e7a815c3\",\n    \"ConnectorTxID1\"=\u003e\"8ac7a4a08e10b158018e1486506e0397\", \n    \"ConnectorTxID3\"=\u003e\"10b158018e1486506e0397\", \n    \"ConnectorTxID2\"=\u003e\"8ac7a4a0\", \n    \"AcquirerResponse\"=\u003e\"00\",\n    \"EXTERNAL_SYSTEM_LINK\"=\u003e\"https://csi-test.retaildecisions.com/RS60/TransDetail.aspx?oid=000194001101S2E20110926045038668\u0026support=Link+to+Risk+Details\", \n    \"TermID\"=\u003e\"71F00820\",\n    \"OrderID\"=\u003e\"8316384413\"\n  },\n  \"card\"=\u003e{\n    \"bin\"=\u003e\"411111\", \n    \"binCountry\"=\u003e\"PL\", \n    \"last4Digits\"=\u003e\"1111\", \n    \"holder\"=\u003e\"DFGY\", \n    \"expiryMonth\"=\u003e\"05\", \n    \"expiryYear\"=\u003e\"2025\", \n    \"issuer\"=\u003e{\n      \"bank\"=\u003e\"CONOTOXIA SP. Z O.O\"\n    }, \n    \"type\"=\u003e\"DEBIT\", \n    \"level\"=\u003e\"CLASSIC\", \n    \"country\"=\u003e\"PL\", \n    \"maxPanLength\"=\u003e\"16\", \n    \"binType\"=\u003e\"PERSONAL\", \n    \"regulatedFlag\"=\u003e\"N\"\n  }, \n  \"customer\"=\u003e{\n    \"givenName\"=\u003e\"Mohamad\", \n    \"surname\"=\u003e\"Kaakati\", \n    \"mobile\"=\u003e\"966540000000\", \n    \"email\"=\u003e\"john@doe.com\", \n    \"ip\"=\u003e\"0.0.0.0\", \n    \"ipCountry\"=\u003e\"SA\"\n  }, \n  \"billing\"=\u003e{\n    \"street1\"=\u003e\"Saudi Arabia\", \n    \"city\"=\u003e\"Jeddah\", \n    \"country\"=\u003e\"SA\"\n  }, \n  \"threeDSecure\"=\u003e{\n    \"eci\"=\u003e\"05\", \n    \"xid\"=\u003e\"CAACCVVUlwCXUyhQNlSXAAAAAAA=\", \n    \"authenticationStatus\"=\u003e\"Y\"\n  }, \n  \"customParameters\"=\u003e{\n    \"SHOPPER_MSDKIntegrationType\"=\u003e\"Checkout UI\", \n    \"SHOPPER_device\"=\u003e\"Apple iPhone 15 Pro\", \n    \"CTPE_DESCRIPTOR_TEMPLATE\"=\u003e\"\", \n    \"SHOPPER_OS\"=\u003e\"iOS 17.4\", \n    \"SHOPPER_MSDKVersion\"=\u003e\"4.12.0\", \n    \"3DS2_enrolled\"=\u003e\"true\"\n  }, \n  \"risk\"=\u003e{\n    \"score\"=\u003e\"100\"\n  }, \n  \"buildNumber\"=\u003e\"e41989c9076807bb305850f77ce20740230863b9@2024-03-05 14:10:27 +0000\", \n  \"timestamp\"=\u003e\"2024-03-06 16:08:56+0000\", \n  \"ndc\"=\u003e\"67F1CF7891ADB9400CD013BC77A4CE5C.uat01-vm-tx03\"\n}\n```\n\n## Response Code Interpretation\n\nNow, anywhere in your application where you have a response code from HyperPay that you want to interpret, you can easily get its meaning:\n\n```ruby\nbase = HyperPay::Base.new\nresult = base.interpret_response_code(\"000.100.1\")\nputs result # :transaction_succeeded\n\ncase result\nwhen :transaction_succeeded\n  # Do something\nwhen :transaction_succeeded_review\n  # Do something\nwhen :transaction_declined\n  # Do something\nwhen :transaction_pending\n  # Do something\nwhen :transaction_failed\n  # Do something\nwhen :rejected_communication_error\n  # Do something\nwhen :rejected_system_error\n  # Do something\nwhen :rejected_for_risk\n  # Do something\nwhen :reject_blacklist\n  # Do something\nwhen :reject_risk_validation\n  # Do something\nwhen :reject_due_validation\n  # Do something\nelse\n  # Do something\nend\n```\n\n---\n\n## BackOffice Operations\n\n### Capture Payment\n```ruby\nHyperPay::CopyAndPay.new.capture_payment(entity_id: \"\", checkout_id: \"\", amount: \"\", currency: \"\")\n```\n\n### Refund Payment\n```ruby\nHyperPay::CopyAndPay.new.refund_payment(entity_id: \"\", checkout_id: \"\", amount: \"\", currency: \"\")\n```\n\n### Reverse a payment\n```ruby\nHyperPay::CopyAndPay.new.reverse_payment(entity_id: \"\", checkout_id: \"\")\n```\n\n\n## Authors\n\n- [Mohamad Kaakati (@kaakati)](https://www.github.com/kaakati)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaakati%2Fhyperpay_ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaakati%2Fhyperpay_ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaakati%2Fhyperpay_ruby/lists"}