Skip to content

Commit

Permalink
Merge pull request #293 from omise/revert-4.23
Browse files Browse the repository at this point in the history
Revert v4.23.0
  • Loading branch information
FhanOmise authored Aug 4, 2022
2 parents 917e23c + d7d0c1e commit 07d3cf8
Show file tree
Hide file tree
Showing 29 changed files with 58 additions and 882 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

### [v4.23.1 _(Aug 4, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.1)

#### 👾 Bug Fixes
- Fixed issue of page broken when activate plugin version 4.23.0 (PR [#293](https://github.com/omise/omise-woocommerce/pull/293))

### [v4.23.0 _(Jul 25, 2022)_](https://github.com/omise/omise-woocommerce/releases/tag/v4.23.0)

#### 🚀 Enhancements
Expand Down
Binary file removed assets/images/boost.png
Binary file not shown.
Binary file removed assets/images/duitnow-obw.png
Binary file not shown.
Binary file removed assets/images/duitnow-qr.png
Binary file not shown.
Binary file removed assets/images/grabpay.png
Binary file not shown.
Binary file removed assets/images/maybank-qr.png
Binary file not shown.
Binary file removed assets/images/shopeepay.png
Binary file not shown.
Binary file removed assets/images/touch-n-go.png
Binary file not shown.
38 changes: 13 additions & 25 deletions assets/javascripts/omise-payment-form-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
}

$form.prepend( $ulError );
$("html, body").animate({ scrollTop:0 },"slow");
$("html, body").animate({
scrollTop:0
},"slow");
}

function omiseFormHandler(){
Expand Down Expand Up @@ -68,30 +70,19 @@
}
});

let errors = [],
omise_card = {},
let errors = [],
omise_card = {},
omise_card_number_field = 'number',
omise_card_state_field = 'state',
omise_card_fields = {
'name' : $( '#omise_card_name' ),
'number' : $( '#omise_card_number' ),
omise_card_fields = {
'name' : $( '#omise_card_name' ),
'number' : $( '#omise_card_number' ),
'expiration_month' : $( '#omise_card_expiration_month' ),
'expiration_year' : $( '#omise_card_expiration_year' ),
'security_code' : $( '#omise_card_security_code' ),
'city' : $( '#billing_city' ),
'state' : $( '#billing_state' ),
'country' : $( '#billing_country' ),
'postal_code' : $( '#billing_postcode' ),
'street1' : $( '#billing_address_1' )
'expiration_year' : $( '#omise_card_expiration_year' ),
'security_code' : $( '#omise_card_security_code' )
};

$.each( omise_card_fields, function( index, field ) {
if (index === omise_card_state_field) {
omise_card[ index ] = field.find(":selected").text();
} else {
omise_card[ index ] = (index === omise_card_number_field) ? field.val().replace(/\s/g, '') : field.val();
}

omise_card[ index ] = (index === omise_card_number_field) ? field.val().replace(/\s/g, '') : field.val();
if ( "" === omise_card[ index ] ) {
errors.push( omise_params[ 'required_card_' + index ] );
}
Expand All @@ -110,18 +101,15 @@
Omise.createToken("card", omise_card, function (statusCode, response) {
if (statusCode == 200) {
$.each( omise_card_fields, function( index, field ) {
const sensitiveDataIndex = ['name', 'number', 'expiration_year', 'expiration_month', 'security_code'];
if (sensitiveDataIndex.includes(index)) {
field.val( '' );
}
field.val( '' );
} );
$form.append( '<input type="hidden" class="omise_token" name="omise_token" value="' + response.id + '"/>' );
$form.submit();
} else {
handleTokensApiError(response);
};
});
} else {
}else{
showError( omise_params.cannot_load_omisejs + '<br/>' + omise_params.check_internet_connection );
$form.unblock();
}
Expand Down
38 changes: 0 additions & 38 deletions includes/backends/class-omise-backend-touch-n-go.php

This file was deleted.

16 changes: 6 additions & 10 deletions includes/class-omise-callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ public function __construct( $order ) {
}

public static function execute() {
if(RequestHelper::isUserOriginated()) {
return wp_redirect( wc_get_checkout_url() );
}

$order_id = isset( $_GET['order_id'] ) ? sanitize_text_field( $_GET['order_id'] ) : null;

$callback = new self( wc_get_order( $order_id ) );
Expand Down Expand Up @@ -71,8 +67,8 @@ public function validate() {
protected function invalid_result() {
$message = __(
'<strong>We cannot validate your payment result:</strong><br/>
Note that your payment may have already been processed.<br/>
Please contact our support team if you have any questions.',
Note that your payment may have already been processed.<br/>
Please contact our support team if you have any questions.',
'omise'
);

Expand Down Expand Up @@ -112,7 +108,7 @@ protected function payment_pending() {
// Card authorized case.
$message = __(
'Omise: The payment is being processed.<br/>
An amount %1$s %2$s has been authorized.',
An amount %1$s %2$s has been authorized.',
'omise'
);

Expand All @@ -138,8 +134,8 @@ protected function payment_pending() {
// Offsite case.
$message = __(
'Omise: The payment is being processed.<br/>
Depending on the payment provider, this may take some time to process.<br/>
Please do a manual \'Sync Payment Status\' action from the <strong>Order Actions</strong> panel, or check the payment status directly at the Omise Dashboard later.',
Depending on the payment provider, this may take some time to process.<br/>
Please do a manual \'Sync Payment Status\' action from the <strong>Order Actions</strong> panel, or check the payment status directly at the Omise Dashboard later.',
'omise'
);

Expand All @@ -156,7 +152,7 @@ protected function payment_pending() {
* Resolving a case of charge status: failed.
*/
protected function payment_failed() {
$message = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' );
$message = __( "It seems we've been unable to process your payment properly:<br/>%s", 'omise' );
$failure_message = Omise()->translate( $this->charge['failure_message'] ) . ' (code: ' . $this->charge['failure_code'] . ')';

$this->order->add_order_note( sprintf( wp_kses( __( 'OMISE: Payment failed.<br/>%s', 'omise' ), array( 'br' => array() ) ), $failure_message ) );
Expand Down
12 changes: 0 additions & 12 deletions includes/class-omise-capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ public function getBackends( $currency = '' ) {
return $this->capabilities->getBackends( $params );
}

/**
* Retrieves details of Touch n Go payment backends from capabilities.
*
* @return string
*/
public function getTouchNGoBackends() {
$params = array();
$params[] = $this->capabilities->backendFilter['type']('touch_n_go');

return $this->capabilities->getBackends( $params );
}

/**
* Retrieves details of fpx bank list from capabilities.
*
Expand Down
7 changes: 1 addition & 6 deletions includes/class-omise-payment-factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ class Omise_Payment_Factory {
'Omise_Payment_RabbitLinePay',
'Omise_Payment_OCBC_PAO',
'Omise_Payment_GrabPay',
'Omise_Payment_GooglePay',
'Omise_Payment_Boost',
'Omise_Payment_ShopeePay',
'Omise_Payment_Maybank_QR',
'Omise_Payment_DuitNow_QR',
'Omise_Payment_DuitNow_OBW'
'Omise_Payment_GooglePay'
);

/**
Expand Down
9 changes: 9 additions & 0 deletions includes/gateway/class-omise-payment-alipayplus.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,12 @@ public function __construct() {
parent::__construct( $source, $title, $countries );
}
}

class Omise_Payment_TouchNGo extends Omise_Payment_Alipayplus {
public function __construct() {
$source = 'touch_n_go';
$title = 'TNG eWallet';
$countries = array( 'SG' );
parent::__construct( $source, $title, $countries );
}
}
93 changes: 0 additions & 93 deletions includes/gateway/class-omise-payment-boost.php

This file was deleted.

Loading

0 comments on commit 07d3cf8

Please sign in to comment.