Totally missed to say that the admin gets this email aswell (when the payment is done):
$history = new stdClass();
$history->history_data = 'TransactionId: '.$transactionId;
if($transactionData->getStatus() == 'pending') {
$email = new stdClass();
$email->subject = JText::sprintf('PAYMENT_NOTIFICATION_FOR_ORDER','Sofort',$transactionData->getStatus(),$dbOrder->order_number);
$email->body = str_replace('<br/>',"\r\n",JText::sprintf('PAYMENT_NOTIFICATION_STATUS','Sofort',$transactionData->getStatus()))."\r\n\r\n".$transactionData->getStatusReason();
$action = false;
$order_status = $this->payment_params->pending_status;
$this->modifyOrder($order_id, $order_status, $history, $email);
return false;
}
if ($transactionData->getStatus() != 'received' && $transactionData->getStatus() != 'untraceable') {
$order_status = 'created';
$email = new stdClass();
$email->body = str_replace('<br/>',"\r\n",JText::sprintf('PAYMENT_NOTIFICATION_STATUS','Sofort',$order_status)).' '.JText::_('STATUS_NOT_CHANGED')."\r\n\r\n".$transactionData->getStatusReason();
$email->subject = JText::sprintf('PAYMENT_NOTIFICATION_FOR_ORDER','Sofort',$order_status,$dbOrder->order_number);
$this->modifyOrder($order_id, $order_status, $history,$email);
return false;
}
$order_status = $this->payment_params->verified_status;
$history->history_data = 'TransactionId: '.$transactionId;
$history->notified = 1;
$email = new stdClass();
$email->subject = JText::sprintf('PAYMENT_NOTIFICATION_FOR_ORDER','Sofort',$transactionData->getStatus(),$dbOrder->order_number);
$email->body = str_replace('<br/>',"\r\n",JText::sprintf('PAYMENT_NOTIFICATION_STATUS','Sofort',$order_status)).' '.JText::sprintf('ORDER_STATUS_CHANGED',$order_status)."\r\n\r\n".$transactionData->getStatusReason();
$this->modifyOrder($order_id, $order_status, $history,$email);
return true;
}
function getPaymentDefaultValues(&$element) {
$element->payment_name = 'SOFORT';
$element->payment_description = 'Betalen met Credit card';
$element->payment_images = 'MasterCard';
$element->payment_params->merchant_id = '';
$element->payment_params->token = '';
$element->payment_params->service_type = 'B';
$element->payment_params->pending_status = 'created';
$element->payment_params->verified_status = 'confirmed';