hmm/dingerprebuildform

hmm

Installs: 28

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 0

Open Issues: 0

Type:composer-package

v1.0 2023-02-21 04:11 UTC

This package is auto-updated.

Last update: 2024-10-17 11:10:47 UTC


README

Requirements

  • PHP >= 8.0;
  • composer;

Features

  • PSR-4 autoloading compliant structure.
  • Easy to use with Laravel framework.
  • Useful tools for better code included.

Installation

composer require hmm/dingerprebuildform

Set Up Tools

Running Command:

php artisan vendor:publish --provider="Hmm\Dingerprebuildform\DingerServiceProvider" --tag="config"

Config Output

<?php

    return [

        #Dinger Callback Key ထည့်ပါ။
        "callback_key" => null,

        #Dinger Public Key ထည့်ပါ။
        "public_key" =>   null


        #Dinger Secret Key ထည့်ပါ။
        "secret_key" => null,
    
        #Dinger Prebuild url ထည့်ပါ။
        #production url ကို ဤနေရာတွင် ပြောင်းလဲ ဖြည့်စွက်နိုင်သည်။ 
        #sample - https://form.dinger.asia
        "url" => "https://prebuilt.dinger.asia",

        #project name ထည့်ပါ။
        "project_name" => null,

        #merchant name ထည့်ပါ။
        "merchant_name" =>  null,

        #client id ထည့်ပါ။
        "client_id" =>  null,

        #merchant key ထည့်ပါ။
        "merchant_key" =>  null
    ];
?>
  • This command will create dinger.php file inside config folder like this,

  • Important - You need fill the dinger info in this config file for package usage.

Package Usage

Generate Prebuild Url:

use Hmm\Dingerprebuildform\Dinger;

Dinger::load(@multidimensionalArray $items,@String $customerName, @Int $totalAmount, @String $merchantOrderId);
  • Note

  • items array must be include name, amount, quantity.

  • customerName must be string.

  • totalAmount must be integer.

  • merchantOrderId must be string.

Load Output

  • This will generate a dinger prebuild form url.

Extract Callback Data:

use Hmm\Dingerprebuildform\Dinger;

Dinger::callback(@String $paymentResult,@String $checkSum);
  • Note

  • paymentResult must be string.

  • checkSum must be string.

  • ImportantForCallbackApi ( Not belong with this function. Just FYI). #That callback data need to call with array square brackets. Not with object arrow.

Callback Output

  • This will generate decrypted callback data array.

License

HMM Reserved Since 2023.