A Ruby Library wrapper to the Payflow Gateway. This gem was created specifically to add magnetic card reader and decryption support not found in any other Payflow gems.
Add this line to your application's Gemfile:
gem 'payflow'
And then execute:
$ bundle
Or install it yourself as:
$ gem install payflow
credit_card = Payflow::CreditCard.new(encrypted_track_data: "XXXXXXXXXXXX")
gateway = Payflow::Gateway.new(OpenStruct.new(login: "me", password: "credentials", partner: "PayPal"))
response = gateway.sale(100, credit_card)
response = gateway.authorize(10, credit_card)
gateway.capture(10, response.authorization_token)
gateway.sale(10, response.authorization_token)
The Payflow gem also supports the Payflow Report API. This is a separate API but supports the same credentials.
report = Payflow::SettlementReport.new(OpenStruct.new(login: "me", password: "password", partner: "PayPal"))
if report.create_report("YOUR PROCESSOR", "2013-01-01", "2013-01-02").successful?
report.fetch
end
Available Reports
- SettlementReport - Gives Transaction Detail including Batch IDs
- BatchReport - Gives Summary data about settlement batches
The gateway initialization includes a test and mock setting. Test will use the Payflow pilot server and Mock will return a MockResponse that inherits from Payflow::Response so that you can use it exactly as you would a real response
gateway = Payflow::Gateway.new(OpenStruct.new(login: "me", password: "credentials", partner: "PayPal"), {test: true, mock: true})
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request