@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | add_action( 'wpinv_worldpay_cc_form', '__return_false' ); |
6 | 8 |
@@ -165,20 +165,17 @@ |
||
165 | 165 | { |
166 | 166 | $xmlx = $xml; |
167 | 167 | $first = false; |
168 | - } |
|
169 | - else |
|
168 | + } else |
|
170 | 169 | { |
171 | 170 | $parent = $xml->xpath('parent::*'); |
172 | 171 | $xmlx = $parent[0]->addChild($xml->getName()); |
173 | 172 | } |
174 | - } |
|
175 | - else |
|
173 | + } else |
|
176 | 174 | { |
177 | 175 | $xmlx = $xml->addChild($key); |
178 | 176 | } |
179 | 177 | $this->setParameters($xmlx, $value); |
180 | - } |
|
181 | - else |
|
178 | + } else |
|
182 | 179 | { |
183 | 180 | $xml->$key = $value; |
184 | 181 | } |
@@ -53,16 +53,14 @@ discard block |
||
53 | 53 | { |
54 | 54 | // Do your processing here. |
55 | 55 | $redirect_url = $url . '?response_code=1&transaction_id=' . $response->transaction_id; |
56 | - } |
|
57 | - else |
|
56 | + } else |
|
58 | 57 | { |
59 | 58 | // Redirect to error page. |
60 | 59 | $redirect_url = $url . '?response_code='.$response->response_code . '&response_reason_text=' . $response->response_reason_text; |
61 | 60 | } |
62 | 61 | // Send the Javascript back to AuthorizeNet, which will redirect user back to your site. |
63 | 62 | echo AuthorizeNetDPM::getRelayResponseSnippet($redirect_url); |
64 | - } |
|
65 | - else |
|
63 | + } else |
|
66 | 64 | { |
67 | 65 | echo "Error -- not AuthorizeNet. Check your MD5 Setting."; |
68 | 66 | } |
@@ -73,8 +71,7 @@ discard block |
||
73 | 71 | if ($_GET['response_code'] == 1) |
74 | 72 | { |
75 | 73 | echo "Thank you for your purchase! Transaction id: " . htmlentities($_GET['transaction_id']); |
76 | - } |
|
77 | - else |
|
74 | + } else |
|
78 | 75 | { |
79 | 76 | echo "Sorry, an error occurred: " . htmlentities($_GET['response_reason_text']); |
80 | 77 | } |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | add_filter( 'wpinv_authorizenet_support_subscription', '__return_true' ); |
6 | 8 |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | add_action( 'wpinv_manual_cc_form', '__return_false' ); |
6 | 8 |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | add_action( 'wpinv_bank_transfer_cc_form', '__return_false' ); |
6 | 8 |
@@ -1,6 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | add_action( 'wpinv_paypal_cc_form', '__return_false' ); |
6 | 8 | add_filter( 'wpinv_paypal_support_subscription', '__return_true' ); |
@@ -307,8 +309,9 @@ discard block |
||
307 | 309 | } |
308 | 310 | |
309 | 311 | // Check if $post_data_array has been populated |
310 | - if ( !is_array( $encoded_data_array ) && !empty( $encoded_data_array ) ) |
|
311 | - return; |
|
312 | + if ( !is_array( $encoded_data_array ) && !empty( $encoded_data_array ) ) { |
|
313 | + return; |
|
314 | + } |
|
312 | 315 | |
313 | 316 | $defaults = array( |
314 | 317 | 'txn_type' => '', |
@@ -95,20 +95,24 @@ |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | if ( !empty( $user_info ) ) { |
98 | - if( empty( $address['first_name'] ) ) |
|
99 | - $address['first_name'] = $user_info->first_name; |
|
98 | + if( empty( $address['first_name'] ) ) { |
|
99 | + $address['first_name'] = $user_info->first_name; |
|
100 | + } |
|
100 | 101 | |
101 | - if( empty( $address['last_name'] ) ) |
|
102 | - $address['last_name'] = $user_info->last_name; |
|
102 | + if( empty( $address['last_name'] ) ) { |
|
103 | + $address['last_name'] = $user_info->last_name; |
|
104 | + } |
|
103 | 105 | } |
104 | 106 | |
105 | 107 | $address['name'] = trim( trim( $address['first_name'] . ' ' . $address['last_name'] ), "," ); |
106 | 108 | |
107 | - if( empty( $address['state'] ) && $with_default ) |
|
108 | - $address['state'] = wpinv_get_default_state(); |
|
109 | + if( empty( $address['state'] ) && $with_default ) { |
|
110 | + $address['state'] = wpinv_get_default_state(); |
|
111 | + } |
|
109 | 112 | |
110 | - if( empty( $address['country'] ) && $with_default ) |
|
111 | - $address['country'] = wpinv_get_default_country(); |
|
113 | + if( empty( $address['country'] ) && $with_default ) { |
|
114 | + $address['country'] = wpinv_get_default_country(); |
|
115 | + } |
|
112 | 116 | |
113 | 117 | |
114 | 118 | return $address; |
@@ -1,6 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly |
3 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
3 | +if ( ! defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | function wpinv_get_item_by( $field = '', $value = '', $type = '' ) { |
6 | 8 | if( empty( $field ) || empty( $value ) ) { |
@@ -118,8 +120,9 @@ discard block |
||
118 | 120 | function wpinv_get_item( $item = 0 ) { |
119 | 121 | if ( is_numeric( $item ) ) { |
120 | 122 | $item = get_post( $item ); |
121 | - if ( ! $item || 'wpi_item' !== $item->post_type ) |
|
122 | - return null; |
|
123 | + if ( ! $item || 'wpi_item' !== $item->post_type ) { |
|
124 | + return null; |
|
125 | + } |
|
123 | 126 | return $item; |
124 | 127 | } |
125 | 128 | |
@@ -283,8 +286,9 @@ discard block |
||
283 | 286 | } |
284 | 287 | |
285 | 288 | function wpinv_remove_item_logs_on_delete( $item_id = 0 ) { |
286 | - if ( 'wpi_item' !== get_post_type( $item_id ) ) |
|
287 | - return; |
|
289 | + if ( 'wpi_item' !== get_post_type( $item_id ) ) { |
|
290 | + return; |
|
291 | + } |
|
288 | 292 | |
289 | 293 | global $wpinv_logs; |
290 | 294 |