Last active
April 9, 2019 13:16
-
-
Save unifysell-user/7eea2dbe6f76fbc932462d2ea02719fb to your computer and use it in GitHub Desktop.
Komplex example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//insert product | |
$prodId = $productApi->postProduct([ | |
'title' => 'Fancy Lamp', | |
'price' => '3.99 EUR', | |
'quantity' => 10 | |
]); | |
//get orders | |
$orderList = $ordersApi->getOrders(['productId' => $prodId]); | |
$order = $orderList[0]; | |
echo $order->getTitle(); | |
# > 'Fancy Lamp' | |
echo $order->getPlatform(); | |
# > 'eBay' | |
$order->getBuyer(); | |
# > ... | |
//payment info | |
echo $order->getPayments()->isPayed(); | |
# > true | |
echo $order->getPayments()->getPlatform(); | |
# > PayPal | |
//request ship label | |
$ticketId = $shipmentApi->postShippingLabel(['order' => $order, 'shipmentProvider' => 'DHL']); | |
$shipmentLabels = $shipmentApi->getShippingLabels(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#insert product | |
prodId = productApi.postProduct({'title': 'Fancy Lamp', 'price': '3.99 EUR', 'quantity': 10}) | |
#get orders | |
orderList = ordersApi.getOrders({'productId': prodId}) | |
order = orderList[0] | |
print(order.getTitle()) | |
print(order.getPlatform()) | |
print(order.getBuyer()) | |
# > Fancy Lamp | |
# > eBay | |
# > Buyer: {'name': 'Peter Parker', ...} | |
#payment info | |
payment = order.getPayment() | |
print(payment.isPayed()) | |
print(payment.getPlatform()) | |
# > true | |
# > PayPal | |
#request ship label | |
shipmentApi.createShippingLabel({'order': order, 'shipmentProvider': 'DHL'}) | |
shipmentLabels = shipmentApi.getShippingLabels() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment