machour/clictopay

ClicToPay PHP SDK

Installs: 4 059

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/machour/clictopay

0.0.1 2022-09-07 15:25 UTC

This package is auto-updated.

Last update: 2025-10-07 22:05:28 UTC


README

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