AllinpayController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\admin\controllers;
  8. use app\utils\Allinpay\Allinpay;
  9. use app\models\Order;
  10. use app\utils\OrderNo;
  11. class AllinpayController extends BaseController {
  12. public function actionTest() {
  13. $store_id = get_store_id();
  14. $id = input_params('id');
  15. $order = Order::findOne($id);
  16. return $this->asJson($conf);
  17. }
  18. public function actionConf() {
  19. $store_id = get_store_id();
  20. $conf = Allinpay::conf($store_id);
  21. return $this->asJson([
  22. 'code' => 0,
  23. 'msg' => 'ok',
  24. 'data' => $conf,
  25. ]);
  26. }
  27. public function actionConfSave() {
  28. $store_id = get_store_id();
  29. $conf = input_params('conf');
  30. if (!is_array($conf)) {
  31. $conf = json_decode($conf, true);
  32. }
  33. Allinpay::saveConf($store_id, $conf);
  34. return $this->asJson([
  35. 'code' => 0,
  36. 'msg' => '保存成功'
  37. ]);
  38. }
  39. }