sarga payment
This commit is contained in:
parent
67e639aa57
commit
1df242e685
|
|
@ -61,28 +61,22 @@ class Rysgal extends Payment
|
|||
];
|
||||
try {
|
||||
$result = json_decode($client->post('register.do',$params)->getBody(),true);
|
||||
return [
|
||||
'data' => [
|
||||
'url' => $result['formUrl'],
|
||||
'status' => true
|
||||
],
|
||||
'message' => 'Redirect to payment gateway',
|
||||
];
|
||||
// Log::info($result);
|
||||
|
||||
// if($result['errorCode'] == 0){
|
||||
// return [
|
||||
// "success" => $this->registerOrderId($result['orderId']),
|
||||
// "url" => $result['formUrl'],
|
||||
// "message" => "unable to save order id"
|
||||
// ];
|
||||
// }
|
||||
// else{//if already registered or otkazana w dostupe
|
||||
// return [
|
||||
// "success" => false,
|
||||
// "message" => $result['errorMessage']
|
||||
// ];
|
||||
// }
|
||||
if((isset($result['errorCode']) && $result['errorCode'] == 0)||(!isset($result['errorCode']) && isset($result['formUrl']))){
|
||||
return [
|
||||
'data' => [
|
||||
"status" => $this->registerOrderId($result['orderId']),
|
||||
"url" => $result['formUrl'] ?? '',
|
||||
"message" => "redirect to url"
|
||||
]
|
||||
];
|
||||
}
|
||||
else{//if already registered or otkazana w dostupe
|
||||
return [
|
||||
"data" => ["success" => false],
|
||||
"message" => $result['errorMessage'] ?? "unable to save order id"
|
||||
];
|
||||
}
|
||||
|
||||
}catch(\Exception $e){
|
||||
// Log::info($result);
|
||||
|
|
@ -111,12 +105,9 @@ class Rysgal extends Payment
|
|||
|
||||
$payment = $this->getCart()->payment;
|
||||
|
||||
|
||||
$orderId = request()->get('orderId');
|
||||
Log::info($payment);
|
||||
Log::info($orderId);
|
||||
|
||||
if($payment && $payment->order_id === $orderId){
|
||||
if($payment && $orderId){
|
||||
$params = [
|
||||
'form_params' => [
|
||||
'userName' => $this->getConfigData('business_account'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue