| @@ 51-64 (lines=14) @@ | ||
| 48 | * |
|
| 49 | * @return object |
|
| 50 | */ |
|
| 51 | public function purchase(OrderInterface $order) |
|
| 52 | { |
|
| 53 | if ($this->gateway === null) { |
|
| 54 | return; |
|
| 55 | } |
|
| 56 | ||
| 57 | return $this->gateway->purchase(array_merge( |
|
| 58 | array( |
|
| 59 | 'amount' => $order->getTotal(), |
|
| 60 | 'currency' => $order->getCurrency(), |
|
| 61 | ), |
|
| 62 | $this->getCancelAndReturnUrl() |
|
| 63 | ))->send(); |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * Cplete purchase action. |
|
| @@ 73-86 (lines=14) @@ | ||
| 70 | * |
|
| 71 | * @return object |
|
| 72 | */ |
|
| 73 | public function completePurchase(OrderInterface $order) |
|
| 74 | { |
|
| 75 | if ($this->gateway === null) { |
|
| 76 | return; |
|
| 77 | } |
|
| 78 | ||
| 79 | return $this->gateway->completePurchase(array_merge( |
|
| 80 | array( |
|
| 81 | 'amount' => $order->getTotal(), |
|
| 82 | 'currency' => $order->getCurrency(), |
|
| 83 | ), |
|
| 84 | $this->getCancelAndReturnUrl() |
|
| 85 | ))->send(); |
|
| 86 | } |
|
| 87 | ||
| 88 | private function getCancelAndReturnUrl() |
|
| 89 | { |
|