Project

pandapay

0.0
No commit activity in last 3 years
No release in over 3 years
PandaPay Ruby Bindings
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.11
>= 0
~> 5.0
~> 10.0

Runtime

~> 1.43.0
 Project Readme

PandaPay Stripe Bindings

This is an early development release of the PandaPay Ruby bindings. Currently, only PandaPay Ecommerce integration with Stripe Connect is supported.

Installation

  gem install pandapay

Usage

The PandaPay ECS client is meant to be a drop-in replacement for users who are already using Stripe and would now like to donate a percentage of their revenue through PandaPay ECS w/ Stripe Connect. Currently, only the Charge/Donation method is supported.

To start processing payments through PandaPay and allocate revenue to charity, this:

require 'stripe'

Stripe.api_key = "sk_test_mystripesecretkey"

Stripe::Charge.create(
  amount: 400,
  currency: "usd",
  source: "tok_18An5IGxtonQ6vBUBnw2t7LQ", # obtained with Stripe.js
  description: "Charge for test@example.com"
)

becomes this:

require 'pandapay'

PandaPay.api_key = "sk_test_myPANDAsecretkey"

PandaPay::StripeEcommerce::Charge.create(
  amount: 400,
  donation_amount: 100,
  receipt_email: thedonator@email.com,
  destination_ein: "12-3456789", # Optional
  currency: "usd",
  source: "tok_18An5IGxtonQ6vBUBnw2t7LQ", # still the same token from Stripe.js
  description: "Charge for test@example.com"
)

The PandaPay API takes this charge, relays it to Stripe on your behalf using the OAuth token obtained via Stripe Connect, less the donation amount (which will show up in Stripe as a "Panda Fee"). This also works with the standard Stripe customer parameter instead of a source.