Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbarbos committed Apr 6, 2017
1 parent cba91c2 commit 9ac3606
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/MobilpayGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,28 @@
class MobilpayGateway {

protected $data;
protected $gateway;

use DataTrait;

function __construct() {

$this->gateway = Omnipay::create('MobilPay')->setMerchantId(config('mobilpay.merchant_id'));

$this->initData();
}

public function purchase() {
$this->gateway->setPublicKey(config('mobilpay.public_key_path'));
$gateway = Omnipay::create('MobilPay');
$gateway->setMerchantId(config('mobilpay.merchant_id'));
$gateway->setPublicKey(config('mobilpay.public_key_path'));

$response = $this->gateway->purchase($this->data)->send();
$response = $gateway->purchase($this->data)->send();

$response->redirect();
}

public function response() {
$this->gateway->privateKeyPath(config('mobilpay.private_key_path'));
$gateway = Omnipay::create('MobilPay');
$gateway->privateKeyPath(config('mobilpay.private_key_path'));

$response = $this->gateway->completePurchase($_POST)->send();
$response = $gateway->completePurchase($_POST)->send();
$response->sendResponse();

return $response;
Expand Down

0 comments on commit 9ac3606

Please sign in to comment.