YunFastAgent.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace common\globals;
  3. use common\globals\BaseGlobal;
  4. /**
  5. * 银典代付全局调用
  6. * YunFastAgent class
  7. * @package common\globals
  8. */
  9. class YunFastAgent extends BaseGlobal
  10. {
  11. /**
  12. * 获取提现限制条件
  13. * @param array $invokes
  14. * @param array $params
  15. * @return void
  16. */
  17. public function agent($invokes, $params = [])
  18. {
  19. $withdral_cond_list = [];
  20. foreach ($invokes as $invoke) {
  21. try {
  22. // 获取条件
  23. $withdral_cond = $this->invoke($invoke['class'], $invoke['method'], $params);
  24. $is_success = $this->validateInvokeReturn($params['invoke_id'], $withdral_cond);
  25. // 全局调用获取提现条件
  26. if ($is_success) {
  27. $withdral_cond_list = array_merge($withdral_cond_list, $withdral_cond);
  28. } else {
  29. throw new \Exception('结果数据格式校验未通过');
  30. }
  31. } catch (\Exception $e) {
  32. \Yii::error('全局调用(INVOKE_WITHDRAW_YUNFAST_PAY)出错:' . $invoke['class'] . '->' . $invoke['method'] . 'msg:' . $e->getMessage());
  33. continue;
  34. }
  35. }
  36. return $withdral_cond_list;
  37. }
  38. /**
  39. * 验证
  40. * @param mixed $return
  41. * @return boolean
  42. */
  43. public function validateCheck($return = null)
  44. {
  45. return true;
  46. }
  47. /**
  48. * 验证调用结果
  49. * @param mixed $return
  50. * @return boolean
  51. */
  52. protected function validateWithDrawLimitCond($return = null): bool
  53. {
  54. return true;
  55. }
  56. }