Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jokul PHP Library

This library is an abstraction of Jokul's API for applications written with PHP.

Table of Contents

Links

Installation

composer require asokawotulo/jokul-php

Usage

Initialization

Get the Client ID and Secret Key from Business Account > Service

use Jokul\Jokul;

Jokul::setClientId('MCH-xxxx-xxxxxxxxxxxxx');
Jokul::setSecretKey('SK-xxxxxxxxxxxxxxxxxxxx');
Jokul::setEnv(Jokul::PRODUCTION); // or Jokul::SANDBOX

Generate Signature

use Jokul\Jokul;
use Jokul\Utils;

$requestTarget = '/api/target';
$secretKey = Jokul::getSecretKey();
$clientId = Jokul::getClientId();
$requestId = Utils::generateRequestId();
$requestTimestamp = Utils::generateRequestTimestamp();

$signature = Utils::generateSignature(
	$secretKey,
	$clientId,
	$requestId,
	$requestTimestamp,
	$requestTarget,
);

Jokul Checkout

$checkoutData = [
	'order' => [
		'amount' => 20000,
		'invoice_number' => 'INV-123',
	],
	'payment' => [
		'payment_due_date' => 60
	]
];

$response = \Jokul\Checkout::create($checkoutData);

echo $response['payment']['url'];

About

Jokul REST API Client for PHP

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages