1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace refill\lx;
- use refill;
- class RefillCallBack implements refill\IRefillCallBack
- {
- public function verify($params): bool
- {
- return true;
- }
- public function notify($params)
- {
- $state = $params['state_type'];
- $order_id = $params['order_id'];
- $order_info = Model('vr_order')->getOrderInfoForNotify(['order_id' => $order_id]);
- if (empty($order_info)) {
- return [false, false, false,false];
- }
- if(!empty($params['official_sn']) && $state == 'order_success'){
- $data['official_sn'] = $params['official_sn'];
- Model('refill_order')->edit($order_id, $data);
- }
- if ($state == 'order_success') {
- return [$order_id, true, false, true];
- } elseif ($state == 'order_cancel') {
- return [$order_id, false, false, true];
- } else {
- return [$order_id, false, false, false];
- }
- }
- }
|