mirror of
https://github.com/10h30/woo-vnpay.git
synced 2026-07-14 04:06:42 +09:00
Release 1.0.2
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!class_exists('Woo_VNPAY_License')) :
|
||||
class Woo_VNPAY_License
|
||||
{
|
||||
function check_license()
|
||||
{
|
||||
$host = "https://license.nhutfs.net/api/";
|
||||
$api_host = $host . "check-license";
|
||||
$woo_vnpay_data = get_option('woo_vnpay');
|
||||
$current_domain = $_SERVER['SERVER_NAME'];
|
||||
$license_key = $woo_vnpay_data['license_key'];
|
||||
if ($license_key == NULL) {
|
||||
$license_key = '0';
|
||||
}
|
||||
$data = array(
|
||||
"domain" => $current_domain,
|
||||
"license-key" => $license_key,
|
||||
"product-id" => WOO_VNPAY_PRODUCT_ID
|
||||
);
|
||||
$result = $this->execPostRequestAPI($api_host, json_encode($data));
|
||||
$jsonResult = json_decode($result, true);
|
||||
if ($jsonResult['result']['status'] == "active" && $jsonResult['result']['product-id'] == WOO_VNPAY_PRODUCT_ID) {
|
||||
if (!file_exists(WOO_VNPAY_LICENSE_FILE_PATH)) {
|
||||
$content = $jsonResult['result']['status'];
|
||||
$fp = fopen(WOO_VNPAY_LICENSE_FILE_PATH, "wb");
|
||||
fwrite($fp, $content);
|
||||
fclose($fp);
|
||||
}
|
||||
} else if ($jsonResult['result']['status'] == "not-active") {
|
||||
if (file_exists(WOO_VNPAY_LICENSE_FILE_PATH)) {
|
||||
unlink(WOO_VNPAY_LICENSE_FILE_PATH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function check_license_file_type()
|
||||
{
|
||||
if (file_exists(WOO_VNPAY_LICENSE_FILE_PATH)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $url
|
||||
* @param $data
|
||||
* @return bool|string
|
||||
*/
|
||||
public function execPostRequestAPI($url, $data)
|
||||
{
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
|
||||
'Content-Type: application/json;charset=UTF-8'
|
||||
)
|
||||
);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 400);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
endif;
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
if (!class_exists('Woo_VNPAY_Option_Page')) :
|
||||
class Woo_VNPAY_Option_Page
|
||||
{
|
||||
private $Woo_VNPAY_Options;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
add_action('admin_menu', array($this, 'register_options_page'));
|
||||
register_activation_hook(__FILE__, array($this, 'option_page_data'));
|
||||
$this->Woo_VNPAY_Options = get_option('woo_vnpay');
|
||||
}
|
||||
|
||||
function register_options_page()
|
||||
{
|
||||
add_options_page('MoMo for WooCommerce', 'Woo VNPay', 'manage_options', 'vnpay-for-woo-option', array(
|
||||
$this,
|
||||
'option_page'
|
||||
));
|
||||
}
|
||||
|
||||
function option_page()
|
||||
{
|
||||
require_once('admin/option-page.php');
|
||||
}
|
||||
|
||||
function option_page_data()
|
||||
{
|
||||
$Woo_VNPAY_Options = array();
|
||||
$Woo_VNPAY_Options["license_key"] = "";
|
||||
add_option('woo_vnpay', $Woo_VNPAY_Options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
endif;
|
||||
@@ -0,0 +1,243 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!class_exists('Woo_VNPay_Payment_Gateway')) :
|
||||
class Woo_VNPay_Payment_Gateway extends WC_Payment_Gateway
|
||||
{
|
||||
/**
|
||||
* Woo_VNPay_Payment_Gateway constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->id = 'woo_vnpay';
|
||||
$this->has_fields = false;
|
||||
$this->method_title = __('VNPAY', 'woo-vnpay');
|
||||
$this->method_description = __('Thanh toán qua VNPAY.', 'woo-vnpay');
|
||||
|
||||
// Load the settings.
|
||||
$this->init_form_fields();
|
||||
$this->init_settings();
|
||||
|
||||
// Define user set variables
|
||||
$this->title = $this->get_option('title');
|
||||
$this->description = $this->get_option('description');
|
||||
$this->instructions = "";
|
||||
|
||||
// Actions
|
||||
add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options'));
|
||||
add_filter('woocommerce_order_button_text', array($this, 'order_button_name'));
|
||||
add_action('woocommerce_thankyou_' . $this->id, array($this, 'vnpay_payment_results'));
|
||||
}
|
||||
|
||||
public function init_form_fields()
|
||||
{
|
||||
$this->form_fields = include('vnpay/vnpay-settings.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $order_id
|
||||
* @return array
|
||||
*/
|
||||
public function process_payment($order_id)
|
||||
{
|
||||
$order = wc_get_order($order_id);
|
||||
$order->update_status($this->get_option('order_created'));
|
||||
|
||||
return array(
|
||||
'result' => 'success',
|
||||
'redirect' => $this->get_pay_url($order)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $order
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_pay_url($order)
|
||||
{
|
||||
$vnp_TmnCode = $this->get_option('vnp_TmnCode');
|
||||
$vnp_HashSecret = $this->get_option('vnp_HashSecret');
|
||||
$vnp_Url = $this->get_option('vnp_Url');
|
||||
$vnp_Returnurl = admin_url('admin-ajax.php?action=vnpay_response&type=international');
|
||||
$array = array(
|
||||
'{{orderid}}' => $order->get_id()
|
||||
);
|
||||
$order_desc = strtr($this->get_option('order_desc'), $array);
|
||||
$vnp_TxnRef = $order->get_id();
|
||||
$vnp_OrderInfo = $order_desc;
|
||||
$vnp_OrderType = 'other';
|
||||
$vnp_Amount = number_format($order->get_total(), 2, '.', '') * 100;
|
||||
$vnp_Locale = 'vn';
|
||||
$vnp_BankCode = '';
|
||||
$vnp_IpAddr = $_SERVER['REMOTE_ADDR'];
|
||||
$inputData = array(
|
||||
"vnp_Version" => "2.0.0",
|
||||
"vnp_TmnCode" => $vnp_TmnCode,
|
||||
"vnp_Amount" => $vnp_Amount,
|
||||
"vnp_Command" => "pay",
|
||||
"vnp_CreateDate" => date('YmdHis'),
|
||||
"vnp_CurrCode" => "VND",
|
||||
"vnp_IpAddr" => $vnp_IpAddr,
|
||||
"vnp_Locale" => $vnp_Locale,
|
||||
"vnp_OrderInfo" => $vnp_OrderInfo,
|
||||
"vnp_OrderType" => $vnp_OrderType,
|
||||
"vnp_ReturnUrl" => $vnp_Returnurl,
|
||||
"vnp_TxnRef" => $vnp_TxnRef,
|
||||
);
|
||||
if (isset($vnp_BankCode) && $vnp_BankCode != "") {
|
||||
$inputData['vnp_BankCode'] = $vnp_BankCode;
|
||||
}
|
||||
ksort($inputData);
|
||||
$query = "";
|
||||
$i = 0;
|
||||
$hashdata = "";
|
||||
foreach ($inputData as $key => $value) {
|
||||
if ($i == 1) {
|
||||
$hashdata .= '&' . $key . "=" . $value;
|
||||
} else {
|
||||
$hashdata .= $key . "=" . $value;
|
||||
$i = 1;
|
||||
}
|
||||
$query .= urlencode($key) . "=" . urlencode($value) . '&';
|
||||
}
|
||||
|
||||
$vnp_Url = $vnp_Url . "?" . $query;
|
||||
if (isset($vnp_HashSecret)) {
|
||||
$vnpSecureHash = hash('sha256', $vnp_HashSecret . $hashdata);
|
||||
$vnp_Url .= 'vnp_SecureHashType=SHA256&vnp_SecureHash=' . $vnpSecureHash;
|
||||
}
|
||||
|
||||
return $vnp_Url;
|
||||
}
|
||||
|
||||
public function vnpay_payment_results($order_id)
|
||||
{
|
||||
$hashSecret = $this->get_option('vnp_HashSecret');
|
||||
$inputData = array();
|
||||
$data = $_REQUEST;
|
||||
foreach ($data as $key => $value) {
|
||||
if (substr($key, 0, 4) == "vnp_") {
|
||||
$inputData[$key] = $value;
|
||||
}
|
||||
}
|
||||
$vnp_SecureHash = $inputData['vnp_SecureHash'];
|
||||
unset($inputData['vnp_SecureHashType']);
|
||||
unset($inputData['vnp_SecureHash']);
|
||||
ksort($inputData);
|
||||
$i = 0;
|
||||
$hashData = "";
|
||||
foreach ($inputData as $key => $value) {
|
||||
if ($i == 1) {
|
||||
$hashData = $hashData . '&' . $key . "=" . $value;
|
||||
} else {
|
||||
$hashData = $hashData . $key . "=" . $value;
|
||||
$i = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$secureHash = hash('sha256', $hashSecret . $hashData);
|
||||
if ($secureHash == $vnp_SecureHash) {
|
||||
if ($_GET['vnp_ResponseCode'] == '00') {
|
||||
$amount = $inputData['vnp_Amount'] / 100;
|
||||
$array = array(
|
||||
'{{orderid}}' => $order_id,
|
||||
'{{amount}}' => number_format($amount, '0', '.', '.') . 'đ',
|
||||
'{{transaction}}' => $inputData['vnp_TransactionNo']
|
||||
);
|
||||
$payment_notice_successful = strtr($this->get_option('payment_notice_successful'), $array);
|
||||
?>
|
||||
<section class="vnpay-payment-gateway-wrapper">
|
||||
<div class="vnpay-payment-gateway-notification">
|
||||
<img src="<?= WOO_VNPAY_PLUGIN_URL . 'assets/images/correct.svg'; ?>"
|
||||
alt="Giao dịch thành công">
|
||||
<h2 class="notification-title">Thanh toán thành công</h2>
|
||||
<p class="notification-content"><?php echo wpautop($payment_notice_successful); ?></p>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<section class="vnpay-payment-gateway-wrapper">
|
||||
<div class="vnpay-payment-gateway-notification">
|
||||
<img src="<?= WOO_VNPAY_PLUGIN_URL . 'assets/images/caution.svg'; ?>"
|
||||
alt="Thanh toán không thành công">
|
||||
<h2 class="notification-title">Thanh toán không thành công</h2>
|
||||
<p class="notification-content">Đã có lỗi trong quá trình thanh toán, vui lòng thử
|
||||
lại!</p>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<section class="vnpay-payment-gateway-wrapper">
|
||||
<div class="vnpay-payment-gateway-notification">
|
||||
<img src="<?= WOO_VNPAY_PLUGIN_URL . 'assets/images/caution.svg'; ?>"
|
||||
alt="Cảnh báo">
|
||||
<h2 class="notification-title">Cảnh báo</h2>
|
||||
<p class="notification-content">Chữ ký không hợp lệ</p>
|
||||
</div>
|
||||
</section>
|
||||
<?php
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $order_button_name
|
||||
* @return string
|
||||
*/
|
||||
public function order_button_name($order_button_name)
|
||||
{
|
||||
$chosen_payment_method = WC()->session->get('chosen_payment_method');
|
||||
if ($chosen_payment_method == 'woo_vnpay') {
|
||||
$order_button_name = $this->get_option('button_label');;
|
||||
} ?>
|
||||
<script type="text/javascript">
|
||||
(function ($) {
|
||||
$('form.checkout').on('change', 'input[name^="payment_method"]', function () {
|
||||
var t = {
|
||||
updateTimer: !1, dirtyInput: !1,
|
||||
reset_update_checkout_timer: function () {
|
||||
clearTimeout(t.updateTimer)
|
||||
}, trigger_update_checkout: function () {
|
||||
t.reset_update_checkout_timer(), t.dirtyInput = !1,
|
||||
$(document.body).trigger("update_checkout")
|
||||
}
|
||||
};
|
||||
t.trigger_update_checkout();
|
||||
});
|
||||
})(jQuery);
|
||||
</script><?php
|
||||
return $order_button_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isValidCurrency()
|
||||
{
|
||||
return in_array(get_woocommerce_currency(), array('VND'));
|
||||
}
|
||||
|
||||
public function admin_options()
|
||||
{
|
||||
if ($this->isValidCurrency()) {
|
||||
parent::admin_options();
|
||||
} else {
|
||||
?>
|
||||
<div class="inline error">
|
||||
<p>
|
||||
<strong><?php _e('Phương thức thanh toán không khả dụng', 'woo-vnpay'); ?></strong>:
|
||||
<?php _e('VNPAY không hỗ trợ đơn vị tiền tệ của bạn. Hiện tại, VNPAY chỉ hỗ trợ đơn vị tiền tệ Việt Nam Đồng (VND).', 'woo-vnpay'); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
endif;
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!class_exists('VNPAYResponse')) {
|
||||
class VNPAYResponse
|
||||
{
|
||||
|
||||
/**
|
||||
* VNPAYResponse constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->action();
|
||||
}
|
||||
|
||||
public function action()
|
||||
{
|
||||
add_action('wp_ajax_vnpay_response', array($this, 'checkResponse'));
|
||||
add_action('wp_ajax_nopriv_vnpay_response', array($this, 'checkResponse'));
|
||||
}
|
||||
|
||||
public function checkResponse()
|
||||
{
|
||||
global $woocommerce;
|
||||
$checkoutUrl = $woocommerce->cart->get_checkout_url();
|
||||
$gateway = new Woo_VNPay_Payment_Gateway;
|
||||
$hashSecret = $gateway->get_option('vnp_HashSecret');
|
||||
$inputData = array();
|
||||
$returnData = array();
|
||||
$amount = $_GET["vnp_Amount"] / 100;
|
||||
$txnResponseCode = $_GET["vnp_ResponseCode"];
|
||||
$order = $this->getOrder($_GET["vnp_OrderInfo"]);
|
||||
$data = $_REQUEST;
|
||||
foreach ($data as $key => $value) {
|
||||
if (substr($key, 0, 4) == "vnp_") {
|
||||
$inputData[$key] = $value;
|
||||
}
|
||||
}
|
||||
$vnp_SecureHash = $inputData['vnp_SecureHash'];
|
||||
unset($inputData['vnp_SecureHashType']);
|
||||
unset($inputData['vnp_SecureHash']);
|
||||
ksort($inputData);
|
||||
$i = 0;
|
||||
$hashData = "";
|
||||
foreach ($inputData as $key => $value) {
|
||||
if ($i == 1) {
|
||||
$hashData = $hashData . '&' . $key . "=" . $value;
|
||||
} else {
|
||||
$hashData = $hashData . $key . "=" . $value;
|
||||
$i = 1;
|
||||
}
|
||||
}
|
||||
$vnpTranId = $inputData['vnp_TransactionNo']; //Mã giao dịch tại VNPAY
|
||||
$vnp_BankCode = $inputData['vnp_BankCode']; //Ngân hàng thanh toán
|
||||
$secureHash = hash('sha256', $hashSecret . $hashData);
|
||||
$Status = 0;
|
||||
$orderId = $inputData['vnp_TxnRef'];
|
||||
$transStatus = '';
|
||||
|
||||
if ($order->post_status != null && $order->post_status != '') {
|
||||
//Check chữ ký
|
||||
if ($secureHash == $vnp_SecureHash) {
|
||||
//Check Status của đơn hàng
|
||||
if ($order->get_status() != null && $order->get_status() != $gateway->get_option('payment_success')) {
|
||||
if ($inputData['vnp_ResponseCode'] == '00') {
|
||||
$transStatus = 'Thanh toán thành công. Mã giao dịch tại VNPAY: ' . $vnpTranId . '. Nội dung thanh toán: ' . $_GET["vnp_OrderInfo"];
|
||||
$returnData['RspCode'] = '00';
|
||||
$returnData['Message'] = 'Confirm Success';
|
||||
$returnData['Signature'] = $secureHash;
|
||||
$order->update_status($gateway->get_option('payment_success'));
|
||||
$order->add_order_note(__($transStatus, 'woo-vnpay'));
|
||||
$woocommerce->cart->empty_cart();
|
||||
$url = wc_get_checkout_url() . 'order-received/' . $order->get_id() . '/?key=' . $order->order_key . '&' . $hashData . '&vnp_SecureHash=' . $vnp_SecureHash;
|
||||
wp_redirect($url);
|
||||
|
||||
} else {
|
||||
$returnData['RspCode'] = '00';
|
||||
$returnData['Message'] = 'Confirm Success';
|
||||
$returnData['Signature'] = $secureHash;
|
||||
$order->add_order_note(__('Thanh toán không thành công', 'woo-vnpay'));
|
||||
$order->update_status('failed');
|
||||
$woocommerce->cart->empty_cart();
|
||||
$url = wc_get_checkout_url() . 'order-received/' . $order->get_id() . '/?key=' . $order->order_key . '&' . $hashData . '&vnp_SecureHash=' . $vnp_SecureHash;
|
||||
wp_redirect($url);
|
||||
}
|
||||
} else {
|
||||
$returnData['RspCode'] = '02';
|
||||
$returnData['Message'] = 'Order already confirmed';
|
||||
$order->update_status($gateway->get_option('payment_failed'));
|
||||
$order->add_order_note(__('Order already confirmed ', 'woo-vnpay'));
|
||||
$woocommerce->cart->empty_cart();
|
||||
$url = wc_get_checkout_url() . 'order-received/' . $order->get_id() . '/?key=' . $order->order_key . '&' . $hashData . '&vnp_SecureHash=' . $vnp_SecureHash;
|
||||
wp_redirect($url);
|
||||
}
|
||||
} else {
|
||||
$returnData['RspCode'] = '97';
|
||||
$returnData['Message'] = 'Chu ky khong hop le';
|
||||
$returnData['Signature'] = $secureHash;
|
||||
$order->update_status($gateway->get_option('payment_failed'));
|
||||
$order->add_order_note(__('Chu ky khong hop le', 'woo-vnpay'));
|
||||
$woocommerce->cart->empty_cart();
|
||||
$url = wc_get_checkout_url() . 'order-received/' . $order->get_id() . '/?key=' . $order->order_key . '&' . $hashData . '&vnp_SecureHash=' . $vnp_SecureHash;
|
||||
wp_redirect($url);
|
||||
}
|
||||
} else {
|
||||
$returnData['RspCode'] = '01';
|
||||
$returnData['Message'] = 'Order not found';
|
||||
$order->update_status($gateway->get_option('payment_failed'));
|
||||
$order->add_order_note(__('Order not found', 'woo-vnpay'));
|
||||
$woocommerce->cart->empty_cart();
|
||||
$url = wc_get_checkout_url() . 'order-received/' . $order->get_id() . '/?key=' . $order->order_key . '&' . $hashData . '&vnp_SecureHash=' . $vnp_SecureHash;
|
||||
wp_redirect($url);
|
||||
}
|
||||
echo json_encode($returnData);
|
||||
die();
|
||||
}
|
||||
|
||||
public function getOrder($orderId)
|
||||
{
|
||||
preg_match_all('!\d+!', $orderId, $matches);
|
||||
$order = new \WC_Order($matches[0][0]);
|
||||
|
||||
return $order;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
return array(
|
||||
'enabled' => array(
|
||||
'title' => __('Bật/Tắt', 'woo-vnpay'),
|
||||
'type' => 'checkbox',
|
||||
'label' => __('Bật phương thức thanh toán', 'woo-vnpay'),
|
||||
'default' => 'yes'
|
||||
),
|
||||
'title' => array(
|
||||
'title' => __('Tiêu đề', 'woo-vnpay'),
|
||||
'type' => 'text',
|
||||
'description' => __('Tên phương thức thanh toán.', 'woo-vnpay'),
|
||||
'default' => __('VNPAY', 'woo-vnpay'),
|
||||
'desc_tip' => true,
|
||||
),
|
||||
'description' => array(
|
||||
'title' => __('Mô tả', 'woo-vnpay'),
|
||||
'type' => 'textarea',
|
||||
'description' => __('Mô tả phương thức thanh toán.', 'woo-vnpay'),
|
||||
'default' => __('Thực hiện thanh toán qua VNPAY.', 'woo-vnpay'),
|
||||
'desc_tip' => true,
|
||||
),
|
||||
'order_desc' => array(
|
||||
'title' => __('Nội dung thanh toán', 'woo-vnpay'),
|
||||
'type' => 'text',
|
||||
'description' => __('Giúp chủ cửa hàng nhận biết thanh toán cho đơn hàng nào.', 'woo-vnpay'),
|
||||
'default' => __('DH{{orderid}}', 'woo-vnpay'),
|
||||
'desc_tip' => true,
|
||||
),
|
||||
'button_label' => array(
|
||||
'title' => __('Nút thanh toán', 'woo-vnpay'),
|
||||
'type' => 'text',
|
||||
'description' => __('Thay đổi tên nút thanh toán.', 'woo-vnpay'),
|
||||
'default' => __('Thanh toán qua VNPAY', 'woo-vnpay'),
|
||||
'desc_tip' => true,
|
||||
),
|
||||
'payment_notice_successful' => array(
|
||||
'title' => __('Thông báo khi thanh toán thành công', 'woo-vnpay'),
|
||||
'type' => 'textarea',
|
||||
'description' => __('{{orderid}} Mã đơn hàng. {{amount}} Số tiền. {{transaction}} Mã giao dịch tại VNPAY.', 'woo-vnpay'),
|
||||
'default' => __('Quý khách đã thanh toán {{amount}} thành công cho đơn hàng {{orderid}}. Mã giao dịch tại VNPAY {{transaction}}. Xin chân thành cảm ơn quý khách!', 'woo-vnpay'),
|
||||
'desc_tip' => false,
|
||||
),
|
||||
'order_created' => array(
|
||||
'title' => __('Trạng thái đơn hàng sau khi đặt hàng', 'woo-vnpay'),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'pending' => __('Chờ thanh toán', 'woocommerce'),
|
||||
'processing' => __('Đang xử lý', 'woocommerce'),
|
||||
'on-hold' => __('Tạm giữ', 'woocommerce'),
|
||||
'completed' => __('Đã hoàn thành', 'woocommerce'),
|
||||
'cancelled' => __('Đã hủy', 'woocommerce'),
|
||||
'refunded' => __('Đã hoàn lại tiền', 'woocommerce'),
|
||||
'failed' => __('Thất bại', 'woocommerce')
|
||||
),
|
||||
'default' => 'pending',
|
||||
'desc_tip' => true,
|
||||
),
|
||||
'payment_success' => array(
|
||||
'title' => __('Trạng thái đơn hàng khi thanh toán thành công', 'woo-vnpay'),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'pending' => __('Chờ thanh toán', 'woocommerce'),
|
||||
'processing' => __('Đang xử lý', 'woocommerce'),
|
||||
'on-hold' => __('Tạm giữ', 'woocommerce'),
|
||||
'completed' => __('Đã hoàn thành', 'woocommerce'),
|
||||
'cancelled' => __('Đã hủy', 'woocommerce'),
|
||||
'refunded' => __('Đã hoàn lại tiền', 'woocommerce'),
|
||||
'failed' => __('Thất bại', 'woocommerce')
|
||||
),
|
||||
'default' => 'processing',
|
||||
'desc_tip' => true,
|
||||
),
|
||||
'payment_failed' => array(
|
||||
'title' => __('Trạng thái đơn hàng khi thanh toán thất bại', 'woo-vnpay'),
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'pending' => __('Chờ thanh toán', 'woocommerce'),
|
||||
'processing' => __('Đang xử lý', 'woocommerce'),
|
||||
'on-hold' => __('Tạm giữ', 'woocommerce'),
|
||||
'completed' => __('Đã hoàn thành', 'woocommerce'),
|
||||
'cancelled' => __('Đã hủy', 'woocommerce'),
|
||||
'refunded' => __('Đã hoàn lại tiền', 'woocommerce'),
|
||||
'failed' => __('Thất bại', 'woocommerce')
|
||||
),
|
||||
'default' => 'cancelled',
|
||||
'desc_tip' => true,
|
||||
),
|
||||
'vnp_Url' => array(
|
||||
'title' => __('URL khởi tạo giao dịch', 'woo-vnpay'),
|
||||
'type' => 'text',
|
||||
'description' => __('URL do VNPAY cung cấp.', 'woo-vnpay'),
|
||||
'desc_tip' => false,
|
||||
),
|
||||
'vnp_TmnCode' => array(
|
||||
'title' => __('Partner code', 'woo-vnpay'),
|
||||
'type' => 'text',
|
||||
'description' => __('Partner code do VNPAY cung cấp.', 'woo-vnpay'),
|
||||
'desc_tip' => false,
|
||||
),
|
||||
'vnp_HashSecret' => array(
|
||||
'title' => __('Secret key', 'woo-vnpay'),
|
||||
'type' => 'password',
|
||||
'description' => __('Secret key do VNPAY cung cấp.', 'woo-vnpay'),
|
||||
'desc_tip' => false,
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user