Skip to content

Commit

Permalink
updating deprecated function since woocommerce v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkathale committed Sep 14, 2020
1 parent 2c04676 commit 5076f52
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions includes/class-omise-callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected function payment_successful() {
sprintf(
wp_kses( $message, array( 'br' => array() ) ),
$this->order->get_total(),
$this->order->get_order_currency()
$this->order->get_currency()
)
);

Expand Down Expand Up @@ -116,7 +116,7 @@ protected function payment_pending() {
sprintf(
wp_kses( $message, array( 'br' => array() ) ),
$this->order->get_total(),
$this->order->get_order_currency()
$this->order->get_currency()
)
);
$this->order->payment_complete();
Expand Down
2 changes: 1 addition & 1 deletion includes/gateway/abstract-omise-payment-offline.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class Omise_Payment_Offline extends Omise_Payment {
*/
public function charge( $order_id, $order ) {
$total = $order->get_total();
$currency = $order->get_order_currency();
$currency = $order->get_currency();
$metadata = array_merge(
apply_filters( 'omise_charge_params_metadata', array(), $order ),
array( 'order_id' => $order_id ) // override order_id as a reference for webhook handlers.
Expand Down
4 changes: 2 additions & 2 deletions includes/gateway/class-omise-payment-alipay.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public function charge( $order_id, $order ) {
);

return OmiseCharge::create( array(
'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_order_currency() ),
'currency' => $order->get_order_currency(),
'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_currency() ),
'currency' => $order->get_currency(),
'description' => apply_filters( 'omise_charge_params_description', 'WooCommerce Order id ' . $order_id, $order ),
'source' => array( 'type' => 'alipay' ),
'return_uri' => $return_uri,
Expand Down
10 changes: 5 additions & 5 deletions includes/gateway/class-omise-payment-creditcard.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ public function charge( $order_id, $order ) {
home_url()
);
$data = array(
'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_order_currency() ),
'currency' => $order->get_order_currency(),
'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_currency() ),
'currency' => $order->get_currency(),
'description' => apply_filters( 'omise_charge_params_description', 'WooCommerce Order id ' . $order_id, $order ),
'return_uri' => $return_uri
);
Expand Down Expand Up @@ -296,7 +296,7 @@ public function result( $order_id, $order, $charge ) {
array( 'br' => array() )
),
$order->get_total(),
$order->get_order_currency()
$order->get_currency()
)
);
$order->payment_complete();
Expand All @@ -314,7 +314,7 @@ public function result( $order_id, $order, $charge ) {
array( 'br' => array() )
),
$order->get_total(),
$order->get_order_currency()
$order->get_currency()
)
);
$order->payment_complete();
Expand Down Expand Up @@ -373,7 +373,7 @@ public function process_capture( $order ) {
array( 'br' => array() )
),
$this->order()->get_total(),
$this->order()->get_order_currency()
$this->order()->get_currency()
)
);
$this->order()->payment_complete();
Expand Down
4 changes: 2 additions & 2 deletions includes/gateway/class-omise-payment-installment.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public function charge( $order_id, $order ) {
);

return OmiseCharge::create( array(
'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_order_currency() ),
'currency' => $order->get_order_currency(),
'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_currency() ),
'currency' => $order->get_currency(),
'description' => apply_filters( 'omise_charge_params_description', 'WooCommerce Order id ' . $order_id, $order ),
'source' => array(
'type' => sanitize_text_field( $source_type ),
Expand Down
4 changes: 2 additions & 2 deletions includes/gateway/class-omise-payment-internetbanking.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ public function charge( $order_id, $order ) {
);

return OmiseCharge::create( array(
'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_order_currency() ),
'currency' => $order->get_order_currency(),
'amount' => Omise_Money::to_subunit( $order->get_total(), $order->get_currency() ),
'currency' => $order->get_currency(),
'description' => apply_filters('omise_charge_params_description', 'WooCommerce Order id ' . $order_id, $order),
'source' => array( 'type' => sanitize_text_field( $_POST['omise-offsite'] ) ),
'return_uri' => $return_uri,
Expand Down
2 changes: 1 addition & 1 deletion includes/gateway/class-omise-payment-truemoney.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function payment_fields() {
public function charge( $order_id, $order ) {
$phone_number = isset( $_POST['omise_phone_number_default'] ) && 1 == $_POST['omise_phone_number_default'] ? $order->get_billing_phone() : sanitize_text_field( $_POST['omise_phone_number'] );
$total = $order->get_total();
$currency = $order->get_order_currency();
$currency = $order->get_currency();
$return_uri = add_query_arg(
array( 'wc-api' => 'omise_truemoney_callback', 'order_id' => $order_id ), home_url()
);
Expand Down
6 changes: 3 additions & 3 deletions includes/gateway/class-omise-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) {
try {
$charge = OmiseCharge::retrieve( $order->get_transaction_id() );
$refund = $charge->refunds()->create( array(
'amount' => Omise_Money::to_subunit( $amount, $order->get_order_currency() ),
'amount' => Omise_Money::to_subunit( $amount, $order->get_currency() ),
'metadata' => array( 'reason' => sanitize_text_field( $reason ) )
) );

Expand All @@ -264,7 +264,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) {
array( 'br' => array() )
),
$amount,
$order->get_order_currency(),
$order->get_currency(),
$refund['id']
);
} else {
Expand All @@ -274,7 +274,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) {
array( 'br' => array() )
),
$amount,
$order->get_order_currency(),
$order->get_currency(),
$refund['id']
);
}
Expand Down

0 comments on commit 5076f52

Please sign in to comment.