Skip to content

Commit

Permalink
Release/1.19.0 (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelpra authored Sep 8, 2020
1 parent c5e3ec9 commit 6847faa
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 148 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Removed

## [1.19.0] - 2020-09-08

### Added
- added `src/SecucardConnect/Product/Smart/Model/BaseDeliveryOptions.php ` class
- added `src/SecucardConnect/Product/Smart/Model/DeliveryOptionsCollection.php` class
- added `src/SecucardConnect/Product/Smart/Model/DeliveryOptionsShipping.php` class
- added `src/SecucardConnect/Product/Smart/Model/DeliveryOptionsTimeSlot.php` class
- `src/SecucardConnect/Product/Smart/Model/Transaction.php` added `delivery_options` property
- `src/SecucardConnect/Product/Smart/Model/Transaction.php` added `setDeliveryOptions` method

### Changed
- changed `src/SecucardConnect/Product/Smart/Model/DeliveryOptionsTimeSlot.php` const `ORDER_OPTION_COLLECTION` into `DELIVERY_OPTIONS_COLLECTION`
- changed `src/SecucardConnect/Product/Smart/Model/DeliveryOptionsTimeSlot.php` const `ORDER_OPTION_SHIPPING` into `DELIVERY_OPTIONS_SHIPPING`

### Removed
- removed `src/SecucardConnect/Product/General/Model/BaseDeliveryConfiguration.php` class
- removed `src/SecucardConnect/Product/General/Model/CheckoutOptions.php` class
- removed `src/SecucardConnect/Product/General/Model/CollectionDeliveryConfiguration.php` class
- removed `src/SecucardConnect/Product/General/Model/ShippingDeliveryConfiguration.php` class
- removed `src/SecucardConnect/Product/General/Model/OrderOptions.php` class
- removed `src/SecucardConnect/Product/Smart/Model/PickupOptions.php` class
- `src/SecucardConnect/Product/General/Model/Merchant.php` removed `order_options` and `checkout_options` properties
- `src/SecucardConnect/Product/Smart/Model/Transaction.php` removed `order_option` and `pickup_options` properties

## [1.18.0] - 2020-06-24

### Added
Expand Down Expand Up @@ -641,3 +665,4 @@ First release
[1.17.0]:https://github.com/secucard/secucard-connect-php-sdk/compare/1.16.0...1.17.0
[1.17.1]:https://github.com/secucard/secucard-connect-php-sdk/compare/1.17.0...1.17.1
[1.18.0]:https://github.com/secucard/secucard-connect-php-sdk/compare/1.17.1...1.18.0
[1.19.0]:https://github.com/secucard/secucard-connect-php-sdk/compare/1.18.0...1.19.0
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "secucard connect PHP client SDK",
"license": "Apache-2.0",
"homepage": "https://github.com/secucard/secucard-connect-php-sdk",
"version": "1.18.0",
"version": "1.19.0",
"require": {
"php": ">=5.5.0",
"guzzlehttp/guzzle": "~6.3",
Expand Down

This file was deleted.

20 changes: 0 additions & 20 deletions src/SecucardConnect/Product/General/Model/CheckoutOptions.php

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions src/SecucardConnect/Product/General/Model/Merchant.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ class Merchant extends BaseModel
*/
public $legal_details;

/**
* @var OrderOptions
*/
public $order_options;

/**
* @var int[]
*/
Expand All @@ -37,9 +32,4 @@ class Merchant extends BaseModel
* @var MerchantUrl[]
*/
public $merchant_urls;

/**
* @var CheckoutOptions
*/
public $checkout_options;
}
21 changes: 0 additions & 21 deletions src/SecucardConnect/Product/General/Model/OrderOptions.php

This file was deleted.

This file was deleted.

15 changes: 15 additions & 0 deletions src/SecucardConnect/Product/Smart/Model/BaseDeliveryOptions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php


namespace SecucardConnect\Product\Smart\Model;

/**
* BaseDeliveryOptions Api Model class
*/
class BaseDeliveryOptions
{
/**
* @var string
*/
public $type;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace SecucardConnect\Product\Smart\Model;

/**
* DeliveryOptionsCollection Api Model class
*/
class DeliveryOptionsCollection extends BaseDeliveryOptions
{
/**
* @var string string
*/
public $type = Transaction::DELIVERY_OPTIONS_COLLECTION;

/**
* @var string
*/
public $store_id;

/**
* @var string
*/
public $code;

/**
* @var DeliveryOptionsTimeSlot
*/
public $scheduled_slot;

/**
* @var string
*/
public $delivered_at;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace SecucardConnect\Product\Smart\Model;

/**
* DeliveryOptionsShipping Api Model class
*/
class DeliveryOptionsShipping extends BaseDeliveryOptions
{
/**
* @var string
*/
public $type = Transaction::DELIVERY_OPTIONS_SHIPPING;

/**
* @var string
*/
public $shipped_at;

/**
* @var string
*/
public $shipped_by;

/**
* @var string
*/
public $tracking_code;

/**
* @var string
*/
public $invoice_number;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace SecucardConnect\Product\Smart\Model;

/**
* DeliveryOptionsTimeSlot Api Model class
*/
class DeliveryOptionsTimeSlot
{
/**
* @var string
*/
public $start_date;

/**
* @var string
*/
public $end_date;
}
28 changes: 0 additions & 28 deletions src/SecucardConnect/Product/Smart/Model/PickupOptions.php

This file was deleted.

41 changes: 29 additions & 12 deletions src/SecucardConnect/Product/Smart/Model/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class Transaction extends BaseModel
const STATUS_APPROVED = 'approved';
const STATUS_OK = 'ok';

const ORDER_OPTION_COLLECTION = 'collection';
const ORDER_OPTION_SHIPPING = 'shipping';
const DELIVERY_OPTIONS_COLLECTION = 'collection';
const DELIVERY_OPTIONS_SHIPPING = 'shipping';

const CHECKOUT_LAST_VISITED_PAGE_CHECKIN = 'checkin_page';
const CHECKOUT_LAST_VISITED_PAGE_ADDRESS = 'address_page';
Expand Down Expand Up @@ -120,21 +120,11 @@ class Transaction extends BaseModel
*/
public $payment_method;

/**
* @var string
*/
public $order_option;

/**
* @var string
*/
public $last_visited_page;

/**
* @var PickupOptions
*/
public $pickup_options;

/**
* @var string
*/
Expand Down Expand Up @@ -190,6 +180,11 @@ class Transaction extends BaseModel
*/
public $payment_links;

/**
* @var BaseDeliveryOptions
*/
public $delivery_options;

/**
* @return array
*/
Expand All @@ -205,4 +200,26 @@ public function jsonFilterNullProperties()
'error'
];
}

/**
* @param array $payload
* @return $this
*/
public function setDeliveryOptions(array $payload)
{
if (!isset($payload['type'])) {
return $this;
}

switch ($payload['type']) {
case self::DELIVERY_OPTIONS_SHIPPING:
$this->delivery_options = new DeliveryOptionsShipping();
break;
case self::DELIVERY_OPTIONS_COLLECTION:
$this->delivery_options = new DeliveryOptionsCollection();
break;
}

return $this;
}
}
2 changes: 1 addition & 1 deletion src/SecucardConnect/SecucardConnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class SecucardConnect
/**
* SDK version
*/
const VERSION = '1.18.0';
const VERSION = '1.19.0';

/**
* @var OAuthProvider
Expand Down

0 comments on commit 6847faa

Please sign in to comment.