@@ -16,20 +16,20 @@ discard block |
||
16 | 16 | if ($status == 1){ |
17 | 17 | $return['success']=1; |
18 | 18 | $return['token']=$r['token']; |
19 | - }else{ |
|
19 | + } else{ |
|
20 | 20 | $return['success']=0; |
21 | 21 | $return['']=$r['errorDescription']; |
22 | 22 | } |
23 | - }else{ |
|
23 | + } else{ |
|
24 | 24 | $return['success']=0; |
25 | 25 | if (isset($r['faMessage']) && !empty($r['faMessage'])){ |
26 | 26 | $return['errorMessage'] = $r['faMessage']; |
27 | - }else{ |
|
27 | + } else{ |
|
28 | 28 | $return['errorMessage'] = "خطا در دریافت توکن پرداخت"; |
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | - }else{ |
|
32 | + } else{ |
|
33 | 33 | $return['success']=0; |
34 | 34 | $return['errorMessage'] = "خطا در دریافت اطلاعات توکن پرداخت"; |
35 | 35 | } |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | if ($state == 'OK'){ |
84 | 84 | $result['success']=1; |
85 | 85 | $result['error']=""; |
86 | - }else{ |
|
86 | + } else{ |
|
87 | 87 | $result['success']=0; |
88 | 88 | $result['error']= _fn_return_state_text($state); |
89 | 89 | } |
90 | - }else{ |
|
90 | + } else{ |
|
91 | 91 | $result['success']=0; |
92 | 92 | $result['error']="خطای نامشخص در پرداخت. در صورتیکه مبلغی از شما کسر شده باشد، برگشت داده می شود."; |
93 | 93 | } |
@@ -105,15 +105,15 @@ discard block |
||
105 | 105 | if ($r['amount'] == $amount){ |
106 | 106 | $return['success']=1; |
107 | 107 | $return['errorMessage']=""; |
108 | - }else{ |
|
108 | + } else{ |
|
109 | 109 | $return['success']=0; |
110 | 110 | $return['errorMessage']="خطا در تایید مبلغ پرداخت.در صورتیکه مبلغی از شما کسر شده باشد، برگشت داده می شود."; |
111 | 111 | } |
112 | - }else{ |
|
112 | + } else{ |
|
113 | 113 | $return['success']=0; |
114 | 114 | $return['errorMessage']="خطا در تایید اطلاعات پرداخت. در صورتیکه مبلغی از شما کسر شده باشد، برگشت داده می شود."; |
115 | 115 | } |
116 | - }else{ |
|
116 | + } else{ |
|
117 | 117 | $return['success']=0; |
118 | 118 | $return['errorMessage'] = "خطا در تایید نهایی پرداخت. در صورتیکه مبلغی از شما کسر شده باشد، برگشت داده می شود."; |
119 | 119 | } |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | !isset($params['terminalId']) || |
165 | 165 | !isset($params['traceNumber'])){ |
166 | 166 | return false; |
167 | - }else{ |
|
167 | + } else{ |
|
168 | 168 | return true; |
169 | 169 | } |
170 | 170 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | if ($httpcode == "200"){ |
189 | 189 | //nothing YET |
190 | - }else{ |
|
190 | + } else{ |
|
191 | 191 | $json= json_encode(array('error'=>'Y')); |
192 | 192 | } |
193 | 193 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | |
212 | 212 | if ($httpcode == "200"){ |
213 | 213 | return json_decode($json,true); |
214 | - }else{ |
|
214 | + } else{ |
|
215 | 215 | $json = array('error'=>'Y','jsonError'=>$httpcode,'message'=>$httpcode); |
216 | 216 | } |
217 | 217 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $token = $r['token']; |
96 | 96 | $this->invoice->transactionId($token); |
97 | 97 | return $this->invoice->getTransactionId(); |
98 | - }else{ |
|
98 | + } else{ |
|
99 | 99 | $error_message = $r['errorMessage']; |
100 | 100 | throw new PurchaseFailedException($error_message); |
101 | 101 | } |