updated omnipay
This commit is contained in:
parent
dd4af839c7
commit
851e60d43b
@ -38,15 +38,24 @@ trait Omnipay
|
|||||||
if ($response->isSuccessful()) {
|
if ($response->isSuccessful()) {
|
||||||
$this->setReference($invoice, $response->getTransactionReference());
|
$this->setReference($invoice, $response->getTransactionReference());
|
||||||
|
|
||||||
$response = $this->gateway->capture([
|
$options['transactionReference'] = $response->getTransactionReference();
|
||||||
'amount' => $invoice->amount,
|
|
||||||
'currency' => $invoice->currency_code,
|
$response = $this->gateway->capture($options)->send();
|
||||||
'transactionId' => $this->getReference($invoice),
|
|
||||||
])->send();
|
|
||||||
|
|
||||||
return $this->finish($invoice, $request);
|
return $this->finish($invoice, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($response->isRedirect()) {
|
||||||
|
$this->setReference($invoice, $response->getTransactionReference());
|
||||||
|
|
||||||
|
return response()->json([
|
||||||
|
'error' => false,
|
||||||
|
'redirect' => $response->getRedirectUrl(),
|
||||||
|
'success' => false,
|
||||||
|
'data' => $response->getRedirectData(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->failure($invoice, $response);
|
return $this->failure($invoice, $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,4 +196,15 @@ trait Omnipay
|
|||||||
|
|
||||||
return $this->factory;
|
return $this->factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setCardFirstLastName(&$request)
|
||||||
|
{
|
||||||
|
$contact = explode(" ", $request['cardName']);
|
||||||
|
|
||||||
|
$last_name = array_pop($contact);
|
||||||
|
$first_name = implode(" ", $contact);
|
||||||
|
|
||||||
|
$request['cardFirstName'] = $first_name;
|
||||||
|
$request['cardLastName'] = $last_name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user