public static function retrieve($id, $apiKey = null) { return self::_retrieve(get_class(), $id, $apiKey); }
public function refund() { if (!$this->is_logged) { redirect("user/login"); } $data = array(); $shp_id = $this->input->post('shp_id'); $shp_data = $this->shipping_model->get_shipment($shp_id); $user_id = $this->user_model->get_current_user_id(); if ($user_id == $shp_data['shp_user']) { try { $shipment = \EasyPost\Shipment::retrieve($shp_data['shp_ep_ref']); $response = $shipment->refund(); $response = $response->__toArray(); $data['success'] = 'Shipment Cancelled...'; } catch (Exception $ex) { $data['error'] = $ex->getMessage(); } } else { $data['error'] = 'Access Denied...'; } die(json_encode($data)); }