mirror of
https://github.com/10h30/vietnam-payment-gateways.git
synced 2026-07-14 04:06:30 +09:00
Add payment-details function
This commit is contained in:
@@ -45,7 +45,7 @@ function vnpg_init_gateway_class() {
|
||||
$this->template_id = $this->get_option( 'template_id' );
|
||||
$this->prefix = $this->get_option('prefix');
|
||||
$this->bank = $this->get_option('bank');
|
||||
|
||||
|
||||
// Actions.
|
||||
add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
|
||||
//add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'save_account_details' ) );
|
||||
@@ -116,13 +116,14 @@ function vnpg_init_gateway_class() {
|
||||
);
|
||||
|
||||
}
|
||||
/**
|
||||
|
||||
/**
|
||||
* Output for the order received page.
|
||||
*
|
||||
* @param int $order_id Order ID.
|
||||
*/
|
||||
public function thankyou_page( $order_id ) {
|
||||
|
||||
$this->payment_details( $order_id );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +134,25 @@ function vnpg_init_gateway_class() {
|
||||
* @param bool $plain_text Email format: plain text or HTML.
|
||||
*/
|
||||
public function email_instructions( $order, $sent_to_admin, $plain_text = false ) {
|
||||
|
||||
if (!$sent_to_admin && 'vnpg' === $order->get_paffyment_method() && $order->has_status('on-hold')) {
|
||||
$this->payment_details($order->get_id());
|
||||
}
|
||||
}
|
||||
|
||||
private function payment_details($order_id = '') {
|
||||
|
||||
// Get order and store in $order.
|
||||
$order = wc_get_order($order_id);
|
||||
|
||||
$html = '<h3>Thông tin thanh toán</h3>';
|
||||
$html .= '<div>Bạn vui lòng chuyển khoản theo thông tin dưới đây</div>';
|
||||
$html .= '<ul>';
|
||||
$html .= '<li class="order-amount">'. $order->get_total() . '</li>';
|
||||
$html .= '<li class="bank-name">'. $this->bank . '</li>';
|
||||
$html .= '<li class="account-number">'. $this->account_number . '</li>';
|
||||
$html .= '<li class="account-name">'. $this->account_name . '</li>';
|
||||
$html.= '<li class="prefix">'. $this->prefix . $order_id .'</li>';
|
||||
$html .= '</ul>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user