RefillCallBack.php 957 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace refill\suning;
  3. require_once(BASE_HELPER_RAPI_PATH . '/suning/config.php');
  4. use refill;
  5. use Log;
  6. class RefillCallBack implements refill\IRefillCallBack
  7. {
  8. public function verify($params): bool
  9. {
  10. return true;
  11. }
  12. public function notify($params)
  13. {
  14. //苏宁接口提交成功即订单成功,只需处理成功
  15. $order_sn = $params['order_sn'];
  16. $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
  17. if (empty($order_info)) {
  18. return [false, false, false,false];
  19. }
  20. $order_id = $order_info['order_id'];
  21. $card_info = $params['card_info'];
  22. if (!empty($card_info)) {
  23. Model('thrid_refill')->edit_third($order_id, ['card_info' => json_encode($card_info)]);
  24. Model('refill_order')->edit($order_id, ['official_sn' => $card_info['card_no']]);
  25. }
  26. return [$order_id, true, false,true];
  27. }
  28. }