Skip to content

Commit b2981a6

Browse files
committed
Add shipping delivery type
1 parent 0cbd170 commit b2981a6

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Event/PayPlugPaymentEvent.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,28 @@ public function buildFromOrder(Order $order)
614614
foreach ($order->getOrderProducts() as $orderProduct) {
615615
$this->addProduct((new PayPlugProduct())->buildFromOrderProduct($orderProduct, $payPlugDeliveryType));
616616
}
617+
618+
switch ($payPlugDeliveryType) {
619+
case "carrier":
620+
$shippingDeliveryType = $order->getChoosenDeliveryAddress() !== $order->getChoosenInvoiceAddress() ? "NEW" : "BILLING";
621+
break;
622+
case "storepickup":
623+
$shippingDeliveryType = "SHIP_TO_STORE";
624+
break;
625+
case "networkpickup":
626+
$shippingDeliveryType = "VERIFIED";
627+
break;
628+
case "travelpickup":
629+
$shippingDeliveryType = "TRAVEL_OR_EVENT";
630+
break;
631+
case "edelivery":
632+
$shippingDeliveryType = "DIGITAL_GOODS";
633+
break;
634+
default:
635+
$shippingDeliveryType = "BILLING";
636+
}
637+
638+
$this->setShippingDeliveryType($shippingDeliveryType);
617639
}
618640

619641
return $this;

0 commit comments

Comments
 (0)