A package to handle payments via Digipay Africa API

v1.0.0 2025-02-11 13:51 UTC

This package is not auto-updated.

Last update: 2025-06-18 14:25:47 UTC


README

This package provides a simple way to handle payments via the Digipay Africa API.

Installation

composer require digipay-payment/paylink:^1.0

Exemple de code

<?php

require __DIR__ . '/vendor/autoload.php';

use PayLink\DigipayPayment\DigipayPayment;
use PayLink\DigipayPayment\Exceptions\PaymentException;

$merchant = '************';
$basicAuth = base64_encode("**********************************");
$secretKey = "vomFB0EdVbdgf4Q";
$cbkUrl = "https://www.your_website.xxx/url-callback";
$webCbkUrl = "https://www.your_website.xxx/page_show_notification";
$currency = 'XOF';
$country = 225;
$amount = 1000;


try {
    $payment = new DigipayPayment($merchant, $basicAuth, $secretKey, $country, $currency, $cbkUrl, $webCbkUrl);
    $redirectUrl = $payment->createPaymentLink($amount, 'John Doe');
    header('Location: ' . $redirectUrl);
} catch (PaymentException $e) {
    echo "Erreur de paiement : " . $e->getMessage();
}