1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace refill\jianjiao;
- require_once(BASE_HELPER_RAPI_PATH . '/jianjiao/config.php');
- use refill;
- class RefillCallBack implements refill\IRefillCallBack
- {
- public function verify($params): bool
- {
- $input = $params;
- unset($input['sign']);
- $sign = config::sign($input);
- if ($params['sign'] == $sign) {
- return true;
- } else {
- return false;
- }
- }
- public function notify($params)
- {
- $order_sn = $params['out_order_id'];
- $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
- if (empty($order_info)) {
- return [false, false, false,false];
- }
- $order_id = $order_info['order_id'];
- $status = intval($params['status']);
- if ($status === 3) {
- $data['official_sn'] = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
- Model('refill_order')->edit($order_id, $data);
- return [$order_id, true, false, true];
- } elseif ($status === 4) {
- return [$order_id, false, true, true];
- } else {
- return [$order_id, false, false, false];
- }
- }
- }
|