opencart 用のカスタム ゲートウェイ モジュールを作成していますが、コードに問題があります。私が間違っていることを教えてください。
opencart デバッガーがエラーを表示します:
[03-Oct-2013 06:50:02 America/Chicago] PHP Fatal error: Call to undefined method ControllerPaymentMyBank::check_order() in /home/***/public_html/catalog/controller/payment/mybank.php on line 207
[03-Oct-2013 06:50:34 America/Chicago] PHP Fatal error: Call to undefined method ControllerPaymentMyBank::ResponseToBank() in /home/***/public_html/catalog/controller/payment/mybank.php on line 225
私が使用する機能:
public function callback() {
//SOME CODE HERE WORKS....
$xml = xml_parser_create('UTF-8');
xml_parse_into_struct($xml, html_entity_decode($_POST['ConfirmRequest']), $vals);
xml_parser_free($xml);
foreach ($vals as $data)
{
if ($data['tag']=='STATUS')
$Status=$data['value'];
if ($data['tag']=='PAYMENTID')
$PaymentId=$data['value'];
if ($data['tag']=='PAYMENTDATE')
$PaymentDate=$data['value'];
if ($data['tag']=='TRANSACTIONID')
$TransactionId=$data['value'];
if ($data['tag']=='AMOUNT')
$Amount=$data['value'];
if ($data['tag']=='REASON')
$Reason=$data['value'];
if ($data['tag']=='CARDTYPE')
$CardType=$data['value'];
}
if($Status=='C')
{
if($this->check_order($TransactionId,$Amount))
$this->ResponseToBank($TransactionId,$PaymentId,'ACCEPTED');
else
$this->ResponseToBank($TransactionId,$PaymentId,'DECLINED');
}
if($Status=='Y')
{
if( $this->success_order($TransactionId) )
$this->ResponseToBank($TransactionId,$PaymentId,'ACCEPTED');
else
$this->ResponseToBank($TransactionId,$PaymentId,'DECLINED');
}
$this->ResponseToBank($TransactionId,$PaymentId,'ACCEPTED');
function ResponseToBank($TransactionId,$PaymentId,$Status)
{
$xmlstr = "<ConfirmResponse>";
$xmlstr .= "<TransactionId>".$TransactionId."</TransactionId>";
$xmlstr .= "<PaymentId>".$PaymentId."</PaymentId>";
$xmlstr .= "<Status>".$Status."</Status>";
$xmlstr .= "</ConfirmResponse>";
header('Content-type: text/xml');
die($xmlstr);
}
function check_order($orderid,$amount)
{
return true;
}
function success_order($orderid)
{
return true;
}
}
これらのメソッドを正しく定義するにはどうすればよいですか?