
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
A Ruby gem wrapping the inpay.com merchant API.
Any Ruby on Rails developer who wants/needs to work with inpay.
gem install inpay
By default the environment is set to test. Add the following line to the environments/production.rb:
Inpay::Config.mode = :production
You will also need to define the IP (or IPs) you will accept postbacks form. Add a private method in your application controller, something like this:
private
def set_inpay_ips
Inpay::Config.server_ips = 'xxx.xxx.xxx.xxx'
end
You can also use an array:
private
def set_inpay_ips
Inpay::Config.server_ips = ['xxx.xxx.xxx.xxx', 'xxx.xxx.xxx.xxx', 'xxx.xxx.xxx.xxx']
end
In the controller that will process the postback add a before filter:
before_filter :set_inpay_ips
Create a form tag and use the inpay_setup method to generate the necessary hidden fields:
<%= form_tag inpay_flow_url do %>
<%= raw inpay_setup(amount, options) %>
<% end %>
The amount can be either a float or a Money object. Options should be passed as a hash with symbolized keys.
These are all required options:
These are nonmandatory:
An Inpay postback controller might look something like this:
class InpaysController < ApplicationController
skip_before_filter :verify_authenticity_token
def postback
begin
@postback = Inpay::Postback.new(request, _your_inpay_secret_key_ )
if @postback.genuine?
if @postback.approved?
... yay ...
else
... meh ...
end
end
rescue Exception => e
... handle the error ...
end
render :nothing => true
end
end
Important: make sure no errors are thrown when something goes wrong. Logically Inpay will see this as a failure and keep on sending postbacks. Hence the begin/rescue block.
The Inpay::Postback instance has a lot of methods for the result of the transactions:
The inpay server will post back the following params:
You might need some of those params to fetch the invoice, status and so on.
This gem is written for Rails 3. Rails 2 might work but it's not tested.
Copyright (c) 2011 Wout Fierens. See LICENSE.txt for further details.
FAQs
Unknown package
We found that inpay demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.