rodgers/hello-composer

dev-globalwallet 2021-03-07 22:17 UTC

This package is not auto-updated.

Last update: 2024-10-02 23:58:14 UTC


README

#全球钱包

这是Main通过Php连接网站的标准方式,它是一个将数据发送到Global-Wallet的Php类。一旦您的php运行起来,只需插入并开始使用即可。我建议使用非常更新的编辑器,因为该类有很好的文档记录。
如果您非常熟悉Php,只需浏览一下Transactions.php就足够了,但如果您是新手,我将在这里解释代码。所有代码均来自Global Wallet Merchant Page

类文件

<?php
class global_wallet{

//All needed methods and objects are listed in this folder, please do not change anything at ALL

}

此文件应保持不变,无论您在哪里需要它,只需包含它并创建类的实例即可。

交易文件

<?php
include("Global_Wallet.php");
$wallet = new global_wallet();

//remember, For registering Details, All Methods Are Chained, While The Acutal Pay and Verification Are Not, You Should Call Them Separately
$wallet = setMerchant($yourMerchantAccount,$yourMerchantKey)->setOrder->($theItemNumber,$theItemName,$theItemPrice,$theItemCurrency)->setUrl($SuccessUrl,$Failurl,$CancelUrl);

// We Recommend You Use Some Html To All Javascript To Keep This Function From Lanuching As It Will Reload The Page
// The Transactions.php File Provided, Contains Errors Which Are Hidden With ob_start(), error_reporting(0),functions.
// Please Make Some Button Or Something TO Launch This Function
$wallet->Pay();

//After This Function is Launched, We need to receive The <h5>$txid</h5>, Its Important To Know Whether The Transactions Was Successful Or Not
$txid = $_GET['txid']
$results = $wallet->getDetails($txid);   //This Functions Sends The Details Back To Global Wallet Where The $txid Is Processed, Something is returned
if($results->status == 'success'){
 //The Code You Would Want To Run If The Transactions Was Successful 
}
?>

如果在支付()方法所在的页面以外的页面进行验证,请使用以下代码,只需确保验证url是成功url即可。

验证文件

<?php
include("Global_Wallet.php");
$wallet = new global_wallet();
$wallet->setMerchant($yourMechantAccount,$yourMerchantKey);

//Immediately After This, Just Call The Get Details Method
$txid = $_GET['txid']
$results = $wallet->getDetails($txid);   //This Functions Sends The Details Back To Global Wallet Where The $txid Is Processed, Something is returned
if($results->status == 'success'){
 //The Code You Would Want To Run If The Transactions Was Successful 
}
?>

```

Thats All, Thanks For Using Global Wallet