• Stars
    star
    245
  • Rank 159,819 (Top 4 %)
  • Language
    PHP
  • Created almost 13 years ago
  • Updated almost 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Spark for Uniform Payments in CodeIgniter, based on PHP-Payments. Supports 12+ payment gateways.

THIS CODE IS NO LONGER MAINTAINED. IF YOU WOULD LIKE TO BECOME THE NEW MAINTAINER FOR THIS PROJECT, PLEASE MESSAGE ME. IN THE MEAN TIME, YOU MIGHT CHECK OUT OMNIPAY.

Codeigniter Payments

CodeIgniter Payments is an abstraction library for supporting multiple payments providers. The project began in February 2011 as a CodeIgniter library and has since evolved into a framework agnostic payments engine with support for CodeIgniter.

At time of writing, the following gateways are supported, but it's very possible more gateways have been added since:

  • PayPal Payments Pro
  • Authorize.net (AIM)
  • Psigate
  • Beanstream
  • QuickBooks Merchant Services
  • Eway (Australia)
  • Amazon SimplePay
  • Stripe
  • Google Checkout
  • GoCardless
  • Braintree Payments
  • BluePay

NOTICE - USING CODEIGNITER-PAYMENTS ALONE DOES NOT MAKE YOU PCI COMPLIANT

It is highly recommended that you attempt to architect your application to achieve some level of PCI compliance. Without this, the applications you create can be vulnerable to fines for PCI compliance violations. Using codeigniter-payments does not circumvent the need for you to do this. You can check out the PCI compliance self assessment form here: https://www.pcisecuritystandards.org/merchants/self_assessment_form.php

Installing

Available via Sparks. For info about how to install sparks, go here: http://getsparks.org/install

You can then load the spark with this:

$this->load->spark('codeigniter-payments/[version #]/');

IMPORTANT!

  1. If you want to test locally (and you should), you need to set "force_secure_connection" to FALSE in config/payments.php

  2. By default, test api endpoints will be used. To enable production endpoints, change the mode in /config/payments.php from 'test' to 'production'. Note that if you are a Psigate customer, you must obtain your production endpoint from Psigate support.

  3. When you load gateways, the config can either be passed in the constructor or loaded from a config file.

Gateway Support

The following gateways are supported:

Method Support List

This is constantly changing. Please visit http://payments.calvinfroedge.com or run php doxgen.php in the src/php-payments/documentation folder to see the latest documentation.

Configuration

To create a config file, copy a config file from src/php-payments/config/drivers for a driver you want to use into the spark config/{driver_name} folder. The name of the file should stay the same. You will, however, need to make each param inside the config file reside inside a an array matching the gateway name. For example:

$config = array(
	'authorize_net' => array(
		'config1' => 'This is the config param'
	)
);

If you don't pass config in an array, and don't create a config file, the config in src/php-payments/config/drivers will be used - which is only for testing and is probably not what you want.

Making Requests

A request is formatted thusly:

$this->payments->payment_action('gateway_name', $params, $config);

Note that the third array for config is optional.

Responses

There are two types of responses returned, local responses and gateway responses. If a method is not supported, required params are missing, a gateway does not exist, etc., a local response will be returned. This prevents the transaction from being sent to the gateway and the gateway telling you 3 seconds later there is something wrong with your request.:

'type'				=>	'local_response',  //Indicates failure was local
'status' 			=>	$status, //Either success or failure
'response_code' 	=>	$this->_response_codes[$response], 
'response_message' 	=>	$this->_response_messages[$response],
'details'			=>	$response_details

Access response properties by naming your call something like this:

$response = $this->payments->payment_action('gateway_name', $params); 

Then you can do:

$status = $response->status;

Gateway responses will usually have a full response from the gateway, and on failure a 'reason' property in the details object:

'type'				=>	'gateway_response',
'status' 			=>	$status, 
'response_code' 	=>	$this->_response_codes[$response], 
'response_message' 	=>	$this->_response_messages[$response],
'details'			=>	$details

You can access this like $response->details->reason. You may want to save the full gateway response (it's an array) in a database table, you can access it at $response->details->gateway_response

Adding Drivers, More Documentation

More information on adding your own drivers (including a video walkthrough) and documentation are available online at http://payments.calvinfroedge.com

LICENSE

Copyright (c) 2011-2012 Calvin Froedge

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

redux-modifiers

A collection of generic functions for writing redux reducers to operate on various data structures
JavaScript
159
star
2

PHP-Payments

A uniform payments interface for PHP
PHP
122
star
3

octobadge-github-badge

OctoBadge - Unofficial Github Badge for Display Data About Your Github History
JavaScript
78
star
4

codeigniter-oauth

Spark for Integrating with Multiple OAuth Providers
PHP
33
star
5

react-redux-auth0

React / Redux / Auth0
JavaScript
23
star
6

CodeIgniter-Payments-Library

Library for Supporting Multiple Payment Systems with CodeIgniter Reactor
PHP
20
star
7

node-jspdf

jsPDF on the server.
JavaScript
14
star
8

react-redux-workbench

A starting point for creating React components, including babel, webpack, mocha tests, redux, hot reloads, etc.
JavaScript
14
star
9

fuelphp_starter

A starting point for FuelApps.
PHP
12
star
10

react-component-helpers

Awesome helpers for removing the boilerplate from your component state, props, and interactions.
JavaScript
12
star
11

FuelPay

Fuel port of PHP-Payments
PHP
9
star
12

FuelPHP---CampaignMonitor-API-Package

FuelPHP Package for Working With CampaignMonitor API
PHP
7
star
13

Hydro---Lang-File-2-HTML-Parser-for-FuelPHP

Parse a language array into HTML content in FuelPHP framework.
PHP
7
star
14

Aweber-API-NodeJS-Library

OAuth 1.0 implementation and API client for Aweber on NodeJS
JavaScript
6
star
15

BreezyDo-CodeIgniter-PHP-Todo-Manager

PHP / CodeIgniter based task manager.
PHP
5
star
16

docker-node-forever-express-postgres-example

Example app to be run by github.com/calvinfroedge/node-docker-compose-devenv
JavaScript
5
star
17

react-bootstrap-quick-modal

React / Bootstrap modals with fewer keystrokes
JavaScript
3
star
18

Codeigniter-Aktive-Merchant

Implementation of Aktive Merchant by Andreas Kollaros (PHP)
PHP
3
star
19

node-docker-compose-devenv

A simple dev environment using docker, node, postgres, and docker-compose
3
star
20

HackNashville

JavaScript
3
star
21

Factorials

Factorials using different styles and languages
3
star
22

legolas

Elegant OAuth on top of Express, Passport, Sessions, Sockets
JavaScript
3
star
23

react-redux-app-header

App header with Auth0 login /logout for react / redux apps
JavaScript
3
star
24

Singletons

Simple Singleton implementation in multiple languages, achieving multiple ends
PHP
2
star
25

google-apps-engine-rest-api-starter

A starting point for JSON REST APIs using Google App Engine
Python
2
star
26

EzFormz

PHP Form Generation & Validation Library
PHP
1
star
27

react-boot

Opinionated starting point for react apps
JavaScript
1
star
28

file-upload-client-component

A filepicker component for loading files from client to browser
JavaScript
1
star
29

scaffold

Scaffold
PHP
1
star
30

webpack-express-react-redux-kitchen-sink

Everything you'll ever need for a React app
JavaScript
1
star
31

miniModal

Lightweight JavaScript modal window plugin for jQuery.
JavaScript
1
star
32

grunt-if-modified

Conditionally run grunt tasks only if a source directory has been changed since the last time the task was run
JavaScript
1
star
33

namespaced-constants

Use consts to declare namespaced constants with some sugar.
JavaScript
1
star
34

ColorPickerComponent

A framework agnostic color picker component
JavaScript
1
star