-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMethod.php
156 lines (140 loc) · 4.35 KB
/
Method.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
namespace Dfe\Moip;
use Df\API\Operation as Op;
use Df\StripeClone\W\Event as Ev;
use Dfe\Moip\Block\Info\Boleto as BlockBoleto;
use Dfe\Moip\Block\Info\Card as BlockCard;
use Magento\Sales\Model\Order\Payment\Transaction as T;
/**
* 2017-04-11
* @method Op chargeNew()
* @method Settings s($k = null, $s = null, $d = null)
*/
final class Method extends \Df\StripeClone\Method {
/**
* 2017-07-23
* @used-by \Dfe\Moip\Block\Info\Card::prepare()
* @used-by \Dfe\Moip\P\Charge::v_CardId
*/
function dob():int {return $this->iia(self::$II_DOB);}
/**
* 2017-07-30
* @override
* @see \Df\Payment\Method::getInfoBlockType()
* @used-by \Magento\Payment\Helper\Data::getInfoBlock():
* public function getInfoBlock(InfoInterface $info, LayoutInterface $layout = null) {
* $layout = $layout ?: $this->_layout;
* $blockType = $info->getMethodInstance()->getInfoBlockType();
* $block = $layout->createBlock($blockType);
* $block->setInfo($info);
* return $block;
* }
* https://github.com/magento/magento2/blob/2.2.0-RC1.6/app/code/Magento/Payment/Helper/Data.php#L182-L196
*/
function getInfoBlockType():string {return df_cc_class_uc('Dfe\Moip\Block\Info', $this->option());}
/**
* 2017-07-30
* @used-by \Dfe\Moip\Block\Info\Boleto::msgCheckoutSuccess()
*/
function isBoleto():bool {return 'boleto' === $this->option();}
/**
* 2017-07-30
* @override
* @see \Df\StripeClone\Method::isCard()
* @used-by \Df\StripeClone\Payer::newCard()
* @used-by \Dfe\Moip\P\Charge::k_Capture()
* @used-by \Dfe\Moip\P\Charge::k_CardId()
* @used-by \Dfe\Moip\P\Charge::k_DSD()
* @used-by \Dfe\Moip\P\Charge::p()
*/
function isCard():bool {return 'card' === $this->option();}
/**
* 2017-07-30
* @used-by self::isBoleto()
* @used-by self::isCard()
* @used-by self::optionTitle()
*/
function option():string {return $this->iia(self::$II_OPTION);}
/**
* 2017-08-02
* @used-by self::titleF()
* @used-by \Dfe\Moip\Choice::title()
* @used-by \Dfe\Moip\ConfigProvider::config()
* @param string|null $o [optional]
*/
function optionTitle($o = null):string {return !($o = ($o ?: $this->option())) ? '' : $this->s("$o/title");}
/**
* 2017-07-15
* @used-by \Dfe\Moip\Block\Info\Card::prepare()
* @used-by \Dfe\Moip\P\Charge::p()
*/
function plan():int {return intval($this->iia(self::$II_PLAN));}
/**
* 2017-07-14
* 2017-07-20 It is CPF: https://en.wikipedia.org/wiki/Cadastro_de_Pessoas_Físicas
* @used-by \Dfe\Moip\P\Charge::pTaxDocument()
* @return string|null
*/
function taxID() {return $this->iia(self::$II_TAX_ID);}
/**
* 2017-04-11
* @override
* @see \Df\Payment\Method::amountLimits()
* @used-by \Df\Payment\Method::isAvailable()
* @return null
*/
protected function amountLimits() {return null;}
/**
* 2017-07-12
* @override
* @see \Df\StripeClone\Method::iiaKeys()
* @used-by \Df\Payment\Method::assignData()
* @return string[]
*/
protected function iiaKeys():array {return array_merge(parent::iiaKeys(), [
self::$II_CARDHOLDER, self::$II_DOB, self::$II_OPTION, self::$II_PLAN, self::$II_TAX_ID
]);}
/**
* 2017-08-02
* @override
* @see \Df\Payment\Method::titleF()
* @used-by \Df\Payment\Method::getTitle()
*/
protected function titleF():string {return $this->optionTitle() ?: parent::titleF();}
/**
* 2017-04-11
* @override
* @see \Df\StripeClone\Method::transUrlBase()
* @used-by \Df\StripeClone\Method::transUrl()
*/
protected function transUrlBase(T $t):string {return '';}
/**
* 2017-07-12 https://github.com/mage2pro/moip/blob/0.6.8/view/frontend/web/main.js#L66-L68
* @used-by self::iiaKeys()
*/
private static $II_CARDHOLDER = 'cardholder';
/**
* 2017-07-23
* @used-by self::dob()
* @used-by self::iiaKeys()
*/
private static $II_DOB = 'dob';
/**
* 2017-07-30 https://github.com/mage2pro/core/blob/2.12.17/Payment/view/frontend/web/withOptions.js#L56-L72
* @used-by self::iiaKeys()
* @used-by self::option()
*/
private static $II_OPTION = 'option';
/**
* 2017-07-15 https://github.com/mage2pro/moip/blob/0.6.8/view/frontend/web/main.js#L66-L68
* @used-by self::iiaKeys()
* @used-by self::plan()
*/
private static $II_PLAN = 'plan';
/**
* 2017-07-12 https://github.com/mage2pro/moip/blob/0.6.8/view/frontend/web/main.js#L66-L68
* @used-by self::taxID()
* @used-by self::iiaKeys()
*/
private static $II_TAX_ID = 'taxID';
}