I have got an error message for custom payment wordpress plugin when processing the payment such as:
Parse error: syntax error, unexpected T_PUBLIC in /home/galer258/public_html/dev/wp-content/plugins/bcasakuku/result.php on line 3
or please check out this link for further info.
Here result.php script
<?php
public function doPayment(){
$_POST = json_decode(file_get_contents("php://input"), 1);
if( $_SERVER['REQUEST_METHOD'] == 'POST' ){
if( isset( $_POST['MerchantID'] ) AND isset( $_POST['TransactionID'] ) AND isset( $_POST['TransactionReffID'] ) AND isset( $_POST['Signature'] ) ){
//VALIDATE MERCHANT ID
if( $_POST['MerchantID'] == $_POST['MerchantID'] ){
$orders = $_POST['TransactionID'];
if( $orders AND is_numeric( $_POST['TransactionID'] ) ){
if( $orders['order_status_id'] == $this->$_POST['TransactionID'] {
$sakukuOrder = $_POST['TransactionID'];
if( $sakukuOrder ){
$str = $sakukuOrder['AccToken'].$sakukuOrder['TransactionID'].$sakukuOrder['Amount'].$sakukuOrder['PaymentID'];
$validate = strtoupper( hash('sha256', $str) );
if( $_POST['Signature'] == $validate ){
$this->$sakukuOrder['TransactionID'], 5;
$this->generateOutput( 0, "00" );
}else{
$this->generateOutput( 1, "01" );
}
}else{
$this->generateOutput( 1, "01" );
}
}else{
$this->generateOutput( 2, "01" );
}
}else{
$this->generateOutput( 1, "01" );
}
}else{
$this->generateOutput( 1, "01" );
}
}else{
$this->generateOutput( 1, "01" );
}
}else{
$this->generateOutput( 1, "01" );
}
}
private function generateOutput( $rs, $status ){
$reason = array(
"Indonesian" => array("Sukses","Transaksi tidak dapat diproses.","Transaksi sudah dibayar."),
"English" => array("Success","Transaction cannot be processed.","Transaction has been paid."),
);
$output = array(
"MerchantID" => ( !isset( $_POST['MerchantID'] ) ) ? '' : $_POST['MerchantID'],
"TransactionID" => ( !isset( $_POST['TransactionID'] ) ) ? '' : $_POST['TransactionID'],
"FlagStatus" => "01",
"ReasonStatus" => array( "Indonesian" => "", "English" => "" )
);
$output['FlagStatus'] = $status;
$output['ReasonStatus']['Indonesian'] = $reason['Indonesian'][ $rs ];
$output['ReasonStatus']['English'] = $reason['English'][ $rs ];
echo json_encode($output);
}
?>
You can try to buy one product on this link using BCA sakuku as payment option like screenshot below:
Any help would be much appreciated.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire