|
|
@@ -6,18 +6,13 @@ use biz\sj\services\MerchantService;
|
|
|
use bizGhs\express\services\DadaExpressServices;
|
|
|
use bizGhs\order\classes\OrderClass;
|
|
|
use bizHd\message\classes\InformAdminClass;
|
|
|
-use bizHd\message\services\InformAdminService;
|
|
|
use bizHd\order\services\OrderService;
|
|
|
use bizHd\wx\classes\WxOpenClass;
|
|
|
use bizGhs\express\services\MiniExpressService;
|
|
|
-use bizGhs\product\classes\ProductClass;
|
|
|
-use common\components\baiduAip;
|
|
|
-use common\components\barcodeUtil;
|
|
|
-
|
|
|
+use common\components\dict;
|
|
|
use common\components\lakala\Lakala;
|
|
|
use common\components\miniUtil;
|
|
|
use common\components\orderSn;
|
|
|
-use common\components\oss;
|
|
|
use common\components\wxUtil;
|
|
|
use Yii;
|
|
|
use common\components\util;
|
|
|
@@ -27,7 +22,7 @@ class TestController extends BaseController
|
|
|
|
|
|
public $guestAccess = ['inform', 'notice', 'order-query', 'add-order', 'index'];
|
|
|
|
|
|
- public function actionAliRun()
|
|
|
+ public function actionAliRun2()
|
|
|
{
|
|
|
$merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
|
|
|
$lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
|
|
|
@@ -48,7 +43,7 @@ class TestController extends BaseController
|
|
|
'capitalType' => $currentCapitalType,
|
|
|
'notifyUrl' => $notifyUrl,
|
|
|
];
|
|
|
- $laResource = new Lakala($aliParams);
|
|
|
+ $laResource = new Lakala($params);
|
|
|
$response = $laResource->driveAliPay($aliParams);
|
|
|
if ($response && isset($response['cmdRetCode']) && $response['cmdRetCode'] == 'GLOBAL_SUCCESS') {
|
|
|
echo '<pre>';
|
|
|
@@ -61,7 +56,7 @@ class TestController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public function actionAliRun2()
|
|
|
+ public function actionAliRun()
|
|
|
{
|
|
|
$merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
|
|
|
$lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
|
|
|
@@ -75,8 +70,15 @@ class TestController extends BaseController
|
|
|
];
|
|
|
$laResource = new Lakala($params);
|
|
|
$outTradeNo = orderSn::getPurchaseSn();
|
|
|
- $price = 0.1;
|
|
|
- $response = $laResource->driveWxPay($outTradeNo, $price);
|
|
|
+ $notifyUrl = Yii::$app->params['hdHost'] . "/notice/pay-callback";
|
|
|
+ $currentCapitalType = dict::getDict('capitalType', 'xhPurchase', 'id');
|
|
|
+ $wxParams = [
|
|
|
+ 'orderSn' => $outTradeNo,
|
|
|
+ 'amount' => 0.16,
|
|
|
+ 'capitalType' => $currentCapitalType,
|
|
|
+ 'notifyUrl' => $notifyUrl,
|
|
|
+ ];
|
|
|
+ $response = $laResource->driveWxPay($wxParams);
|
|
|
if ($response && isset($response['cmdRetCode']) && $response['cmdRetCode'] == 'GLOBAL_SUCCESS') {
|
|
|
echo '<pre>';
|
|
|
echo "下单成功<br/>";
|