-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPaymentMethod.php
98 lines (89 loc) · 3.15 KB
/
PaymentMethod.php
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* PHP version 5.4 and 8
*
* @category Enum
* @package Payever\Payments
* @author payever GmbH <[email protected]>
* @author Hennadii.Shymanskyi <[email protected]>
* @copyright 2017-2021 payever GmbH
* @license MIT <https://opensource.org/licenses/MIT>
* @link https://docs.payever.org/shopsystems/api/getting-started
*/
namespace Payever\ExternalIntegration\Payments\Enum;
use Payever\ExternalIntegration\Core\Base\EnumerableConstants;
/**
* List of available for external integration payever payment methods
*/
class PaymentMethod extends EnumerableConstants
{
const METHOD_SANTANDER_DE_FACTORING = 'santander_factoring_de';
const METHOD_SANTANDER_DE_INVOICE = 'santander_invoice_de';
const METHOD_SANTANDER_NO_INVOICE = 'santander_invoice_no';
const METHOD_SANTANDER_DE_INSTALLMENT = 'santander_installment';
const METHOD_SANTANDER_DE_CCP_INSTALLMENT = 'santander_ccp_installment';
const METHOD_SANTANDER_NO_INSTALLMENT = 'santander_installment_no';
const METHOD_SANTANDER_DK_INSTALLMENT = 'santander_installment_dk';
const METHOD_SANTANDER_SE_INSTALLMENT = 'santander_installment_se';
const METHOD_INSTANT_PAYMENT = 'instant_payment';
const METHOD_SOFORT = 'sofort';
const METHOD_PAYMILL_CREDIT_CARD = 'paymill_creditcard';
const METHOD_PAYMILL_DIRECT_DEBIT = 'paymill_directdebit';
const METHOD_PAYPAL = 'paypal';
const METHOD_STRIPE_CREDIT_CARD = 'stripe';
const METHOD_STRIPE_DIRECT_DEBIT = 'stripe_directdebit';
const METHOD_PAYEX_FAKTURA = 'payex_faktura';
const METHOD_PAYEX_CREDIT_CARD = 'payex_creditcard';
const METHOD_OPENBANK = 'zinia_bnpl';
const METHOD_ZINIA_BNPL = 'zinia_bnpl';
const METHOD_ZINIA_BNPL_DE = 'zinia_bnpl_de';
const METHOD_ZINIA_SLICE_THREE = 'zinia_slice_three';
/**
* Whether payment method must be hidden when shipping address differs from billing one
*
* @param string $method
*
* @return bool
*/
public static function shouldHideOnDifferentAddress($method)
{
return in_array($method, static::getShouldHideOnDifferentAddressMethods());
}
/**
* Whether payment method must be hidden after first unsuccessful payment attempt
*
* @param string $method
*
* @return bool
*/
public static function shouldHideOnReject($method)
{
return in_array($method, static::getShouldHideOnRejectMethods());
}
/**
* @return array
*/
public static function getShouldHideOnDifferentAddressMethods()
{
return [
static::METHOD_SANTANDER_DE_CCP_INSTALLMENT,
static::METHOD_SANTANDER_DE_INSTALLMENT,
static::METHOD_SANTANDER_DE_FACTORING,
static::METHOD_SANTANDER_DE_INVOICE,
static::METHOD_PAYEX_FAKTURA,
static::METHOD_ZINIA_BNPL,
static::METHOD_ZINIA_BNPL_DE,
static::METHOD_ZINIA_SLICE_THREE
];
}
/**
* @return array
*/
public static function getShouldHideOnRejectMethods()
{
return [
static::METHOD_SANTANDER_DE_FACTORING,
static::METHOD_SANTANDER_DE_INVOICE,
];
}
}