RefillCallBack.php 862 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace refill\xiecheng;
  3. require_once(BASE_HELPER_RAPI_PATH . '/xiecheng/config.php');
  4. use refill;
  5. class RefillCallBack implements refill\IRefillCallBack
  6. {
  7. public function verify($params): bool
  8. {
  9. return true;
  10. }
  11. public function notify($params)
  12. {
  13. $order_sn = $params['order_sn'];
  14. $status = intval($params['status']);
  15. $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
  16. if (empty($order_info)) {
  17. return [false, false, false,false];
  18. }
  19. $order_id = $order_info['order_id'];
  20. if ($status === 1) {
  21. return [$order_id, true, false,true];
  22. }
  23. elseif ($status === 0) {
  24. return [$order_id, false, true,true];
  25. }
  26. else {
  27. return [$order_id, false, false,false];
  28. }
  29. }
  30. }