sisow plugins emails before payment
hello friends, if you'd like to send customer's emails before the payment is done when using sisow plugins, you may want to adjust the sisow code to:
locate the file:
\libraries\sisow\base.php
original code starting at line 331:
updated code to send email before payment:
please note that this is only a fraction of the code within the file.
best regards, stan, rupostel.com
locate the file:
\libraries\sisow\base.php
original code starting at line 331:
- Code: Select all
$sisow->callbackUrl = $sisow->notifyUrl;
$modelOrder = VmModel::getModel ('orders');
if(($ex = $sisow->TransactionRequest($arg)) < 0)
{
$order['customer_notified'] = 0;
$order['order_status'] = $method->status_failure;
$order['comments'] = $ex . " " . $sisow->errorCode;
$modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);
$app = JFactory::getApplication ();
$app->enqueueMessage (vmText::_('VMPAYMENT_SISOW_PAYMENT_FAILED') . '('.$ex.', '.$sisow->errorCode.')', 'error');
$app->redirect (JRoute::_ ('index.php?option=com_virtuemart&view=cart&task=editpayment'));
exit;
}
else
{
if($order['details']['BT']->order_status != $method->status_pending)
{
$order['customer_notified'] = 0;
$order['order_status'] = $method->status_pending;
$modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);
}
updated code to send email before payment:
- Code: Select all
$sisow->callbackUrl = $sisow->notifyUrl;
$modelOrder = VmModel::getModel ('orders');
if (method_exists($orderModel, 'emptyCache')) {
$modelOrder->emptyCache();
}
if(($ex = $sisow->TransactionRequest($arg)) < 0)
{
$order['customer_notified'] = 1;
$order['order_status'] = $method->status_failure;
$order['comments'] = $ex . " " . $sisow->errorCode;
$modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);
$app = JFactory::getApplication ();
$app->enqueueMessage (vmText::_('VMPAYMENT_SISOW_PAYMENT_FAILED') . '('.$ex.', '.$sisow->errorCode.')', 'error');
$app->redirect (JRoute::_ ('index.php?option=com_virtuemart&view=cart&task=editpayment'));
exit;
}
else
{
if($order['details']['BT']->order_status != $method->status_pending)
{
$order['customer_notified'] = 1;
$order['order_status'] = $method->status_pending;
$modelOrder->updateStatusForOneOrder ($order['details']['BT']->virtuemart_order_id, $order, TRUE);
}
please note that this is only a fraction of the code within the file.
best regards, stan, rupostel.com