-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathShippingInfo.php
More file actions
47 lines (39 loc) · 1.38 KB
/
ShippingInfo.php
File metadata and controls
47 lines (39 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/*
* NOTICE OF LICENSE
*
* This source file is subject to the MIT License
* It is available through the world-wide-web at this URL:
* https://tldrlegal.com/license/mit-license
* If you are unable to obtain it through the world-wide-web, please send an email
* to support@buckaroo.nl so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please contact support@buckaroo.nl for more information.
*
* @copyright Copyright (c) Buckaroo B.V.
* @license https://tldrlegal.com/license/mit-license
*/
namespace Buckaroo\PaymentMethods\Klarna\Models;
use Buckaroo\Models\ShippingInfo as ShippingInfoModel;
use Buckaroo\PaymentMethods\Klarna\Service\ParameterKeys\ShippingInfoAdapter;
class ShippingInfo extends \Buckaroo\Models\ShippingInfo
{
private string $type;
protected ?ShippingInfoAdapter $shippingInfo;
public function __construct(string $type, ?array $values = null)
{
$this->type = $type;
parent::__construct($values);
}
public function shippingInfo($shippingInfo = null)
{
if (is_array($shippingInfo)) {
$this->shippingInfo = new ShippingInfoAdapter(new ShippingInfoModel($shippingInfo), $this->type);
}
return $this->shippingInfo;
}
}