PHP code example of loticket / globepay
1. Go to this page and download the library: Download loticket/globepay 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/ */
loticket / globepay example snippets
GlobePayConfig::Init("PINE", "xOjMTaG0Tk7fqNYjsNqDKXtJvE9MFCqC");
$input = new GlobePayAppOrder();
$orderId = date("YmdHis");
echo $orderId;
$input->setOrderId($orderId);
$input->setDescription("test");
$input->setPrice("1");
$input->setCurrency("GBP");
$input->setNotifyUrl("http://b2cplusduokai.cn/platform/shop/lists");
$input->setOperator("123456");
$input->setChannel("Alipay");
$result = GlobePay::appApiOrder($input);
print_r($result);
$orderId = "202205270955091";
GlobePayConfig::Init("PINE", "xOjMTaG0Tk7fqNYjsNqDKXtJvE9MFCqC");
$input = new GlobePayOrderQuery();
$input->setOrderId($orderId);
$result = GlobePay::orderQuery($input);
print_r($result);
$orderId = "202205270955091";
GlobePayConfig::Init("PINE", "xOjMTaG0Tk7fqNYjsNqDKXtJvE9MFCqC");
$input = new GlobePayApplyRefund();
$input->setOrderId($orderId);
$refundId = date("YmdHis");
$input->setRefundId($refundId);
$input->setFee(1);
$result = GlobePay::orderRefund($input);
print_r($result);