2022-10-12 10:30:35 - 米境通
我是opencart的新手。我正在使用2.3.0.2版本。我使用pp_standard模板創(chuàng)建了一個(gè)自定義付款。這是發(fā)送到支付網(wǎng)關(guān)的數(shù)據(jù)參數(shù)。
if($order_info){
$data['orderid']=$this->session->data['order_id'];
$data['callbackurl']=$this->url->link('extension/payment/custom_online_banking/callback');
$data['description']=trim($this->config->get('custom_online_banking_description'));
$data['tax_code']=trim($this->config->get('custom_online_banking_tax_code'));
$data['cost_center']=trim($this->config->get('custom_online_banking_cost_center'));
$data['acc_code']=trim($this->config->get('custom_online_banking_acc_code'));
$data['fund_type']=trim($this->config->get('custom_online_banking_fund_type'));
$data['project_code']=trim($this->config->get('custom_online_banking_project_code'));
$data['name']=html_entity_decode($order_info['payment_firstname'].$order_info['payment_lastname'],ENT_QUOTES,'UTF-8');
$data['amtTotal']=$this->currency->format($order_info['total'],$this->session->data['currency'],false,false);
$data['redirect']=$this->url->link('checkout/success');
return$this->load->view('extension/payment/custom_online_banking',$data);
}
付款完成后,支付網(wǎng)關(guān)將通過回叫發(fā)回訂購和付款狀態(tài),系統(tǒng)將其重定向到我的頁面。問題是付款失敗時(shí),它也會(huì)將其重定向到checkout/success。如果付款成功,我如何重定向,它將轉(zhuǎn)到checkout/success,并且付款失敗時(shí),它將轉(zhuǎn)到checkout/failure?