Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby client library for PoundPay
Ruby

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples/simple_application
lib
spec
.autotest
.gitignore
.rspec
.rvmrc
Gemfile
README.rdoc
Rakefile
poundpay.gemspec

README.rdoc

Poundpay

Poundpay is a payments platform for marketplaces

Adding Poundpay to Rails

  1. Add the following to your Gemfile

    gem 'poundpay', '~> 0.2.0'
  2. At the command prompt, install the gem with bundler

    bundle install
  3. Add your configuration to config/poundpay.yml in your Rails project

    development:
      developer_sid: DV0383d447360511e0bbac00264a09ff3c
      auth_token: c31155b9f944d7aed204bdb2a253fef13b4fdcc6ae1540200449cc4526b2381a
      www_url: https://www-sandbox.poundpay.com
      api_url: https://api-sandbox.poundpay.com
    
    production:
      developer_sid: DV8dd93f0f3c6411e0863f00264a09ff3c
      auth_token: d8c4ea1bafd3fcac8c1062a72c22bcdb09321deb1041df257165cd6449def0de
  4. Protect your callback controller

    before_filter :verify_poundpay_callback

Creating a payment

Adding the payer_sid (from a previous payment), will cause the payer to see the repeat flow when they are not prompted to reenter their credit card information

@payment = Poundpay::Payment.create(
  :amount                  => 20000,
  :payer_fee_amount        => 0,
  :payer_email_address     => "fred@example.com",
  :payer_sid               => "97f51e5c38e211e08625e7af17bae06a",  # Optional
  :recipient_fee_amount    => 500,
  :recipient_email_address => "david@example.com",
  :description             => "Beats by Dr. Dre",
)

Serving IFRAME

<script src="https://www.poundpay.com/js/poundpay.js"></script>

<div id="pound-root"></div>

<script>
  function handlePaymentSuccess() {
    // do something
  }

  function handlePaymentError() {
    // handle error
  }

  PoundPay.init({
    payment_sid: <%= @payment.sid %>,
    success: handlePaymentSuccess,
    error: handlePaymentError,
    cardholder_name: "Fred Nietzsche", // Optional
    phone_number: "4085551234", // Optional
    server: "#{Poundpay.www_url}"
  });
</script>

Releasing a payment

payment = Payment.find(payment_sid)
payment.release
Something went wrong with that request. Please try again.