Getting Started

This page will help you get started with CartGateway For Merchants. You'll be up and running in a jiffy!

Overview

The CartGateway for Merchants API is a HTTP REST API that uses JSON payloads and responses. It can be accessed directly via any HTTP library, or you can use the CartGateway PHP SDK which provides convenient access to the CartGateway Merchant API from applications written in the PHP language. It includes a pre-defined set of Models for API resources that initialize themselves dynamically from API responses which makes it compatible with a wide range of versions of the CartGateway API.

To process live transactions, you must have a verified CartGateway Merchant account: Website

Connecting to the API

Once you have signed up for your CartGateway account you will be able to access the Testing Environment to ensure you are able to integrate with CartGateway. Once your account has been verified, you can start accessing the live API and processing transactions. You can find more details in the API Reference

Finding your Account ID and Private Key

Once you've signed up for your CartGateway account, you can log in and get your Account ID and Private Key. Click on Profile and then choose API Credentials.

On the API Credentials page, you will see the Account ID and Private Key listed. Before your account is verified, you will only have access to the sandbox, and you will see the ~ Sandbox Only~ label.

PHP SDK: Installation

1 Set up CartGateway (Server Side)

# Install the PHP library via Composer
composer require yomalilabs/cartgateway-merchant

# Or download the source directly: https://github.com/yomalilabs/cartgateway-merchant/releases

The SDK allows you to connect easily and securely to CartGateway API.

2. Find your Account Id and Private Key

You will find your Account ID and Private Key in your CartGateway merchant account on your profile page: CartGateway Merchant Portal

PHP SDK: Usage

Always initialize a new CartGateway client and send your account_id and your access_token to authorize your connection to the API for your merchant account.

Before your account is verified, you can set the environment to sandbox to test the API.

Please head over to the API Reference tab to find examples on how to implement. Each endpoint will also show a usage example for the PHP SDK.

API Requests

The following payment API requests are available via the API:

Payment

Notes

All the amount fields must be in cents.