v1ra1 / helcim-php

PHP library for Helcim Commerce API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP library Helcim Commerce API

This library provides convenient wrapper functions for Helcim Commerce REST API. The API is documented here

Requirements

PHP 5.4.0

Examples

Test Connection

include('./Helcim.php');

$accountId = (int)"YOUR-ACCOUNT-ID";
$apiToken = "YOUR-API-TOKEN";

$helcim = new Helcim($accountId, $apiToken, array(
    'testMode' => true,
    'debug' => true
));

print_r($helcim->misc->testConnection()->getData());

Process Purchase

include('./Helcim.php');

$accountId = (int)"YOUR-ACCOUNT-ID";
$apiToken = "YOUR-API-TOKEN";

$helcim = new Helcim($accountId, $apiToken, array(
    'testMode' => true,
    'debug' => true
));

$amount = 100;
$cardNumber = 5454545454545454;
$cardExpiry = 0125;
$cardCVV = 100;

print_r($helcim->payments->card->purchase($amount, $cardNumber, $cardExpiry, $cardCVV)->getData());

Fetch Customer

include('./Helcim.php');

$accountId = (int)"YOUR-ACCOUNT-ID";
$apiToken = "YOUR-API-TOKEN";

$helcim = new Helcim($accountId, $apiToken, array(
    'testMode' => true,
    'debug' => true
));

$customerCode = 'CST1001';

print_r($helcim->customers->fetchCustomer($customerCode)->getData());

View Order

include('./Helcim.php');

$accountId = (int)"YOUR-ACCOUNT-ID";
$apiToken = "YOUR-API-TOKEN";

$helcim = new Helcim($accountId, $apiToken, array(
    'testMode' => true,
    'debug' => true
));

$orderNumber = 'INV1001';

print_r($helcim->customers->viewOrder($orderNumber)->getData());

Helcim Commerce API Documentation

Helcim did a amazing job documenting their api. You can find all the documentation from the link I provided above. I also provided references to all the actions/transactionTypes in the comments of the code.

About

PHP library for Helcim Commerce API.


Languages

Language:PHP 100.0%