1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* MIT License |
5
|
|
|
* For full license information, please view the LICENSE file that was distributed with this source code. |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace SprykerEco\Zed\Easycredit\Business\Api\Adapter\Http\Factory; |
9
|
|
|
|
10
|
|
|
use GuzzleHttp\ClientInterface; |
11
|
|
|
use SprykerEco\Service\Easycredit\Dependency\Service\EasycreditToUtilEncodingServiceInterface; |
12
|
|
|
use SprykerEco\Zed\Easycredit\Business\Api\Adapter\EasycreditAdapterInterface; |
13
|
|
|
use SprykerEco\Zed\Easycredit\Business\Api\Adapter\Http\ApprovalTextAdapter; |
14
|
|
|
use SprykerEco\Zed\Easycredit\Business\Api\Adapter\Http\InitializePaymentAdapter; |
15
|
|
|
use SprykerEco\Zed\Easycredit\Business\Api\Adapter\Http\InterestAndTotalSumAdapter; |
16
|
|
|
use SprykerEco\Zed\Easycredit\Business\Api\Adapter\Http\OrderConfirmationAdapter; |
17
|
|
|
use SprykerEco\Zed\Easycredit\Business\Api\Adapter\Http\PreContractualInformationAndRedemptionPlanAdapter; |
18
|
|
|
use SprykerEco\Zed\Easycredit\Business\Api\Adapter\Http\QueryCreditAssessmentAdapter; |
19
|
|
|
use SprykerEco\Zed\Easycredit\EasycreditConfig; |
20
|
|
|
|
21
|
|
|
class AdapterFactory implements AdapterFactoryInterface |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* @var \GuzzleHttp\ClientInterface |
25
|
|
|
*/ |
26
|
|
|
protected $client; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var \SprykerEco\Service\Easycredit\Dependency\Service\EasycreditToUtilEncodingServiceInterface |
30
|
|
|
*/ |
31
|
|
|
protected $utilEncodingService; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var \SprykerEco\Zed\Easycredit\EasycreditConfig |
35
|
|
|
*/ |
36
|
|
|
protected $config; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @param \GuzzleHttp\ClientInterface $client |
40
|
|
|
* @param \SprykerEco\Service\Easycredit\Dependency\Service\EasycreditToUtilEncodingServiceInterface $utilEncodingService |
41
|
|
|
* @param \SprykerEco\Zed\Easycredit\EasycreditConfig $config |
42
|
|
|
*/ |
43
|
|
|
public function __construct( |
44
|
|
|
ClientInterface $client, |
45
|
|
|
EasycreditToUtilEncodingServiceInterface $utilEncodingService, |
46
|
|
|
EasycreditConfig $config |
47
|
|
|
) { |
48
|
|
|
$this->client = $client; |
49
|
|
|
$this->utilEncodingService = $utilEncodingService; |
50
|
|
|
$this->config = $config; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @return \SprykerEco\Zed\Easycredit\Business\Api\Adapter\EasycreditAdapterInterface |
55
|
|
|
*/ |
56
|
|
|
public function createInitializePaymentAdapter(): EasycreditAdapterInterface |
57
|
|
|
{ |
58
|
|
|
return new InitializePaymentAdapter($this->client, $this->utilEncodingService, $this->config); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* @return \SprykerEco\Zed\Easycredit\Business\Api\Adapter\EasycreditAdapterInterface |
63
|
|
|
*/ |
64
|
|
|
public function createPreContractualInformationAndRedemptionPlanAdapter(): EasycreditAdapterInterface |
65
|
|
|
{ |
66
|
|
|
return new PreContractualInformationAndRedemptionPlanAdapter($this->client, $this->utilEncodingService, $this->config); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @return \SprykerEco\Zed\Easycredit\Business\Api\Adapter\EasycreditAdapterInterface |
71
|
|
|
*/ |
72
|
|
|
public function createOrderConfirmationAdapter(): EasycreditAdapterInterface |
73
|
|
|
{ |
74
|
|
|
return new OrderConfirmationAdapter($this->client, $this->utilEncodingService, $this->config); |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @return \SprykerEco\Zed\Easycredit\Business\Api\Adapter\EasycreditAdapterInterface |
79
|
|
|
*/ |
80
|
|
|
public function createInterestAndTotalSumAdapter(): EasycreditAdapterInterface |
81
|
|
|
{ |
82
|
|
|
return new InterestAndTotalSumAdapter($this->client, $this->utilEncodingService, $this->config); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @return \SprykerEco\Zed\Easycredit\Business\Api\Adapter\EasycreditAdapterInterface |
87
|
|
|
*/ |
88
|
|
|
public function createQueryCreditAssessmentAdapter(): EasycreditAdapterInterface |
89
|
|
|
{ |
90
|
|
|
return new QueryCreditAssessmentAdapter($this->client, $this->utilEncodingService, $this->config); |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @return \SprykerEco\Zed\Easycredit\Business\Api\Adapter\EasycreditAdapterInterface |
95
|
|
|
*/ |
96
|
|
|
public function createApprovalTextAdapter(): EasycreditAdapterInterface |
97
|
|
|
{ |
98
|
|
|
return new ApprovalTextAdapter($this->client, $this->utilEncodingService, $this->config); |
99
|
|
|
} |
100
|
|
|
} |
101
|
|
|
|