Mainly to cleanup code after a long work of adding in and removing out partial of code here and there.
2. Description of change
For those /includes/gateway/class-omise-payment-*.php classes.
Only removing 1 indent.
Back to the PR #153: "Code cleaning for payment method classes", the outer function layer has been removed. However, because I don't want to create an unnecessary LOC at that time, so I leave all the code as it is without moving its indent up 1 layer.
So for this time, just to remove the remaining indentation for the following files:
Update code style at /includes/gateway/class-omise-payment.php
Removing unnecessary long pyramid layer of indent. Grouping it to make it easier to read
Before
protected function invalid_order( $order_id ) {
wc_add_notice(
sprintf(
wp_kses(
__( 'We have been unable to process your payment.<br/>Please note that you\'ve done nothing wrong - this is likely an issue with our store.<br/><br/>Feel free to try submitting your order again, or report this problem to our support team (Your temporary order id is \'%s\')', 'omise' ),
array(
'br' => array()
)
),
$order_id
),
'error'
);
}
to
protected function invalid_order( $order_id ) {
$message = wp_kses( __(
'We have been unable to process your payment.<br/>
Please note that you\'ve done nothing wrong - this is likely an issue with our store.<br/>
<br/>
Feel free to try submitting your order again, or report this problem to our support team (Your temporary order id is \'%s\')',
'omise'
), array( 'br' => array() ) );
wc_add_notice( sprintf( $message, $order_id ), 'error' );
}
Removing a local $order variable, accessing Order object from a class's property instead (make sure that the entire of payment processing is using and manipulating the same Order Object).
1. Objective
Mainly to cleanup code after a long work of adding in and removing out partial of code here and there.
2. Description of change
/includes/gateway/class-omise-payment-*.php
classes. Only removing 1 indent.Back to the PR #153: "Code cleaning for payment method classes", the outer function layer has been removed. However, because I don't want to create an unnecessary LOC at that time, so I leave all the code as it is without moving its indent up 1 layer.
So for this time, just to remove the remaining indentation for the following files:
Update code style at
/includes/gateway/class-omise-payment.php
Removing unnecessary long pyramid layer of indent. Grouping it to make it easier to read Beforeto
Removing a local
$order
variable, accessingOrder
object from a class's property instead (make sure that the entire of payment processing is using and manipulating the same Order Object).3. Quality assurance
🔧 Environments:
✏️ Details:
To test
invalid_order
error message (https://github.com/omise/omise-woocommerce/pull/182/files#diff-b2a67ad6a97418df7dddcefcfc2a5319R401), you will need to modifyOmise_Payment::load_order( $order );
code. Right at the first line after an order id has been passed through the method's argument:To test
payment_failed
error message (https://github.com/omise/omise-woocommerce/pull/182/files#diff-b2a67ad6a97418df7dddcefcfc2a5319R407), you may place an order with Credit Card payment method using a failed-test-card. (Insufficient fund error card:4111 1111 1114 0011
)Bill Payment
Credit Card
Installment
Internet Banking
PayNow
TrueMoney Wallet
4. Impact of the change
None
5. Priority of change
Normal
6. Additional Notes
None