0.01
No commit activity in last 3 years
No release in over 3 years
Paypal NVP API Class.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.6.0
 Project Readme

Paypal NVP¶ ↑

<img src=“https://www.travis-ci.org/railslove/Will-Paypal.png?branch=master” alt=“Build Status” />

Will Paypal allow to connect your Ruby on Rails application to the Paypal NVP API. It’s based on the Paypal NVP Gem github.com/solisoft/paypal_nvp but completely rewritten.

Installation¶ ↑

The recommended way is that you get the gem:

$ sudo gem install will_paypal

Specify the API-Credentials within the constructor, add a logger. You can also use a ‘settings.yml’ to put everything there

# All those fields are mandatory

sandbox:
  url:  "https://api-3t.sandbox.paypal.com/nvp" (default)
  user: "o.bonn_1237393081_biz_api1.solisoft.net"
  password: "1237393093"
  signature:  "AU2Yv5COwWPCfeYLv34Z766F-gfNAzX6LaQE6VZkHMRq35Gmite-bMXu"
  version: "72.0" (default)

live:
  url:  "https://api-3t.paypal.com/nvp" (default)
  user: "o.bonn_1237393081_biz_api1.solisoft.net"
  password: "1237393093"
  signature:  "AU2Yv5COwWPCfeYLv34Z766F-gfNAzX6LaQE6VZkHMRq35Gmite-bMXu"
  version: "72.0" (default)

Example usage¶ ↑

p = WillPaypal.new(:user => Settings.payment.paypal.merchant, :password => Settings.payment.paypal.pass, :sandbox => Settings.payment.paypal.sandbox, :signature => Settings.payment.paypal.cert, :version => "72.0", :logger => logger)

data = {
  :method => "MyPaypalMethod",
  :amt => "55"
  # other params needed
}
result = p.call_paypal(data) # will return a hash
puts result[:parsed_body]["ACK"] # Success

The Result-Hash looks like that:

  :parsed_body=>{
    "TIMESTAMP"=>"2011-05-19T00:25:19Z",
    "BUILD"=>"1882144",
    "VERSION"=>"72.0",
    "CORRELATIONID"=>"correlationid",
    "TOKEN"=>"mytoken",
    "ACK"=>"Success"
    },
  :status=>"200",
  :body=>"TOKEN=mytoken&TIMESTAMP=2011%2d05%2d19T00%3a25%3a19Z&CORRELATIONID=correlationid&ACK=Success&VERSION=72%2e0&BUILD=1882144"

PAYPAL API Documentation¶ ↑

cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/howto_api_reference