PHP code example of payme-quantum / payment-sdk

1. Go to this page and download the library: Download payme-quantum/payment-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/ */

    

payme-quantum / payment-sdk example snippets


use PaymeQuantum\PaymentSdk\Payment;

$email = PAYME_CREDENTIAL_EMAIL;
$password = PAYME_CREDENTIAL_PASSWORD;
$subscriptionKey = PAYME_SUBSCRIPTION_KEY;
$sdk = new Payment($email, $password, $subscriptionKey);

$transaction = $sdk->postPayment([
  'reference' => 'TEST006',
  'amount' => 2000,
  'fees' => 50,
  'tva' => 5,
  'description' => 'First Bill Payment',
]);
var_dump($transaction);

$payment = $sdk->postPaymentItem([
  'currency' => 'XAF',
  'customer_name' => 'John',
  'customer_email' => 'Doe',
  'customer_country' => 'CM',
  'amount' => 1000,
  'fees' => 50,
  'transaction_id' => $transaction->id,
  'phone' => '677777777',
]);

var_dump($payment);

type Payment = [
  'reference' => string,
  'account_id' => int,
  'amount' => int,
  'fees' => int,
  'tva' => int,
  'description' => string,
  'status' => string,
  'created_at' => string,
  'updated_at' => string,
];

type PaymentItem = [
  'reference' => string,
  'payment_id' => int,
  'customer_id' => int,
  'amount' => int,
  'fees' => int,
  'phone' => string,
  'payment_method' => string,
  'payment_proof' => string,
  'status' => string,
  'created_at' => string,
  'updated_at' => string,
];

type Fees = [
  'operation_type' => string,
  'corridor_tag' => string,
  'operand' => string,
  'min_amount' => int,
  'max_amount' => int,
  'value' => int,
];

interface PaymentParam {
  'reference' => string,
  'amount' => int,
  'fees' => int,
  'tva' => int,
  'description' => string,
}

interface PaymentItemParam {
  'reference' => string,
  'currency' => string,
  'customer_name' => string,
  'customer_email' => string,
  'customer_country' => string,
  'amount' => int,
  'fees' => int,
  'transaction_id' => int,
  'phone' => string,
}