Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions plugins/redform_payment/nganluong/helpers/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,12 @@ public function notify()
$returnUrl = $input->post->get('return_url');
$cancelUrl = urlencode($input->post->get('cancel_url'));

$buyerFullname = $input->post->get('buyer_fullname');
$buyerEmail = $input->post->get('buyer_email');
$buyerMobile = $input->post->get('buyer_mobile');
$buyerAddress = '';
$billingInfo = $this->getBillingInfo($details->id);

$buyerFullname = $billingInfo->fullname;
$buyerEmail = $billingInfo->email;
$buyerMobile = $billingInfo->phone;
$buyerAddress = $billingInfo->address;

$resp = array();
$resp[] = 'id:' . $orderCode;
Expand Down Expand Up @@ -176,4 +178,22 @@ protected function getOrderID($cartId)

return $db->setQuery($query)->loadResult();
}

/**
* get order id
*
* @param int $cartId cart ID
*
* @return object
*/
protected function getBillingInfo($cartId)
{
$db = JFactory::getDBO();
$query = $db->getQuery(true)
->select('b.*')
->from($db->qn('#__rwf_billinginfo', 'b'))
->where($db->qn('b.cart_id') . ' = ' . $db->q((int) $cartId));

return $db->setQuery($query)->loadObject();
}
}
22 changes: 1 addition & 21 deletions plugins/redform_payment/nganluong/layouts/notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,27 +92,7 @@
width: 90px;
}
</style>
<form name="NLpayBank" action="<?php echo $action; ?>" method="post">
<table style="clear:both;width:500px;padding-left:46px;">
<tr><td colspan="2"><p><span style="color:#ff5a00;font-weight:bold;text-decoration:underline;"><?php echo JText::_('PLG_REDFORM_PAYMENT_NGANLUONG_NOTICE'); ?></span> <?php echo JText::_('PLG_REDFORM_PAYMENT_NGANLUONG_CONFIRM'); ?> </td>

</tr>
<tr><td><?php echo JText::_('PLG_REDFORM_PAYMENT_NGANLUONG_NAME'); ?></td>
<td>
<input type="text" style="width:270px" id="fullname" name="buyer_fullname" class="field-check " value="">
</td>
</tr>
<tr><td><?php echo JText::_('PLG_REDFORM_PAYMENT_NGANLUONG_EMAIL'); ?></td>
<td>
<input type="text" style="width:270px" id="fullname" name="buyer_email" class="field-check " value="">
</td>
</tr>
<tr><td><?php echo JText::_('PLG_REDFORM_PAYMENT_NGANLUONG_MOBILE'); ?></td>
<td>
<input type="text" style="width:270px" id="fullname" name="buyer_mobile" class="field-check " value="">
</td>
</tr>
</table>
<form name="NLpayBank" action="<?php echo $action; ?>" method="post">
<ul class="list-content">
<li class="active">
<label><input type="radio" value="NL" name="option_payment" selected="true"><?php echo JText::_('PLG_REDFORM_PAYMENT_NGANLUONG_CHECKOUT_NGANLUONG_WALLET'); ?></label>
Expand Down