queryRefundTransactionLog()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
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\Zed\AfterPay\Persistence;
9
10
use Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayAuthorizationQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\AfterPay\Persist...erPayAuthorizationQuery 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 Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayOrderItemQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\AfterPay\Persist...tAfterPayOrderItemQuery 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 Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\AfterPay\Persist...SpyPaymentAfterPayQuery 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 Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayTransactionLogQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\AfterPay\Persist...rPayTransactionLogQuery 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 Orm\Zed\Sales\Persistence\SpySalesOrderQuery;
0 ignored issues
show
Bug introduced by
The type Orm\Zed\Sales\Persistence\SpySalesOrderQuery 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 Spryker\Zed\Kernel\Persistence\AbstractQueryContainer;
16
use SprykerEco\Shared\AfterPay\AfterPayConfig;
17
18
/**
19
 * @method \SprykerEco\Zed\AfterPay\Persistence\AfterPayPersistenceFactory getFactory()
20
 */
21
class AfterPayQueryContainer extends AbstractQueryContainer implements AfterPayQueryContainerInterface
22
{
23
    public const TRANSACTION_TYPE_AUTHORIZE = AfterPayConfig::TRANSACTION_TYPE_AUTHORIZE;
24
    public const TRANSACTION_TYPE_CAPTURE = AfterPayConfig::TRANSACTION_TYPE_CAPTURE;
25
    public const TRANSACTION_TYPE_CANCEL = AfterPayConfig::TRANSACTION_TYPE_CANCEL;
26
    public const TRANSACTION_TYPE_REFUND = AfterPayConfig::TRANSACTION_TYPE_REFUND;
27
28
    /**
29
     * {@inheritDoc}
30
     *
31
     * @api
32
     *
33
     * @param string $orderReference
34
     *
35
     * @return \Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayTransactionLogQuery
36
     */
37
    public function queryAuthorizeTransactionLog(string $orderReference): SpyPaymentAfterPayTransactionLogQuery
38
    {
39
        return $this->getFactory()
40
            ->createPaymentAfterPayTransactionLogQuery()
41
            ->filterByOrderReference($orderReference)
42
            ->filterByTransactionType(static::TRANSACTION_TYPE_AUTHORIZE);
43
    }
44
45
    /**
46
     * {@inheritDoc}
47
     *
48
     * @api
49
     *
50
     * @param string $orderReference
51
     *
52
     * @return \Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayTransactionLogQuery
53
     */
54
    public function queryCaptureTransactionLog(string $orderReference): SpyPaymentAfterPayTransactionLogQuery
55
    {
56
        return $this->getFactory()
57
            ->createPaymentAfterPayTransactionLogQuery()
58
            ->filterByOrderReference($orderReference)
59
            ->filterByTransactionType(static::TRANSACTION_TYPE_CAPTURE);
60
    }
61
62
    /**
63
     * {@inheritDoc}
64
     *
65
     * @api
66
     *
67
     * @param string $orderReference
68
     *
69
     * @return \Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayTransactionLogQuery
70
     */
71
    public function queryCancelTransactionLog(string $orderReference): SpyPaymentAfterPayTransactionLogQuery
72
    {
73
        return $this->getFactory()
74
            ->createPaymentAfterPayTransactionLogQuery()
75
            ->filterByOrderReference($orderReference)
76
            ->filterByTransactionType(static::TRANSACTION_TYPE_CANCEL);
77
    }
78
79
    /**
80
     * {@inheritDoc}
81
     *
82
     * @api
83
     *
84
     * @param string $orderReference
85
     *
86
     * @return \Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayTransactionLogQuery
87
     */
88
    public function queryRefundTransactionLog(string $orderReference): SpyPaymentAfterPayTransactionLogQuery
89
    {
90
        return $this->getFactory()
91
            ->createPaymentAfterPayTransactionLogQuery()
92
            ->filterByOrderReference($orderReference)
93
            ->filterByTransactionType(static::TRANSACTION_TYPE_REFUND);
94
    }
95
96
    /**
97
     * {@inheritDoc}
98
     *
99
     * @api
100
     *
101
     * @param int $idSalesOrder
102
     *
103
     * @return \Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayQuery
104
     */
105
    public function queryPaymentByIdSalesOrder(int $idSalesOrder): SpyPaymentAfterPayQuery
106
    {
107
        return $this
108
            ->getFactory()
109
            ->createPaymentAfterPayQuery()
110
            ->filterByFkSalesOrder($idSalesOrder);
111
    }
112
113
    /**
114
     * {@inheritDoc}
115
     *
116
     * @api
117
     *
118
     * @param int $idSalesOrderItem
119
     * @param int $idPayment
120
     *
121
     * @return \Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayOrderItemQuery
122
     */
123
    public function queryPaymentOrderItemByIdSalesOrderAndIdPayment(int $idSalesOrderItem, int $idPayment): SpyPaymentAfterPayOrderItemQuery
124
    {
125
        return $this
126
            ->getFactory()
127
            ->createPaymentAfterPayOrderItemQuery()
128
            ->filterByFkSalesOrderItem($idSalesOrderItem)
129
            ->filterByFkPaymentAfterPay($idPayment);
130
    }
131
132
    /**
133
     * {@inheritDoc}
134
     *
135
     * @api
136
     *
137
     * @param string $orderReference
138
     * @param string $transactionType
139
     *
140
     * @return \Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayTransactionLogQuery
141
     */
142
    public function queryTransactionByIdSalesOrderAndType(string $orderReference, string $transactionType): SpyPaymentAfterPayTransactionLogQuery
143
    {
144
        return $this->getFactory()
145
            ->createPaymentAfterPayTransactionLogQuery()
146
            ->filterByOrderReference($orderReference)
147
            ->filterByTransactionType($transactionType);
148
    }
149
150
    /**
151
     * {@inheritDoc}
152
     *
153
     * @api
154
     *
155
     * @param string $orderReference
156
     *
157
     * @return \Orm\Zed\AfterPay\Persistence\SpyPaymentAfterPayAuthorizationQuery
158
     */
159
    public function queryAuthorizationByOrderReference(string $orderReference): SpyPaymentAfterPayAuthorizationQuery
160
    {
161
        return $this->getFactory()
162
            ->createPaymentAfterPayAuthorizationQuery()
163
            ->filterByOrderReference($orderReference);
164
    }
165
166
    /**
167
     * {@inheritDoc}
168
     *
169
     * @api
170
     *
171
     * @param int $idSalesOrder
172
     *
173
     * @return \Orm\Zed\Sales\Persistence\SpySalesOrderQuery
174
     */
175
    public function querySalesOrder(int $idSalesOrder): SpySalesOrderQuery
176
    {
177
        return $this->getFactory()
178
            ->createSalesOrderQuery()
179
            ->filterByPrimaryKey($idSalesOrder);
180
    }
181
}
182