Skip to content

machour/clictopay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClicToPay PHP SDK

ClicToPay

Installation

composer require machour/clictopay

Usage

use Machour\ClicToPay\Gateway;
use Machour\ClicToPay\Exception;

$ctp = new Gateway('login', 'password');

try {
    $response = $ctp->register([
        'amount' => 10000,
        'orderNumber' => '123456',
        'description' => 'Pack Standard',
        'returnUrl' => 'https://example.com/success',
    ]);
    
    // store $response->orderId and then
    header('Location: ' . $response->formUrl);
    exit;
    
} catch (Exception $e) {
    
}

API

/**
 * Authorization request
 *
 * @param array $params
 * @return UrlResponse
 * @throws Exception
 */
public function register(array $params): UrlResponse

See also

About

ClicToPay PHP SDK (non-official)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages