2019-08-16 13:04:50 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* Created by PhpStorm.
|
|
|
|
|
* User: merdan
|
|
|
|
|
* Date: 8/16/2019
|
|
|
|
|
* Time: 13:30
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
namespace App\Payment;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
abstract class PaymentResponse
|
|
|
|
|
{
|
|
|
|
|
protected $response_data;
|
|
|
|
|
protected $exception_message;
|
|
|
|
|
|
|
|
|
|
public function setResponseData($data){
|
2020-03-17 07:14:09 +00:00
|
|
|
// dd(json_decode($data, true));
|
|
|
|
|
$rsp = json_decode($data, true);
|
|
|
|
|
if($rsp)
|
|
|
|
|
$this->response_data = $rsp;
|
|
|
|
|
else
|
|
|
|
|
$this->exception_message = 'Bank connection failed. Please try again later!';
|
|
|
|
|
|
2019-08-16 13:04:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function setExceptionMessage($message){
|
|
|
|
|
$this->exception_message = $message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function errorMessage(){
|
|
|
|
|
if(!$this->exception_message)
|
2019-11-27 09:00:13 +00:00
|
|
|
{
|
2020-05-14 11:13:55 +00:00
|
|
|
return $this->response_data['errorMessage'];}
|
2019-08-16 13:04:50 +00:00
|
|
|
else
|
|
|
|
|
return $this->exception_message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract function isSuccessfull();
|
|
|
|
|
public abstract function getPaymentReferenceId();
|
2019-11-27 09:00:13 +00:00
|
|
|
}
|