-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
aahmetgaliev
committed
Jul 24, 2019
1 parent
8234671
commit 52812c0
Showing
5 changed files
with
357 additions
and
69 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,9 @@ API PICKPOINT CONNECTOR | |
```bash | ||
composer require sch-group/pickpoint | ||
``` | ||
Example | ||
Примеры: | ||
|
||
``` | ||
$config = [ | ||
'host' => '', | ||
'login' => '', | ||
|
@@ -20,65 +21,71 @@ $client = new PickPointConnector(new PickPointConf($config), $senderDestination, | |
$points = $client->getPoints(); // получить массив поставматов | ||
// Цены за доставку | ||
``` | ||
Цены за доставку | ||
|
||
``` | ||
$receiverDestination = new ReceiverDestination('Санкт-Петербург', 'Ленинградская обл.'); | ||
$prices = $client->calculatePrices($receiverDestination); // вернет массив с ценами и тарифами | ||
$tariffPrice = $client->calculateObjectedPrices($receiverDestination); // Вернет объект с ценами | ||
$commonStandardPrice = $tariffPrice->getStandardCommonPrice(); // получить общую цену с тарифом стандарт | ||
|
||
// Создание отправления | ||
|
||
``` | ||
Создание отправления | ||
``` | ||
$invoice = new Invoice(); | ||
|
||
$invoice->setSenderCode('order: 123456'); | ||
|
||
$invoice->setPostamatNumber('5602-009'); | ||
|
||
$invoice->setDescription('Custom zakaz'); | ||
|
||
$invoice->setRecipientName('Айнур'); | ||
|
||
$invoice->setMobilePhone('+79274269594'); | ||
|
||
$invoice->setEmail('[email protected]'); | ||
|
||
$invoice->setPostageType('unpiad'); | ||
|
||
$invoice->setGettingType('sc'); | ||
|
||
$invoice->setPostageType('unpiad'); // paid or unpaid | ||
$invoice->setGettingType('sc'); // courier or sc | ||
$invoice->setSum(500.00); | ||
|
||
$invoice->setDeliveryMode('standard'); | ||
|
||
$invoice->setDeliveryMode('standard'); // stanadard or priority | ||
$packageSize = new PackageSize(20, 20, 20); | ||
|
||
$invoice->setPackageSize($packageSize); | ||
|
||
$product = new Product(); | ||
|
||
$product->setDescription('Test product'); | ||
|
||
$product->setPrice(200); | ||
|
||
$product->setQuantity(1); | ||
|
||
$product->setName('Tovar 1'); | ||
|
||
$product->setProductCode('1231'); | ||
|
||
$invoice->setProducts([$product]); | ||
|
||
$address = new Address(); | ||
|
||
$address->setCityName('Казань'); | ||
|
||
$address->setPhoneNumber('+79274269594'); | ||
|
||
$invoice->setClientReturnAddress($address); | ||
$response = $client->createShipment($invoice); | ||
``` | ||
Печать наклейки | ||
``` | ||
$invoice = $client->createShipmentWithInvoice($invoice); | ||
$invoiceNumber = $invoice->getInvoiceNumber(); | ||
$pdfByteCode = $client->printLabel(array($invoiceNumber)); | ||
``` | ||
Создание реестра и печать | ||
``` | ||
$invoice = $client->createShipmentWithInvoice($invoice); | ||
$invoiceNumber = $invoice->getInvoiceNumber(); | ||
$reestr = $client->makeReceipt(array($invoiceNumber)); | ||
$pdfByteCode = $client->rintReceipt($reestr[0]); | ||
$response = $this->client->createShipment($invoice); | ||
``` | ||
Одновременное создание реестра и печать | ||
``` | ||
$invoice = $client->createShipmentWithInvoice($invoice); | ||
$invoiceNumber = $invoice->getInvoiceNumber(); | ||
$pdfByteCode = $this->client->makeReceiptAndPrint(array($invoiceNumber)); | ||
``` | ||
Проверка статуса отправлений | ||
|
||
``` | ||
$invoiceNumber = $invoice->getInvoiceNumber(); | ||
$status = $client->getStatus($invoiceNumber); | ||
``` |
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
Oops, something went wrong.