Git Product home page Git Product logo

payflow-ruby's Introduction

Payflow

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.

Installation

Add this line to your application's Gemfile:

gem 'payflow'

And then execute:

$ bundle

Or install it yourself as:

$ gem install payflow

Usage

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)

Authorize and Delayed Capture

response = gateway.authorize(10, credit_card)
gateway.capture(10, response.authorization_token)

Making a sale from a tokenized payment method

gateway.sale(10, response.authorization_token)

Reports

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

Testing

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})

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

payflow-ruby's People

Contributors

cmschuler7 avatar intractablequery avatar jhuckabee avatar jspies avatar litch avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.