hinet / omnipay-shenzhoufu by hinet

shenzhoufu for laravel 5.*
36
3
2
Package Data
Maintainer Username: hinet
Maintainer Contact: 63603636@qq.com (hinet)
Package Create Date: 2016-12-13
Package Last Update: 2016-12-16
Language: PHP
License: MIT
Last Refreshed: 2024-12-14 15:06:35
Package Statistics
Total Downloads: 36
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 3
Total Watchers: 2
Total Forks: 2
Total Open Issues: 0

omnipay-alipay

神州付手机充值卡,游戏支付支付平台

安装

composer require hinet/omnipay-shenzhoufu

使用

$gateway = Omnipay::create('Shenzhoufu');
$gateway->setPartnerId(config('payment.shenzhoufu.partner'));
$gateway->setApiKey(config('payment.shenzhoufu.apikey'));
$gateway->setNotifyUrl(config('payment.shenzhoufu.notifyUrl'));
$order = [
     'orderId'      => '201612141621487926',
     'amount'         => 1*100, //=0.01
];
$request  = $gateway->purchase($order);
$response = $request->send();
if($response->isSuccessful()){
     echo '<img src="'.$response->getQrcode().'">';
}else{
     $response->getMessage();
}

异步通知回调

$gateway = Omnipay::create('Shenzhoufu');
$options = [
        'request_params'=> $_REQUEST,
];
$response = $gateway->completePurchase($options)->send();
if ($response->isSuccessful() && $response->getTransactionReference()) {
    //支付成功后操作
    exit($response->getOrderID());
} else {
    //支付失败通知.
    exit('支付失败');
}