|
|
@@ -27,6 +27,32 @@ class TestController extends BaseController
|
|
|
|
|
|
public $guestAccess = ['inform', 'notice', 'order-query', 'add-order', 'index'];
|
|
|
|
|
|
+ public function actionAliRun()
|
|
|
+ {
|
|
|
+ $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/cs_private_key.pem';
|
|
|
+ $lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/cs_cert.cer';
|
|
|
+ $params = [
|
|
|
+ 'appid' => 'OP00000003',
|
|
|
+ 'serial_no' => '00dfba8194c41b84cf',
|
|
|
+ 'merchant_no' => '8221210594300JY',
|
|
|
+ 'term_no' => 'A0073841',
|
|
|
+ 'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
|
|
|
+ 'lklCertificatePath' => $lklCertificatePath,
|
|
|
+ ];
|
|
|
+ $laResource = new Lakala($params);
|
|
|
+ $outTradeNo = orderSn::getPurchaseSn();
|
|
|
+ $price = 0.1;
|
|
|
+ $response = $laResource->driveAliPay($outTradeNo, $price);
|
|
|
+ if ($response && isset($response['cmdRetCode']) && $response['cmdRetCode'] == 'GLOBAL_SUCCESS') {
|
|
|
+ echo '<pre>';
|
|
|
+ echo "下单成功<br/>";
|
|
|
+ print_r($response);
|
|
|
+ } else {
|
|
|
+ echo '<pre>';
|
|
|
+ echo "下单失败<br/>";
|
|
|
+ print_r($response);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public function actionRun()
|
|
|
{
|
|
|
@@ -40,10 +66,10 @@ class TestController extends BaseController
|
|
|
'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
|
|
|
'lklCertificatePath' => $lklCertificatePath,
|
|
|
];
|
|
|
- $lakala = new Lakala($params);
|
|
|
+ $laResource = new Lakala($params);
|
|
|
$outTradeNo = orderSn::getPurchaseSn();
|
|
|
$price = 0.1;
|
|
|
- $response = $lakala->driveWxPay($outTradeNo, $price);
|
|
|
+ $response = $laResource->driveWxPay($outTradeNo, $price);
|
|
|
if ($response && isset($response['cmdRetCode']) && $response['cmdRetCode'] == 'GLOBAL_SUCCESS') {
|
|
|
echo '<pre>';
|
|
|
echo "下单成功<br/>";
|