2017 © Pedro Peláez
 

library cardconnect

PHP adapter for CardConnect CardPointe API

image

dewbud/cardconnect

PHP adapter for CardConnect CardPointe API

  • Sunday, July 22, 2018
  • by Dewbud
  • Repository
  • 2 Watchers
  • 1 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 71 % Grown

The README.md

PHP CardConnect Adapter

Initializing

$merchant_id = '123456123456';
$user        = 'username';
$pass        = 'password';
$server      = 'https://sub.domain.tld:1111/';

$client = new CardPointe($merchant_id, $user, $pass, $server);

Testing Credentials

$boolean = $client->testAuth();

Validate Merchant ID

$boolean = $client->validateMerchantId();

Tweaks

Responses are parsed and their amount fields are returned in cents int., (*1)

The client stores the last request made as an array $client->last_request which can be used to debug requests, (*2)

Response Objects

Responses are returned as objects and can be accessed as arrays., (*3)

$response = $client->inquire($retref);
$response->amount; // returns int
$response->toJSON(); // Returns JSON encoded string, accepts format codes (JSON_PRETTY_PRINT, etc)
$response->toArray(); // Returns array of attributes

Authorizing Transactions

$request = new AuthorizationRequest([
    'account' => '4242424242424242',
    'amount'  => '100',
    'expiry'  => '0120',
]);
$authorization_response = $client->authorize($request);

You can also authorize and capture in the same request like so, (*4)

$request = new AuthorizationRequest([
    'account' => '4242424242424242',
    'amount'  => '100',
    'expiry'  => '0120',
    'capture' => 'Y', // OR 'capture' => true,
    'profile' => 'Y', // OR 'profile' => true,
]);
$capture_response = $client->authorize($request);

You can also authorize and capture in the same request using a saved card with PROFILE_ID/ACCOUNT_ID like so, (*5)

$request = new AuthorizationRequest([
    'account' => '4242424242424242',
    'amount'  => '100',
    'expiry'  => '0120',
    'capture' => 'Y', // OR 'capture' => true,
    'profile' => "$profile_id/$account_id", // using a profile/account
]);
$capture_response = $client->authorize($request);

To view all available fields see Authorization Request, (*6)

All returned fields see Authorization Response, (*7)

Capturing Transactions

$auth_retref = '123456654321';
$params = []; // optional
$capture_response = $client->capture($auth_retref, $params);

To view all available fields see Capture Request, (*8)

All returned fields see Capture Response, (*9)

Voiding Transactions

$auth_retref = '123456654321';
$params = []; // optional
$void_response = $client->void($auth_retref, $params);

To view all available fields see Void Request, (*10)

All returned fields see Void Response, (*11)

Refunding Transactions

$capture_retref = '123456654321';
$params = []; // optional
$void_response = $client->refund($capture_retref, $params);

To view all available fields see Refund Request, (*12)

All returned fields see Refund Response, (*13)

Transaction Status

$retref = '123456654321';
$inquire_response = $client->inquire($retref);

All returned fields see Inquire Response, (*14)

Settlement Status

$date = '0118';
$settlements = $client->settleStat($date);
$first_settlement = $settlements[0];

All returned fields see Settlement Response, (*15)

Create/Update Profile

// update a profile by providing 'profile' => $profile_id in the request
$request = [
    'defaultacct' => "Y",
    'account'     => "4444333322221111",
    'expiry'      => "0914",
    'name'        => "Test User",
    'address'     => "123 Test St",
    'city'        => "TestCity",
    'region'      => "TestState",
    'country'     => "US",
    'postal'      => "11111",
];
$res = $client->createProfile($request);

All returned fields see Create/Update Profile Request, (*16)

Get Profile

$profile_id = '1023456789';
$account_id = null; // optional
$profile = $client->profile($profile_id, $account_id);

All returned fields see Profile Response, (*17)

Delete Profile

$profile_id = '1023456789';
$account_id = null; // optional
$profile = $client->deleteProfile($profile_id, $account_id);

All returned fields see Delete Profile Response, (*18)

Tests

composer test, (*19)

Note: small or large authorization/capture amounts don't seem to work with the test merchant credentials., (*20)

Future stuff

Implement remains service endpoints - Funding Service - Signature Capture Service (probably never) - Open Batch Service - Close Batch Service - BIN Service, (*21)

The Versions

22/07 2018

dev-master

9999999-dev https://github.com/Dewbud/CardConnect

PHP adapter for CardConnect CardPointe API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Dewbud

cardconnect cardpointe

22/07 2018

1.0.2

1.0.2.0 https://github.com/Dewbud/CardConnect

PHP adapter for CardConnect CardPointe API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Dewbud

cardconnect cardpointe

15/02 2018

1.0.1

1.0.1.0 https://github.com/Dewbud/CardConnect

PHP adapter for CardConnect CardPointe API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Dewbud

cardconnect cardpointe

15/02 2018

1.0.0

1.0.0.0 https://github.com/Dewbud/CardConnect

PHP adapter for CardConnect CardPointe API

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar Dewbud

cardconnect cardpointe