mirror of
https://github.com/v2board/v2board.git
synced 2025-04-15 14:12:36 +08:00
update: alipay f2f sdk
This commit is contained in:
parent
5fde09344c
commit
313ac9d27f
@ -57,17 +57,12 @@ class AlipayF2F {
|
|||||||
|
|
||||||
public function notify($params)
|
public function notify($params)
|
||||||
{
|
{
|
||||||
$gateway = Omnipay::create('Alipay_AopF2F');
|
$gateway = new \Library\AlipayF2F();
|
||||||
$gateway->setSignType('RSA2'); //RSA/RSA2
|
|
||||||
$gateway->setAppId($this->config['app_id']);
|
$gateway->setAppId($this->config['app_id']);
|
||||||
$gateway->setPrivateKey($this->config['private_key']); // 可以是路径,也可以是密钥内容
|
$gateway->setPrivateKey($this->config['private_key']); // 可以是路径,也可以是密钥内容
|
||||||
$gateway->setAlipayPublicKey($this->config['public_key']); // 可以是路径,也可以是密钥内容
|
$gateway->setAlipayPublicKey($this->config['public_key']); // 可以是路径,也可以是密钥内容
|
||||||
$request = $gateway->completePurchase();
|
|
||||||
$request->setParams($_POST); //Optional
|
|
||||||
try {
|
try {
|
||||||
/** @var \Omnipay\Alipay\Responses\AopCompletePurchaseResponse $response */
|
if ($gateway->verify($params)) {
|
||||||
$response = $request->send();
|
|
||||||
if ($response->isPaid()) {
|
|
||||||
/**
|
/**
|
||||||
* Payment is successful
|
* Payment is successful
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user