PHP code example of weblebby / payments

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

    

weblebby / payments example snippets




use Weblebby\Payments\BatigamePayment;
use Weblebby\Payments\PaymentException;

// Composer ile:
 '{BATIHOST_GUVENLIK_KODU}'
];

$payment = new BatigamePayment($config);

$payment->htmlForm->success_url = '{ODEME_OLDU_URL}';
$payment->htmlForm->error_url = '{ODEME_OLMADI_URL}';
$payment->htmlForm->vip_name = '{VIP_NAME}';
$payment->htmlForm->report_email = '{REPORT_EMAIL}';
$payment->htmlForm->only_email = '{ONLY_EMAIL}';
$payment->htmlForm->post_url = '{POST_URL}';

  // {posturl} sayfası.
  
  try {
    /**
     * Gelen post bilgilerini $post değişkenine atadık. [trans_id, username, credit, secret]
     * handle() fonksiyonu, gelen postun eksik olup olmadığını ve güvenlik kodunun doğruluğunu kontrol edip geri dönüş yapıyor.
     * Eğer kontrolde bir sorun varsa catch() içine atıyor.
     */
    $post = $payment->handle();
    
    // Gelen $post değişkeninden aynı trans_id ile oyuncuya kredi yüklenmiş mi kontrol edebilir, yüklenmemiş ise kredisini yükleyebilirsiniz.
  } catch (PaymentException $e) {
    // Güvenlik kodu yanlış ya da gelen post eksik.
    echo $e->getMessage();
  }
html
<!DOCTYPE html>
<html>
  <body>
     echo $payment->openHtmlForm();