diff --git a/craftgate-payment-gateway.php b/craftgate-payment-gateway.php index fca6ecf..0da517e 100644 --- a/craftgate-payment-gateway.php +++ b/craftgate-payment-gateway.php @@ -5,7 +5,7 @@ * Description: Accept debit/credit card payments easily and directly on your WordPress site using Craftgate. * Author: Craftgate * Author URI: https://craftgate.io/ - * Version: 1.0.12 + * Version: 1.0.13 * Requires at least: 4.4 * Tested up to: 6.0 * WC requires at least: 3.0.0 @@ -98,9 +98,8 @@ public function __construct() // Inits admin field and settings. $this->init_admin_settings_form_fields(); $this->init_settings(); - - $this->title = $this->get_option('title'); - $this->description = $this->get_option('description'); + $this->title = !empty($this->get_option('title')) ? $this->get_option('title') : __('Pay with Debit/Credit Card', $this->text_domain); + $this->description = !empty($this->get_option('description')) ? $this->get_option('description') : __('You can pay with Debit and Credit Card', $this->text_domain); // Inits api fields. $this->init_craftgate_api(); @@ -151,11 +150,14 @@ public function init_craftgate_checkout_form($order_id = null) $this->set_cookie_same_site(); $request = $this->build_init_checkout_form_request($order_id); $response = $this->craftgate_api->init_checkout_form($request); - if (isset($response->pageUrl)) { - $language = $this->get_option("language"); + $siteLanguage = explode('_', get_locale())[0]; + $optionLanguage = $this->get_option("language"); + $lang = !empty($optionLanguage) ? $optionLanguage : $siteLanguage; $iframeOptions = $this->get_option("iframe_options"); - echo '
'; + $iframeUrl = $response->pageUrl . '&iframe=true&' . $iframeOptions . '&lang=' . $lang;; + + echo ''; ?>