/php-pulpal

PulPal Payment System API

Primary LanguagePHPMIT LicenseMIT

PulPal Payment API for PHP

latest release Latest Release on GitHub Software License Total Downloads

Based on https://payment-api-dev.pulpal.az/swagger/index.html

About

The php-pulpal package allows you to accept and process payments using PulPal API directly in your php application.

Features

  • Top-up Payment from the merchant to the client
  • Check status of transaction
  • Check merchant wallet balance and blocked funds

Requirements

  • PHP 5.6+
  • cURL

Composer Install

Require the shabnamyusifzada/php-pulpal package in your composer.json and update your dependencies:

$ composer require shabnamyusifzada/php-pulpal

Manual Install (without Composer)

  • Download the class library and extract the contents do a directory in your project structure.
  • Upload the files to your web server.

Setup

Save config/pulpal.php to a location of your choice and fill out your details accordingly.

To use the library in your project, include the following into your file(s).

  • /path/to/config.php
  • autoload.php

Integrate the package

Include the following to your file:

<?php 

    require __DIR__.'/vendor/autoload.php'; 
    
    use ShabnamYusifzada\Pulpal\Api\v1\TopUpPayment;
    
    $config = include __DIR__."/config/pulpal.php";
    
    $payment = new TopUpPayment(
        $config['host'],
        $config['merchant_id'],
        $config['provider_id'],
        $config['api_public_key'],
        $config['api_private_key'],
        $config['lang']
    );
?>

Using "Top Up Payment from the merchant" feature

You must initialize payment for redirecting the merchant to the payment page using the following example: Example

And then process the payment result using the following example: Example

Using "Check the status of the transaction" feature

Example right here

Using "Check merchant wallet balance and blocked funds" feature

Example right here

Upcoming version

"Payment from the client to the merchant" feature

License

Released under the MIT License, see LICENSE.