-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## Omnipay:QPay | ||
|
||
|
||
### 安装 | ||
```bash | ||
$ composer require -vvv zqhong/omnipay-qpay | ||
``` | ||
|
||
### 使用 | ||
```php | ||
<?php | ||
|
||
include __DIR__ . '/vendor/autoload.php'; | ||
|
||
use Omnipay\Omnipay; | ||
|
||
$gateway = Omnipay::getFactory()->create("QPay") | ||
->setMchId('') | ||
->setMchKey('') | ||
->setCertFilePath('') | ||
->setKeyFilePath('') | ||
->setNotifyUrl('') | ||
->setOpUserPasswd(''); | ||
|
||
// 订单查询 | ||
// 参数请参考:https://qpay.qq.com/qpaywiki/showdocument.php?pid=1&docid=5 | ||
$queryOrderRequest = $gateway->queryOrder([ | ||
'transaction_id' => '', | ||
]); | ||
$queryOrderResponse = $queryOrderRequest->send(); | ||
if ($queryOrderResponse->isSuccessful()) { | ||
// 订单查询成功操作 | ||
} | ||
``` |