Code Monkey home page Code Monkey logo

yii2-alipay's Introduction

yii2-alipay

担保交易扩展

支付宝官方文档改编。。支持手机wap 及pc支付

安装 composer require life2016/yii2-alipay "*"

配置 设置common/config/params.php

return [ 'adminEmail' => '[email protected]',

'supportEmail' => '[email protected]',

'user.passwordResetTokenExpire' => 3600,

'showUrl'=>'http://www.sasr.cn/index.php',

'notifyUrl' => 'http://www.sasr.cn/index.php/ali-return/notify',  

'returnUrl' => 'http://www.sasr.cn/index.php/ali-return/returned', 

'aliPartner' => 'xxxxxxxxxxxxx',

'aliSellerEmail' => '[email protected]',

'aliKey'=> 'xxxxxxxx'

];

使用

use leyestd\alipay\Alipay;

use leyestd\alipay\lib\AlipaySubmit;

//参数为支付宝所需,详细请看构造方法

$alipay=new Alipay($order->orderNumber, ltrim($productSkus),$cost,$order->notes,$show_url,$recipient->name,$recipient->address,$recipient->postcode,$recipient->phone,$recipient->mobile);

$html_text = (new AlipaySubmit($alipay->alipay_config))->buildRequestForm($alipay->parameter, "get", "确认");

echo $html_text;

支付宝支付后返回

$alipayNotify = new AlipayNotify((new Aliconfig)->getAliconfig());

$verify_result = $alipayNotify->verifyReturn();

以下为支付宝支付后通知

$alipayNotify = new AlipayNotify((new Aliconfig)->getAliconfig());

$verify_result = $alipayNotify->verifyNotify();

日志

默认在frontend/runtime/logs/alilog.txt 需要写入权限

也可自己修改AlipayCore下的logResult方法到指定位置

yii2-alipay's People

Contributors

ran1990 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.