Skip to content

andrewjwolf/payjunction-php

 
 

Repository files navigation

payjunction-php TravisCI

A PayJunction API client for php

Installation

The module can be installed using Composer by adding the following lines to your composer.json file:

php composer.phar require vakata/jstree:*

BrandedCrate\PayJunction fully supports PayJunction's REST API for transactions, customers and receipts. Support for other resources is on the way.

This library has no third-party dependencies.

Usage

Instantiate an instance of \BrandedCrate\PayJunction\Client which provides access to all the available resources.

use BrandedCrate\PayJunction\PayJunctionClient;

$pj = new PayJunctionClient(array(
  'username' => 'YOUR-USERNAME',
  'password' => 'YOUR-PASSWORD',
  'appkey' => 'YOUR-APP-KEY'
));

Examples

Consult the PayJunction API Documentation for information about all the available API resources and actions including what parameters can be set and example responses.

Transactions

Create a transaction for a keyed credit card:

$response = $pj->transaction()->create(array(
  'cardNumber' => '4444333322221111',
  'cardExpMonth' => '01',
  'cardExpYear' => '18',
  'cardCvv' => '999',
  'amountBase' => '10.00'
));

Create a transaction for a swiped credit card:

$response = $pj->transaction()->create(array(
  'cardTrack' => '%B4444333322221111^First/Last^1712980100000?;4444333322221111=1712980100000?',
  'amountBase' => '10.00'
));

Create a transaction for an ACH transfer:

$response = $pj->transaction()->create(array(
  'achRoutingNumber' => '104000016',
  'achAccountNumber' => '123456789',
  'achAccountType' => 'CHECKING',
  'achType' => 'PPD',
  'amountBase' => '10.00',
));

Create a new transaction from a previous transaction:

$response = $pj->transaction()->create(array(
  'transactionId' => '74600',
));

Void a transaction by id:

$response = $pj->transaction()->update('74600', array(
  'status' => 'VOID'
));

Read a transaction by id:

$response = $pj->transaction()->read('74600');

Add signature to transaction:

$response = $pj->transaction()->addSignature('74600', array(
  'signature' => '}SCRIPTEL A ST1501-PYJ 01.00.08 #_5,#<5\'#<5z#"5\'#"5=#"6t#"7m#<7/#>8,#:9\'#+a\'#|b\'$Mcz$Mdv$Meo$Me\'$Mfm$Mfq$Mfr$Mfq$Me[$New$Od-$Pc[$Qco$Sbr$Uat$W9t$Z8v$>7z$+6=%M6w%Q6q%T6n%V6o%Y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PfoHPfmHPe[HQe/HRe\'HTewHVerHZenH>d=IMd-ISdzIYdxI?dxJNdxJSdzJWd-J"d=J>eoJ:etJ{ezJ|e/KNe\KOfqKPftKQfvKRfxKSfyKTfxKVfvKWftKWfrKXfq ]');
));

receipts

Read receipt data by transaction id:

$response = $pj->receipt()->read('123456');

Sent an email receipt:

$response = $pj->receipt()->email('123456', array(
  'to' => 'stephen+automation@brandedcreate.com',
  'replyTo' => 'foobar@whatever.com',
  'requestSignature' => 'true'
));

customers

Create a customer:

$pj->customer()->create(array(
  'companyName' => 'ACME, inc.',
  'email' => 'customer@acme.com',
  'identifier' => 'your-custom-id',
  'firstName' => 'Joe',
  'jobTitle' => 'Wage Slave',
  'lastName' => 'Schmoe',
  'middleName' => 'Ignatius',
  'phone' => '5555551212',
  'phone2' => '1234567890',
  'website' => 'acme.com'
));

Delete a customer:

$pj->customer()->delete('345678');

Running Tests

This package includes standalone unit tests and integration tests. Run them with PHPUnit or use the wrapper script to do it for you.

./bin/test

License

This package is released under the MIT License.

About

PayJunction API client for PHP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.2%
  • Shell 0.8%