AdapayController.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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\Adapay\Adapay;
  9. use app\models\Order;
  10. use app\utils\OrderNo;
  11. class AdapayController extends BaseController
  12. {
  13. public function actionTest(){
  14. $store_id = get_store_id();
  15. $id = input_params('id');
  16. $order = Order::findOne($id);
  17. $conf = Adapay::memberCreate(317, 4941);
  18. $conf = Adapay::settleAccountCreate(317, 4941);
  19. return $this->asJson($conf);
  20. }
  21. public function actionConf(){
  22. $store_id = get_store_id();
  23. $conf = Adapay::conf($store_id);
  24. return $this->asJson([
  25. 'code'=>0,
  26. 'msg'=>'ok',
  27. 'data' => $conf,
  28. ]);
  29. }
  30. public function actionConfSave(){
  31. $store_id = get_store_id();
  32. $conf = input_params('conf');
  33. if(!is_array($conf)){
  34. $conf = json_decode($conf, true);
  35. }
  36. Adapay::saveConf($store_id, $conf);
  37. return $this->asJson([
  38. 'code'=>0,
  39. 'msg'=>'保存成功'
  40. ]);
  41. }
  42. public function actionGetReceiverSaas(){
  43. $conf = Adapay::getReceiverSaas();
  44. return $this->asJson([
  45. 'code'=>0,
  46. 'msg'=>'ok',
  47. 'data' => $conf,
  48. ]);
  49. }
  50. public function actionSetReceiverSaas(){
  51. $conf = input_params('conf');
  52. if(!is_array($conf)){
  53. $conf = json_decode($conf, true);
  54. }
  55. Adapay::setReceiverSaas($conf);
  56. return $this->asJson([
  57. 'code'=>0,
  58. 'msg'=>'保存成功'
  59. ]);
  60. }
  61. public function actionGetReceiverStore(){
  62. $store_id = get_store_id();
  63. $conf = Adapay::getReceiverStore($store_id);
  64. return $this->asJson([
  65. 'code'=>0,
  66. 'msg'=>'ok',
  67. 'data' => $conf,
  68. ]);
  69. }
  70. public function actionSetReceiverStore(){
  71. $store_id = get_store_id();
  72. $conf = input_params('conf');
  73. if(!is_array($conf)){
  74. $conf = json_decode($conf, true);
  75. }
  76. Adapay::setReceiverStore($store_id, $conf);
  77. return $this->asJson([
  78. 'code'=>0,
  79. 'msg'=>'保存成功'
  80. ]);
  81. }
  82. public function actionMerchant_busi_config_query(){
  83. $store_id = get_store_id();
  84. $res = \app\utils\Adapay\AdapayV2::merchant_busi_config_query($store_id);
  85. return $this->asJson($res);
  86. }
  87. public function actionMerchant_busi_config(){
  88. $store_id = get_store_id();
  89. $conf = input_params('conf');
  90. $res = \app\utils\Adapay\AdapayV2::merchant_busi_config($store_id, $conf);
  91. return $this->asJson($res);
  92. }
  93. }