1 | <?php |
||
13 | class WC_Gateway_Stripe_P24 extends WC_Stripe_Payment_Gateway { |
||
14 | /** |
||
15 | * Notices (array) |
||
16 | * @var array |
||
17 | */ |
||
18 | public $notices = array(); |
||
19 | |||
20 | /** |
||
21 | * Is test mode active? |
||
22 | * |
||
23 | * @var bool |
||
24 | */ |
||
25 | public $testmode; |
||
26 | |||
27 | /** |
||
28 | * Alternate credit card statement name |
||
29 | * |
||
30 | * @var bool |
||
31 | */ |
||
32 | public $statement_descriptor; |
||
33 | |||
34 | /** |
||
35 | * API access secret key |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | public $secret_key; |
||
40 | |||
41 | /** |
||
42 | * Api access publishable key |
||
43 | * |
||
44 | * @var string |
||
45 | */ |
||
46 | public $publishable_key; |
||
47 | |||
48 | /** |
||
49 | * Should we store the users credit cards? |
||
50 | * |
||
51 | * @var bool |
||
52 | */ |
||
53 | public $saved_cards; |
||
54 | |||
55 | /** |
||
56 | * Constructor |
||
57 | */ |
||
58 | public function __construct() { |
||
92 | |||
93 | /** |
||
94 | * Returns all supported currencies for this payment method. |
||
95 | * |
||
96 | * @since 4.0.0 |
||
97 | * @version 4.0.0 |
||
98 | * @return array |
||
99 | */ |
||
100 | public function get_supported_currency() { |
||
109 | |||
110 | /** |
||
111 | * Checks to see if all criteria is met before showing payment method. |
||
112 | * |
||
113 | * @since 4.0.0 |
||
114 | * @version 4.0.0 |
||
115 | * @return bool |
||
116 | */ |
||
117 | public function is_available() { |
||
124 | |||
125 | /** |
||
126 | * Get_icon function. |
||
127 | * |
||
128 | * @since 1.0.0 |
||
129 | * @version 4.0.0 |
||
130 | * @return string |
||
131 | */ |
||
132 | public function get_icon() { |
||
133 | $icons = $this->payment_icons(); |
||
134 | |||
135 | $icons_str = ''; |
||
136 | |||
137 | $icons_str .= isset( $icons['p24'] ) ? $icons['p24'] : ''; |
||
138 | |||
139 | return apply_filters( 'woocommerce_gateway_icon', $icons_str, $this->id ); |
||
140 | } |
||
141 | |||
142 | /** |
||
143 | * payment_scripts function. |
||
144 | * |
||
145 | * Outputs scripts used for stripe payment |
||
146 | * |
||
147 | * @access public |
||
148 | */ |
||
149 | public function payment_scripts() { |
||
157 | |||
158 | /** |
||
159 | * Initialize Gateway Settings Form Fields. |
||
160 | */ |
||
161 | public function init_form_fields() { |
||
164 | |||
165 | /** |
||
166 | * Payment form on checkout page |
||
167 | */ |
||
168 | public function payment_fields() { |
||
198 | |||
199 | /** |
||
200 | * Creates the source for charge. |
||
201 | * |
||
202 | * @since 4.0.0 |
||
203 | * @version 4.0.0 |
||
204 | * @param object $order |
||
205 | * @return mixed |
||
206 | */ |
||
207 | public function create_source( $order ) { |
||
221 | |||
222 | /** |
||
223 | * Process the payment |
||
224 | * |
||
225 | * @param int $order_id Reference. |
||
226 | * @param bool $retry Should we retry on fail. |
||
227 | * @param bool $force_save_source Force payment source to be saved. |
||
228 | * |
||
229 | * @throws Exception If payment will not be accepted. |
||
230 | * |
||
231 | * @return array|void |
||
232 | */ |
||
233 | public function process_payment( $order_id, $retry = true, $force_save_source = false ) { |
||
282 | } |
||
283 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.