|
@@ 203-220 (lines=18) @@
|
| 200 |
|
* @param $payer_authentication_response |
| 201 |
|
* @return AuthorizeResponse|BaseResponse |
| 202 |
|
*/ |
| 203 |
|
public function authorizeConfirmDebit($payment_id, $payer_authentication_response) |
| 204 |
|
{ |
| 205 |
|
try { |
| 206 |
|
$payer_authentication_response = ["payer_authentication_response" => $payer_authentication_response]; |
| 207 |
|
$request = new Request($this); |
| 208 |
|
$response = $request->post($this, "/v1/payments/debit/".$payment_id."/authenticated/finalize", json_encode($payer_authentication_response)); |
| 209 |
|
} catch (\Exception $e) { |
| 210 |
|
$error = new BaseResponse(); |
| 211 |
|
$error->mapperJson(json_decode($e->getMessage(), true)); |
| 212 |
|
|
| 213 |
|
return $error; |
| 214 |
|
} |
| 215 |
|
|
| 216 |
|
$authresponse = new AuthorizeResponse(); |
| 217 |
|
$authresponse->mapperJson($response); |
| 218 |
|
|
| 219 |
|
return $authresponse; |
| 220 |
|
} |
| 221 |
|
|
| 222 |
|
/** |
| 223 |
|
* @param $payment_id |
|
@@ 227-245 (lines=19) @@
|
| 224 |
|
* @param $amount_val |
| 225 |
|
* @return AuthorizeResponse|BaseResponse |
| 226 |
|
*/ |
| 227 |
|
public function authorizeCancel($payment_id, $amount_val) |
| 228 |
|
{ |
| 229 |
|
$amount = ["amount" => $amount_val]; |
| 230 |
|
|
| 231 |
|
try { |
| 232 |
|
$request = new Request($this); |
| 233 |
|
$response = $request->post($this, "/v1/payments/credit/".$payment_id."/cancel", json_encode($amount)); |
| 234 |
|
} catch (\Exception $e) { |
| 235 |
|
$error = new BaseResponse(); |
| 236 |
|
$error->mapperJson(json_decode($e->getMessage(), true)); |
| 237 |
|
|
| 238 |
|
return $error; |
| 239 |
|
} |
| 240 |
|
|
| 241 |
|
$authresponse = new AuthorizeResponse(); |
| 242 |
|
$authresponse->mapperJson($response); |
| 243 |
|
|
| 244 |
|
return $authresponse; |
| 245 |
|
} |
| 246 |
|
|
| 247 |
|
/** |
| 248 |
|
* @param Transaction $transaction |