| @@ 78-84 (lines=7) @@ | ||
| 75 | $this->payment->Status = 'Authorized'; |
|
| 76 | $this->payment->write(); |
|
| 77 | $gatewayresponse->setMessage("Redirecting to gateway"); |
|
| 78 | } else { |
|
| 79 | //handle error |
|
| 80 | $this->createMessage('PurchaseError', $response); |
|
| 81 | $gatewayresponse->setMessage( |
|
| 82 | "Error (".$response->getCode()."): ".$response->getMessage() |
|
| 83 | ); |
|
| 84 | } |
|
| 85 | } catch (Omnipay\Common\Exception\OmnipayException $e) { |
|
| 86 | $this->createMessage('PurchaseError', $e); |
|
| 87 | $gatewayresponse->setMessage($e->getMessage()); |
|
| @@ 41-47 (lines=7) @@ | ||
| 38 | $this->payment->Status = 'Refunded'; |
|
| 39 | $gatewayresponse->setMessage('Payment refunded'); |
|
| 40 | $this->payment->extend('onRefunded', $gatewayresponse); |
|
| 41 | } else { |
|
| 42 | //handle error |
|
| 43 | $this->createMessage('RefundError', $response); |
|
| 44 | $gatewayresponse->setMessage( |
|
| 45 | "Error (".$response->getCode()."): ".$response->getMessage() |
|
| 46 | ); |
|
| 47 | } |
|
| 48 | $this->payment->write(); |
|
| 49 | $gatewayresponse->setOmnipayResponse($response); |
|
| 50 | } catch (Omnipay\Common\Exception\OmnipayException $e) { |
|