API Chat
This commit is contained in:
@@ -39,25 +39,23 @@ class DuitkuHelper
|
||||
];
|
||||
try {
|
||||
$transactionList = \Duitku\Pop::transactionStatus($merchantOrderId, $duitkuConfig);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$transaction = json_decode($transactionList);
|
||||
|
||||
// var_dump($transactionList);
|
||||
|
||||
if ($transaction->statusCode == "00") {
|
||||
// Action Success
|
||||
} else if ($transaction->statusCode == "01") {
|
||||
// Action Pending
|
||||
if ($transaction->statusCode == "00" || $transaction->statusCode == "01") {
|
||||
// Transaksi berhasil atau dalam proses
|
||||
return $transaction;
|
||||
} else {
|
||||
// Action Failed Or Expired
|
||||
// Transaksi gagal atau kedaluwarsa
|
||||
return ['error' => true];
|
||||
}
|
||||
return $transaction;
|
||||
// return json_decode($transaction);
|
||||
} catch (\Duitku\Exceptions\DuitkuException $e) {
|
||||
// Tangani pengecualian yang terkait dengan Duitku
|
||||
return ['error' => true, 'message' => $e->getMessage()];
|
||||
} catch (Exception $e) {
|
||||
return $e->getMessage();
|
||||
// Tangani pengecualian umum
|
||||
return ['error' => true, 'message' => $e->getMessage()];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function createInvoice($data)
|
||||
|
||||
Reference in New Issue
Block a user