Project

qpay-rails

0.0
The project is in a healthy, maintained state
Rails engine for QPay V2 payment API with view helpers and webhook support
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 1.0
>= 7.0
 Project Readme

QPay Rails

Gem CI License: MIT

QPay V2 payment integration for Rails.

Install

gem "qpay-rails"
rails generate qpay:install

Usage

client = QPay::Rails.client
invoice = client.create_simple_invoice(
  invoice_code: "YOUR_CODE",
  sender_invoice_no: "ORDER-001",
  amount: 10000,
  callback_url: "https://yoursite.com/qpay/webhooks"
)

View Helpers

<%= qpay_qr_code(invoice.qr_image) %>
<%= qpay_payment_links(invoice.urls) %>

Webhook

QPay sends a GET request with ?qpay_payment_id=... when payment is completed. The engine handles verification automatically.

Subscribe to payment events:

ActiveSupport::Notifications.subscribe("payment_received.qpay") do |_name, _start, _finish, _id, payload|
  payment_id = payload[:payment_id]
  result = payload[:result] # QPay::PaymentDetail
  # handle payment
end

License

MIT