Ruby wrapper for interacting with the Priority Payout Gateway. Priority Payout Gateway is a white label gateway for NMI.

gem install priority_payout_gateway -v 0.9.2


Gem Version

Priority Payout Gateway

This gem implements the Priority Payout Gateway (NMI) Direct Post & Query API sets as documented here:


Add this line to your application's Gemfile:

gem 'priority_payout_gateway'

And then execute:

$ bundle

Or install it yourself as:

$ gem install priority_payout_gateway


Set your username & password in an environment variable in your application or in a .env file directly from the gem:

PPG_USERNAME = my_user
PPG_PASSWORD = my_pass

There are three API sets:


Sale ccnumber: '4111111111111111', ccexp: "0219", first_name: "John", last_name: "Doe", amount: 22.30, email: "", country: "US"

Authorize ccnumber: '4111111111111111', ccexp: "0219", first_name: "John", last_name: "Doe", amount: 22.25, email: "", country: "US"

Capture transactionid: 3261830498, amount: 22.30

Void transactionid: 3261830498, amount: 22.30

Refund transactionid: 3261844010, amount: 5

Update transactionid: 3261844010, first_name: "joe"

Find Implements Query Api - transactionid: 3261844010

Credit ccnumber: '4111111111111111', ccexp: "0219", first_name: "John", last_name: "Doe", amount: 22.30, email: "", country: "US"

Validate ccnumber: '4111111111111111', ccexp: "0219", first_name: "John", last_name: "Doe",  email: "", country: "US"

Customer Vault

Create ccnumber: '4111111111111111', ccexp: "0219", first_name: "John", last_name: "Doe"

Update customer_vault_id: 481397475, ccnumber: '4111111111111111', ccexp: "0220", first_name: "Jane", last_name: "Doe"

Destroy customer_vault_id: 481397475

Find Implements Query Api - customer_vault_id: 481397475


Create Plan plan_amount: 1.99, plan_name: "Test 1.99", plan_id: "test-1", month_frequency: 1, day_of_month: 1

Add Subscription To Plan plan_id: "test-1", customer_vault_id: 664625840

Add Custom Subscription plan_amount: 1.99, month_frequency: 1, day_of_month: 1,  customer_vault_id: 664625840

Update Subscription subscription_id: "3261766445", first_name: "John", last_name: "Doe"

Delete Subscription subscription_id: "3261766445"


After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to


Bug reports and pull requests are welcome on GitHub at


The gem is available as open source under the terms of the MIT License.