Skip to content
This repository

Light wrapper for Paypal's Adaptive Payment API

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 config
Octocat-spinner-32 lib
Octocat-spinner-32 templates
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 paypal_adaptive.gemspec


This gem is a lightweight wrapper for the paypal adaptive payments API.

This is very much a work in progress! Use at your own risk or submit bug fixes :)

Before you need start, download pp_adaptivepayments.pdf and IPNGuide.pdf from the Paypal's dev site It'll be invaluable in determining how certain things work and error messages.


Make the paymenet request:

pay_request =

data = {
"returnUrl" => "", 
"requestEnvelope" => {"errorLanguage" => "en_US"},
"receiverList"=>{"receiver"=>[{"email"=>"", "amount"=>"10.00"}]},

pp_response =

if pp_response.success?
  redirect_to pp_response.approve_paypal_payment_url
  puts pp_response.errors.first['message']
  redirect_to failed_payment

Once the user goes to pp_response.approve_paypal_payment_url, they will be prompted to login to Paypal for payment.

Upon payment completion page, they will be redirected to

They can also click cancel to go to

The actual payment details will be sent to your server via "ipnNotificationUrl" You have to create a listener to receive POST messages from paypal. I added a Rails metal template in the templates folder which handles the callbcak.


Copyright (c) 2009 Tommy Chheng. See LICENSE for details.

Something went wrong with that request. Please try again.