Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
Update Cost and Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Oct 22, 2020
1 parent 887fffd commit d3f496a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
11 changes: 8 additions & 3 deletions examples/110_CreateAndSubmitOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

$request->to->location = 'Новосибирск, ул. Державина, 5';

$request->dimensions->length = 10;
$request->dimensions->length = $length = 10;
$request->dimensions->width = 20;
$request->dimensions->height = 30;
$request->dimensions->weight = 1.25;
Expand Down Expand Up @@ -146,13 +146,18 @@
$place = $request->addPlace($dimensions);
// $place->externalId = '427';
$item = $place->addItem();
$item->dimensions->length = $length / 2;
$item->externalId = '428';
$item->name = '2 товар';
$item->count = 1;
$item->name = 'HELP';
$item->count = 2;
$item->price = 500;
$item->assessedValue = 500;
// $item->tax = $item::TAX_NO_VAT;

$request->cost->assessedValue = 1000;
$request->cost->fullyPrepaid = true;
$request->cost->paymentMethod = $request->cost::PAYMENT_METHOD_PREPAID;

$contact = $request->addContact();

$contact->phone = '+79266056128';
Expand Down
7 changes: 7 additions & 0 deletions src/Common/Cost.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
*/
abstract class Cost
{
/** наличными курьеру */
public const PAYMENT_METHOD_CASH = 'CASH';
/** картой курьеру */
public const PAYMENT_METHOD_CARD = 'CARD';
/** предоплата */
public const PAYMENT_METHOD_PREPAID = 'PREPAID';

/**
* @JMS\Type("float")
*
Expand Down
5 changes: 3 additions & 2 deletions src/Requests/CreateOrderRequest/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ public function build(): CreateOrderRequest
$this->request->deliveryOption->tariffId = $this->deliveryOption->tariffId;
$this->request->deliveryOption->delivery = $this->deliveryOption->cost->delivery;
// $this->request->deliveryOption->deliveryForCustomer = ... ?
// $this->request->deliveryOption->type = 'PICKUP' ...?
$this->request->deliveryOption->deliveryForCustomer = $this->deliveryOption->cost->deliveryForCustomer;

// $this->request->deliveryOption->type = 'PICKUP';
$this->request->deliveryOption->partnerId = $this->deliveryOption->delivery->partner->id;
$this->request->deliveryOption->calculatedDeliveryDateMin = $this->deliveryOption->delivery->calculatedDeliveryDateMin;
$this->request->deliveryOption->calculatedDeliveryDateMax = $this->deliveryOption->delivery->calculatedDeliveryDateMax;
Expand Down

0 comments on commit d3f496a

Please sign in to comment.