PHP code example of jinomdeveloper / payment-php-sdk

1. Go to this page and download the library: Download jinomdeveloper/payment-php-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jinomdeveloper / payment-php-sdk example snippets


$jinom_payment = new \Jinom\Payment\JinomPayment('YOUR SERVER_KEY', 'IS PRODUCTION');



return [

    "server_key" => env("JINOM_PAYMENT_KEY", ""),

    "is_production" => env("JINOM_PAYMENT_IS_PRODUCTION", false),

    "base_url" => env("JINOM_PAYMENT_IS_PRODUCTION", false) ? "https://payment.jinom.net" : "https://va.sandbox.jinom.net",
];  

$jinom_payment = new \Jinom\Payment\JinomPayment(config('jinompay.server_key'), config('jinompay.is_production'));


...
use Jinom\Payment\JinomPayment;
use Jinom\Payment\Transaction;
... 

class TransactionController extends Controller {
  ...
  public function topUp(Request $request)
  {
      $nominal = 350000;
      $jinom_payment = new JinomPayment('YOUR SERVER_KEY', 'IS PRODUCTION');

      // Automatic Generate Order ID with Time combination
      $order_id = $jinom_payment->generate_order_id("TOPUP"); 

      $transaction = new Transaction();
      $transaction->setTransactionDetails(
          $transaction->createTransactionDetail($order_id, $nominal)
      );

      $transaction->setCustomerDetails($transaction->createCustomerDetail("John Doe", "[email protected]", "083119030777"));

      $items = [];

      // Item name, price, quantity
      $items[] = $transaction->createItemDetail("Apple", 350000, 1);

      $transaction->setItemDetails($items);

      $charge = $jinom_payment->charge($transaction, [
          'payment_type' => 'bank_transfer',
          'bank_transfer' => [
            'bank' => 'bri', // 
bash
composer