From c270a0d9f20ffc0407a1575475bc172db111032f Mon Sep 17 00:00:00 2001 From: Dat Hoang Date: Sun, 1 Jan 2017 00:25:11 +0700 Subject: [PATCH] Add: the use can select any supported Paypal language Minor: Add the integer check $this->exchange_rate_to_vnd --- inc/class-wooviet-vnd-paypal-standard.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/class-wooviet-vnd-paypal-standard.php b/inc/class-wooviet-vnd-paypal-standard.php index 6f18f1b..a88d2f5 100644 --- a/inc/class-wooviet-vnd-paypal-standard.php +++ b/inc/class-wooviet-vnd-paypal-standard.php @@ -30,9 +30,10 @@ class WooViet_VND_Paypal_Standard { * * @param int $exchange_rate_to_vnd */ - public function __construct( $exchange_rate_to_vnd = 22770 ) { + public function __construct( $exchange_rate_to_vnd = 22770, $paypal_currency ) { - $this->exchange_rate_to_vnd = $exchange_rate_to_vnd; + $this->exchange_rate_to_vnd = (int) $exchange_rate_to_vnd; + $this->paypal_currency = $paypal_currency; // Add VND to the Paypal supported currencies add_filter( 'woocommerce_paypal_supported_currencies', array( $this, 'add_vnd_paypal_valid_currency' ) );