Tithe.ly driver for the Omnipay payment processing library
Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.6+. This package implements Tithe.ly support for Omnipay.
Via Composer
$ composer require elvanto/omnipay-tithely
Omnipay 3.x is supported starting with v2.0.0 of this package.
The following gateways are provided by this package:
- Tithe.ly (Quick Charge)
For general usage instructions, please see the main Omnipay repository.
Omnipay tithely is an API middleware to simplify requests to Tithely Quick-Charge v1 and later V2. This Tithely api allows users to create a payment request without creating an account.
Validation data like our tithely organisation id tithely_org_Id
, tithely public tithely_public
and secret tithely_secret
keys exist as part of our gateway request. Additionally the gateway also takes our giving type giving_type
field as a string.
The gateway details are set with the functions:
$gateway->setPublicKey($tithely_public); // Required
$gateway->setPrivateKey($tithely_secret); // Required
$gateway->setOrganizationId($tithely_org_Id); // Required
$gateway->setGivingType("Offering"); // Required
Unlike regular use of the tithely quick charge api, the omnipay/tithely api object requires a card object within the request to pass our first_name
, last_name
, and email
. The token
, description
, currency
and exist in request objects main body.
Specific to omnipay / tithely the currency
field within the $request
body is required.
$request["card"] = new CreditCard(array(
"first_name" => $first_name, // Required
"last_name" => $last_name, // Required
"email" => $email // Required
));
$request["token"] = $token; // Stripe token. Required
$request["amount"] = "10.00"; // Required
$request["description"] = "Donation to church.";
$request["currency"] = $currency; //e.g. "USD" "CAD" "AUD" Required
$gateway = Omnipay::create('Tithely');
$tithely_public = "pub_*****"; // Required
$tithely_secret = "pri_*****"; // Required
$tithely_org_Id = "org_*****"; // Required
$gateway->setPublicKey($tithely_public); // Required
$gateway->setPrivateKey($tithely_secret); // Required
$gateway->setOrganizationId($tithely_org_Id); // Required
$gateway->setGivingType("Offering"); // Required
$response = $gateway->purchase($request)->send();
The $reponse
comes as a protected object. To access the response use the getRequest
and getData()
odadmnipay functions.
$response->getRequest()->getData()["first_name"];
If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.
If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.
If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.