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