コード例 #1
0
 public function __construct(ShipmentLabel $shipmentLabel)
 {
     $this->entity = $shipmentLabel;
     $this->entityDTO = new ShipmentLabelDTO();
     $this->entityDTO->externalId = $this->entity->getExternalId();
     $this->entityDTO->resolution = $this->entity->getResolution();
     $this->entityDTO->size = $this->entity->getSize();
     $this->entityDTO->type = $this->entity->getType();
     $this->entityDTO->fileType = $this->entity->getFileType();
     $this->entityDTO->url = $this->entity->getUrl();
     $this->entityDTO->pdfUrl = $this->entity->getPdfUrl();
     $this->entityDTO->epl2Url = $this->entity->getEpl2Url();
     $this->entityDTO->zplUrl = $this->entity->getZplUrl();
 }
コード例 #2
0
ファイル: DummyData.php プロジェクト: inklabs/kommerce-core
 public function getShipmentLabel()
 {
     $shipmentLabel = new ShipmentLabel();
     $shipmentLabel->setExternalId('pl_' . $this->getRandomToken());
     $shipmentLabel->setResolution(300);
     $shipmentLabel->setSize('4x6');
     $shipmentLabel->setType('default');
     $shipmentLabel->setFileType('image/png');
     $shipmentLabel->setUrl('http://assets.geteasypost.com/postage_labels/labels/0jvZJy.png');
     return $shipmentLabel;
 }
コード例 #3
0
 public function testCreate()
 {
     $shipmentLabel = new ShipmentLabel();
     $shipmentLabel->setExternalId('pl_af0ec9e7299a42b3af5adaa3e18ff7fy');
     $shipmentLabel->setResolution(300);
     $shipmentLabel->setSize('4x6');
     $shipmentLabel->setType('default');
     $shipmentLabel->setFileType('image/png');
     $shipmentLabel->setUrl('http://assets.example.com/file.png');
     $shipmentLabel->setPdfUrl('http://assets.example.com/file.pdf');
     $shipmentLabel->setEpl2Url('http://assets.example.com/file.epl2');
     $shipmentLabel->setZplUrl('http://assets.example.com/file.zpl');
     $this->assertEntityValid($shipmentLabel);
     $this->assertSame('pl_af0ec9e7299a42b3af5adaa3e18ff7fy', $shipmentLabel->getExternalId());
     $this->assertSame(300, $shipmentLabel->getResolution());
     $this->assertSame('4x6', $shipmentLabel->getSize());
     $this->assertSame('default', $shipmentLabel->getType());
     $this->assertSame('image/png', $shipmentLabel->getFileType());
     $this->assertSame('http://assets.example.com/file.png', $shipmentLabel->getUrl());
     $this->assertSame('http://assets.example.com/file.pdf', $shipmentLabel->getPdfUrl());
     $this->assertSame('http://assets.example.com/file.epl2', $shipmentLabel->getEpl2Url());
     $this->assertSame('http://assets.example.com/file.zpl', $shipmentLabel->getZplUrl());
 }
コード例 #4
0
 private function getShipmentLabelFromEasyPostShipment($shipment)
 {
     $label = $shipment->postage_label;
     $shipmentLabel = new ShipmentLabel();
     $shipmentLabel->setExternalId($label->id);
     $shipmentLabel->setResolution($label->label_resolution);
     $shipmentLabel->setSize($label->label_size);
     $shipmentLabel->setType($label->label_type);
     $shipmentLabel->setUrl($label->label_url);
     $shipmentLabel->setFileType($label->label_file_type);
     $shipmentLabel->setPdfUrl($label->label_pdf_url);
     $shipmentLabel->setEpl2Url($label->label_epl2_url);
     $shipmentLabel->setZplUrl($label->zpl_url);
     return $shipmentLabel;
 }