123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace refill\yifutong;
- require_once(BASE_HELPER_RAPI_PATH . '/yifutong/config.php');
- use refill;
- class RefillCallBack implements refill\IRefillCallBack
- {
- public function verify($params): bool
- {
- return true;
- }
- public function notify($params): array
- {
- $order_sn = $params['order_sn'];
- $status = intval($params['status']);
- $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
- if (empty($order_info)) {
- return [false, false, false, false];
- }
- $order_id = $order_info['order_id'];
- if ($status === 'SUCCESS') {
- return [$order_id, true, false, true];
- } elseif ($status === 'CANCEL') {
- return [$order_id, false, true, true];
- } else {
- return [$order_id, false, false, false];
- }
- }
- }
|