Test Toyyibpay paymet gateway

Sekiranya anda  ingin membuat integrasi sistem anda dengan proses pembayaran online, anda boleh menggunakan ToyyibPay. Klik sini untuk mendaftar.

Anda boleh cuba menggunakan script php dibawah untuk mendapatkan gambaran penggunaannya

 <?php  
 $some_data = array(  
   'userSecretKey'=>'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',  
   'categoryCode'=> 'xxxxxxxx',  
   'billName'=> 'Test izoolz.com',  
   'billDescription'=> 'izoolz Create bill test',  
   'billPriceSetting'=> 100,  
   'billAmount'=> '10',  
   'billPayorInfo' => 1,  
   'billTo'=>'asdf',  
   'billEmail'=>'izoolzdotcom@gmail.com',  
   'billPhone'=>'0123465851',  
   'billReturnUrl'=>'http://google.com',  
   'billCallbackUrl'=>'http://google.my/paystatus',  
  );   
  $curl = curl_init();  
  curl_setopt($curl, CURLOPT_POST, 1);  
  curl_setopt($curl, CURLOPT_URL, "https://dev.toyyibpay.com/index.php/api/createBill");   
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);  
  curl_setopt($curl, CURLOPT_POSTFIELDS, $some_data);  
  $result = curl_exec($curl);  
  $info = curl_getinfo($curl);   
  curl_close($curl);  
  $obj = json_decode($result);  
  var_dump($result);  
  echo $result;  //[{"BillCode":"gcbhict9"}]
buatkan satu file toyyibpay.php dan copy kod diatas.
Anda boleh mendapatkan userSecretKey,categoryCode di bahagian dashboard ToyyibPay.
Jika semua berjalan lancar, anda akan mendapat response seperti berikut

[{"BillCode":"gcbhict9"}]
kemudian anda perlu redirectkan ke
https://toyyibpay.com/gcbhict9

Untuk maklumat lanjut, anda boleh layari laman dokumentasi mereka di https://toyyibpay.com/apireference/

Post a Comment

Previous Post Next Post