EasyPost\Shipment::retrieve PHP Method

retrieve() public static method

retrieve a shipment
public static retrieve ( string $id, string $apiKey = null ) : mixed
$id string
$apiKey string
return mixed
    public static function retrieve($id, $apiKey = null)
    {
        return self::_retrieve(get_class(), $id, $apiKey);
    }

Usage Example

コード例 #1
0
ファイル: User.php プロジェクト: vhghorecha/smartdhl
 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));
 }
All Usage Examples Of EasyPost\Shipment::retrieve