Completed
Push — master ( 9db63e...40913a )
by Oleksandr
24s queued 13s
created

PayoneClient::sendKlarnaStartSessionRequest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * MIT License
5
 * Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
6
 */
7
8
namespace SprykerEco\Client\Payone;
9
10
use Generated\Shared\Transfer\AddressCheckResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ssCheckResponseTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Generated\Shared\Transfer\ConsumerScoreResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...erScoreResponseTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
12
use Generated\Shared\Transfer\PayoneBankAccountCheckTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ankAccountCheckTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use Generated\Shared\Transfer\PayoneCancelRedirectTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...eCancelRedirectTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
use Generated\Shared\Transfer\PayoneGetFileTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayoneGetFileTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
use Generated\Shared\Transfer\PayoneGetInvoiceTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\PayoneGetInvoiceTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
use Generated\Shared\Transfer\PayoneGetPaymentDetailTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...etPaymentDetailTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
use Generated\Shared\Transfer\PayoneInitPaypalExpressCheckoutRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...CheckoutRequestTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
18
use Generated\Shared\Transfer\PayoneKlarnaStartSessionRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...tSessionRequestTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
19
use Generated\Shared\Transfer\PayoneKlarnaStartSessionResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...SessionResponseTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
20
use Generated\Shared\Transfer\PayoneManageMandateTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...neManageMandateTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
21
use Generated\Shared\Transfer\PayonePersonalDataTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...onePersonalDataTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
22
use Generated\Shared\Transfer\PayoneTransactionStatusUpdateTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ionStatusUpdateTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
use Generated\Shared\Transfer\QuoteTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfer\QuoteTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
24
use Spryker\Client\Kernel\AbstractClient;
25
use SprykerEco\Client\Payone\ClientApi\Request\CreditCardCheckContainerInterface;
26
27
/**
28
 * @api
29
 *
30
 * @method \SprykerEco\Client\Payone\PayoneFactory getFactory()
31
 */
32
class PayoneClient extends AbstractClient implements PayoneClientInterface
33
{
34
    /**
35
     * {@inheritDoc}
36
     *
37
     * @api
38
     *
39
     * @return \SprykerEco\Client\Payone\ClientApi\Request\CreditCardCheckContainerInterface
40
     */
41
    public function getCreditCardCheckRequest(): CreditCardCheckContainerInterface
42
    {
43
        $defaults = [];
44
45
        return $this->getFactory()->createCreditCardCheckCall($defaults)->mapCreditCardCheckData();
46
    }
47
48
    /**
49
     * {@inheritDoc}
50
     *
51
     * @api
52
     *
53
     * @param \Generated\Shared\Transfer\PayoneTransactionStatusUpdateTransfer $statusUpdateTransfer
54
     *
55
     * @return \Generated\Shared\Transfer\PayoneTransactionStatusUpdateTransfer
56
     */
57
    public function updateStatus(PayoneTransactionStatusUpdateTransfer $statusUpdateTransfer)
58
    {
59
        return $this->getFactory()->createZedStub()->updateStatus($statusUpdateTransfer);
60
    }
61
62
    /**
63
     * {@inheritDoc}
64
     *
65
     * @api
66
     *
67
     * @param \Generated\Shared\Transfer\PayoneGetFileTransfer $getFileTransfer
68
     *
69
     * @return \Generated\Shared\Transfer\PayoneGetFileTransfer
70
     */
71
    public function getFile(PayoneGetFileTransfer $getFileTransfer)
72
    {
73
        return $this->getFactory()->createZedStub()->getFile($getFileTransfer);
74
    }
75
76
    /**
77
     * {@inheritDoc}
78
     *
79
     * @api
80
     *
81
     * @param \Generated\Shared\Transfer\PayoneCancelRedirectTransfer $cancelRedirectTransfer
82
     *
83
     * @return \Generated\Shared\Transfer\PayoneCancelRedirectTransfer
84
     */
85
    public function cancelRedirect(PayoneCancelRedirectTransfer $cancelRedirectTransfer)
86
    {
87
        return $this->getFactory()->createZedStub()->cancelRedirect($cancelRedirectTransfer);
88
    }
89
90
    /**
91
     * {@inheritDoc}
92
     *
93
     * @api
94
     *
95
     * @param \Generated\Shared\Transfer\PayoneBankAccountCheckTransfer $bankAccountCheckTransfer
96
     *
97
     * @return \Generated\Shared\Transfer\PayoneBankAccountCheckTransfer
98
     */
99
    public function bankAccountCheck(PayoneBankAccountCheckTransfer $bankAccountCheckTransfer)
100
    {
101
        return $this->getFactory()->createZedStub()->bankAccountCheck($bankAccountCheckTransfer);
102
    }
103
104
    /**
105
     * {@inheritDoc}
106
     *
107
     * @api
108
     *
109
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
110
     *
111
     * @return \Generated\Shared\Transfer\PayoneManageMandateTransfer
112
     */
113
    public function manageMandate(QuoteTransfer $quoteTransfer)
114
    {
115
        $manageMandateTransfer = new PayoneManageMandateTransfer();
116
        $manageMandateTransfer->setBankCountry($quoteTransfer->getPayment()->getPayoneDirectDebit()->getBankcountry());
117
        $manageMandateTransfer->setBankAccount($quoteTransfer->getPayment()->getPayoneDirectDebit()->getBankaccount());
118
        $manageMandateTransfer->setBankCode($quoteTransfer->getPayment()->getPayoneDirectDebit()->getBankcode());
119
        $manageMandateTransfer->setIban($quoteTransfer->getPayment()->getPayoneDirectDebit()->getIban());
120
        $manageMandateTransfer->setBic($quoteTransfer->getPayment()->getPayoneDirectDebit()->getBic());
121
        $personalData = new PayonePersonalDataTransfer();
122
        $customer = $quoteTransfer->getCustomer();
123
        $billingAddress = $quoteTransfer->getBillingAddress();
124
        $personalData->setCustomerId($customer->getIdCustomer());
125
        $personalData->setLastName($billingAddress->getLastName());
126
        $personalData->setFirstName($billingAddress->getFirstName());
127
        $personalData->setCompany($billingAddress->getCompany());
128
        $personalData->setCountry($billingAddress->getIso2Code());
129
        $personalData->setCity($billingAddress->getCity());
130
        $personalData->setStreet($billingAddress->getAddress1());
131
        $personalData->setZip($billingAddress->getZipCode());
132
        $personalData->setEmail($billingAddress->getEmail() ?? $customer->getEmail());
133
        $manageMandateTransfer->setPersonalData($personalData);
134
135
        return $this->getFactory()->createZedStub()->manageMandate($manageMandateTransfer);
136
    }
137
138
    /**
139
     * {@inheritDoc}
140
     *
141
     * @api
142
     *
143
     * @param \Generated\Shared\Transfer\PayoneGetPaymentDetailTransfer $getPaymentDetailTransfer
144
     *
145
     * @return \Generated\Shared\Transfer\PayoneGetPaymentDetailTransfer
146
     */
147
    public function getPaymentDetail(PayoneGetPaymentDetailTransfer $getPaymentDetailTransfer)
148
    {
149
        return $this->getFactory()->createZedStub()->getPaymentDetail($getPaymentDetailTransfer);
150
    }
151
152
    /**
153
     * {@inheritDoc}
154
     *
155
     * @api
156
     *
157
     * @param \Generated\Shared\Transfer\PayoneGetInvoiceTransfer $getInvoiceTransfer
158
     *
159
     * @return \Generated\Shared\Transfer\PayoneGetInvoiceTransfer
160
     */
161
    public function getInvoice(PayoneGetInvoiceTransfer $getInvoiceTransfer)
162
    {
163
        return $this->getFactory()->createZedStub()->getInvoice($getInvoiceTransfer);
164
    }
165
166
    /**
167
     * {@inheritDoc}
168
     *
169
     * @api
170
     *
171
     * @param \Generated\Shared\Transfer\PayoneInitPaypalExpressCheckoutRequestTransfer $requestTransfer
172
     *
173
     * @return \Generated\Shared\Transfer\PayonePaypalExpressCheckoutGenericPaymentResponseTransfer
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...PaymentResponseTransfer was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
174
     */
175
    public function initPaypalExpressCheckout(PayoneInitPaypalExpressCheckoutRequestTransfer $requestTransfer)
176
    {
177
        return $this->getFactory()->createZedStub()->initPaypalExpressCheckout($requestTransfer);
178
    }
179
180
    /**
181
     * {@inheritDoc}
182
     *
183
     * @api
184
     *
185
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
186
     *
187
     * @return \Generated\Shared\Transfer\PayonePaypalExpressCheckoutGenericPaymentResponseTransfer
188
     */
189
    public function getPaypalExpressCheckoutDetails(QuoteTransfer $quoteTransfer)
190
    {
191
        return $this->getFactory()->createZedStub()->getPaypalExpressCheckoutDetails($quoteTransfer);
192
    }
193
194
    /**
195
     * {@inheritDoc}
196
     *
197
     * @api
198
     *
199
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
200
     *
201
     * @return \Generated\Shared\Transfer\AddressCheckResponseTransfer
202
     */
203
    public function sendAddressCheckRequest(QuoteTransfer $quoteTransfer): AddressCheckResponseTransfer
204
    {
205
        return $this->getFactory()->createZedStub()->sendAddressCheckRequest($quoteTransfer);
206
    }
207
208
    /**
209
     * {@inheritDoc}
210
     *
211
     * @api
212
     *
213
     * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
214
     *
215
     * @return \Generated\Shared\Transfer\ConsumerScoreResponseTransfer
216
     */
217
    public function sendConsumerScoreRequest(QuoteTransfer $quoteTransfer): ConsumerScoreResponseTransfer
218
    {
219
        return $this->getFactory()->createZedStub()->sendConsumerScoreRequest($quoteTransfer);
220
    }
221
222
    /**
223
     * {@inheritDoc}
224
     *
225
     * @api
226
     *
227
     * @param \Generated\Shared\Transfer\PayoneKlarnaStartSessionRequestTransfer $payoneKlarnaStartSessionRequestTransfer
228
     *
229
     * @return \Generated\Shared\Transfer\PayoneKlarnaStartSessionResponseTransfer
230
     */
231
    public function sendKlarnaStartSessionRequest(
232
        PayoneKlarnaStartSessionRequestTransfer $payoneKlarnaStartSessionRequestTransfer
233
    ): PayoneKlarnaStartSessionResponseTransfer {
234
        return $this->getFactory()->createZedStub()->sendKlarnaStartSessionRequest($payoneKlarnaStartSessionRequestTransfer);
235
    }
236
}
237