| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers;
- use app\utils\Adapay\Adapay;
- use app\models\Order;
- use app\utils\OrderNo;
- class AdapayController extends BaseController
- {
- public function actionTest(){
- $store_id = get_store_id();
- $id = input_params('id');
- $order = Order::findOne($id);
- $conf = Adapay::memberCreate(317, 4941);
- $conf = Adapay::settleAccountCreate(317, 4941);
- return $this->asJson($conf);
- }
- public function actionConf(){
- $store_id = get_store_id();
- $conf = Adapay::conf($store_id);
- return $this->asJson([
- 'code'=>0,
- 'msg'=>'ok',
- 'data' => $conf,
- ]);
- }
- public function actionConfSave(){
- $store_id = get_store_id();
- $conf = input_params('conf');
- if(!is_array($conf)){
- $conf = json_decode($conf, true);
- }
- Adapay::saveConf($store_id, $conf);
- return $this->asJson([
- 'code'=>0,
- 'msg'=>'保存成功'
- ]);
- }
- public function actionGetReceiverSaas(){
- $conf = Adapay::getReceiverSaas();
- return $this->asJson([
- 'code'=>0,
- 'msg'=>'ok',
- 'data' => $conf,
- ]);
- }
- public function actionSetReceiverSaas(){
- $conf = input_params('conf');
- if(!is_array($conf)){
- $conf = json_decode($conf, true);
- }
- Adapay::setReceiverSaas($conf);
- return $this->asJson([
- 'code'=>0,
- 'msg'=>'保存成功'
- ]);
- }
- public function actionGetReceiverStore(){
- $store_id = get_store_id();
- $conf = Adapay::getReceiverStore($store_id);
- return $this->asJson([
- 'code'=>0,
- 'msg'=>'ok',
- 'data' => $conf,
- ]);
- }
- public function actionSetReceiverStore(){
- $store_id = get_store_id();
- $conf = input_params('conf');
- if(!is_array($conf)){
- $conf = json_decode($conf, true);
- }
- Adapay::setReceiverStore($store_id, $conf);
- return $this->asJson([
- 'code'=>0,
- 'msg'=>'保存成功'
- ]);
- }
- public function actionMerchant_busi_config_query(){
- $store_id = get_store_id();
- $res = \app\utils\Adapay\AdapayV2::merchant_busi_config_query($store_id);
- return $this->asJson($res);
- }
- public function actionMerchant_busi_config(){
- $store_id = get_store_id();
- $conf = input_params('conf');
- $res = \app\utils\Adapay\AdapayV2::merchant_busi_config($store_id, $conf);
- return $this->asJson($res);
- }
- }
|