Completed
Pull Request — dev (#11)
by Aleksey
10:59 queued 05:13
created

AfterPayStub::getAvailablePaymentMethodsByQuote()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
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\Client\AfterPay\Zed;
9
10
use Generated\Shared\Transfer\AfterPayCustomerLookupRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...erLookupRequestTransfer 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\AfterPayCustomerLookupResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...rLookupResponseTransfer 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\AfterPayInstallmentPlansRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...entPlansRequestTransfer 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\AfterPayInstallmentPlansResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ntPlansResponseTransfer 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\AfterPayValidateBankAccountRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...kAccountRequestTransfer 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\AfterPayValidateBankAccountResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...AccountResponseTransfer 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\AfterPayValidateCustomerRequestTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...CustomerRequestTransfer 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\AfterPayValidateCustomerResponseTransfer;
0 ignored issues
show
Bug introduced by
The type Generated\Shared\Transfe...ustomerResponseTransfer 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 SprykerEco\Client\AfterPay\Dependency\Client\AfterPayToZedRequestClientInterface;
19
20
class AfterPayStub implements AfterPayStubInterface
21
{
22
    /**
23
     * @var \SprykerEco\Client\AfterPay\Dependency\Client\AfterPayToZedRequestClientInterface
24
     */
25
    protected $zedRequestClient;
26
27
    /**
28
     * @param \SprykerEco\Client\AfterPay\Dependency\Client\AfterPayToZedRequestClientInterface $zedRequestClient
29
     */
30
    public function __construct(AfterPayToZedRequestClientInterface $zedRequestClient)
31
    {
32
        $this->zedRequestClient = $zedRequestClient;
33
    }
34
35
    /**
36
     * @param \Generated\Shared\Transfer\AfterPayValidateCustomerRequestTransfer $validateCustomerRequestTransfer
37
     *
38
     * @return \Generated\Shared\Transfer\AfterPayValidateCustomerResponseTransfer
39
     */
40
    public function validateCustomerAddress(AfterPayValidateCustomerRequestTransfer $validateCustomerRequestTransfer): AfterPayValidateCustomerResponseTransfer
41
    {
42
        /** @var \Generated\Shared\Transfer\AfterPayValidateCustomerResponseTransfer $validateCustomerResponseTransfer */
43
        $validateCustomerResponseTransfer = $this->zedRequestClient->call('/after-pay/gateway/validate-customer-address', $validateCustomerRequestTransfer);
44
45
        return $validateCustomerResponseTransfer;
46
    }
47
48
    /**
49
     * @param \Generated\Shared\Transfer\AfterPayCustomerLookupRequestTransfer $customerLookupRequestTransfer
50
     *
51
     * @return \Generated\Shared\Transfer\AfterPayCustomerLookupResponseTransfer
52
     */
53
    public function lookupCustomer(AfterPayCustomerLookupRequestTransfer $customerLookupRequestTransfer): AfterPayCustomerLookupResponseTransfer
54
    {
55
        /** @var \Generated\Shared\Transfer\AfterPayCustomerLookupResponseTransfer $customerLookupResponseTransfer */
56
        $customerLookupResponseTransfer = $this->zedRequestClient->call('/after-pay/gateway/lookup-customer', $customerLookupRequestTransfer);
57
58
        return $customerLookupResponseTransfer;
59
    }
60
61
    /**
62
     * @param \Generated\Shared\Transfer\AfterPayInstallmentPlansRequestTransfer $installmentPlansRequestTransfer
63
     *
64
     * @return \Generated\Shared\Transfer\AfterPayInstallmentPlansResponseTransfer
65
     */
66
    public function getAvailableInstallmentPlans(AfterPayInstallmentPlansRequestTransfer $installmentPlansRequestTransfer): AfterPayInstallmentPlansResponseTransfer
67
    {
68
        /** @var \Generated\Shared\Transfer\AfterPayInstallmentPlansResponseTransfer $installmentPlansResponseTransfer */
69
        $installmentPlansResponseTransfer = $this->zedRequestClient->call('/after-pay/gateway/lookup-installment-plans', $installmentPlansRequestTransfer);
70
71
        return $installmentPlansResponseTransfer;
72
    }
73
74
    /**
75
     * @param \Generated\Shared\Transfer\AfterPayValidateBankAccountRequestTransfer $bankAccountValidationRequestTransfer
76
     *
77
     * @return \Generated\Shared\Transfer\AfterPayValidateBankAccountResponseTransfer
78
     */
79
    public function validateBankAccount(AfterPayValidateBankAccountRequestTransfer $bankAccountValidationRequestTransfer): AfterPayValidateBankAccountResponseTransfer
80
    {
81
        /** @var \Generated\Shared\Transfer\AfterPayValidateBankAccountResponseTransfer $validateBankAccountResponseTransfer */
82
        $validateBankAccountResponseTransfer = $this->zedRequestClient->call('/after-pay/gateway/validate-bank-account', $bankAccountValidationRequestTransfer);
83
84
        return $validateBankAccountResponseTransfer;
85
    }
86
}
87