RefillCallBack.php 853 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace refill\oufei;
  3. require_once(BASE_HELPER_RAPI_PATH . '/oufei/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. $status = intval($params['ret_code']);
  14. $order_sn = $params['sporder_id'];
  15. $order_info = Model('vr_order')->getOrderInfoForNotify(['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. } elseif ($status === 9) {
  23. return [$order_id, false, true, true];
  24. } else {
  25. return [$order_id, false, false, false];
  26. }
  27. }
  28. }