mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 08:24:39 -04:00
Set payment cancelUrl to client invoice page
This commit is contained in:
parent
886fccadfd
commit
173b45ec84
@ -223,8 +223,9 @@ class PaymentController extends \BaseController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getPaymentDetails($invoice, $input = null)
|
private function getPaymentDetails($invitation, $input = null)
|
||||||
{
|
{
|
||||||
|
$invoice = $invitation->invoice;
|
||||||
$key = $invoice->invoice_number.'_details';
|
$key = $invoice->invoice_number.'_details';
|
||||||
$gateway = $invoice->client->account->getGatewayByType(Session::get('payment_type'))->gateway;
|
$gateway = $invoice->client->account->getGatewayByType(Session::get('payment_type'))->gateway;
|
||||||
$paymentLibrary = $gateway->paymentlibrary;
|
$paymentLibrary = $gateway->paymentlibrary;
|
||||||
@ -288,7 +289,7 @@ class PaymentController extends \BaseController
|
|||||||
'card' => $card,
|
'card' => $card,
|
||||||
'currency' => $currencyCode,
|
'currency' => $currencyCode,
|
||||||
'returnUrl' => URL::to('complete'),
|
'returnUrl' => URL::to('complete'),
|
||||||
'cancelUrl' => URL::to('/')
|
'cancelUrl' => $invitation->getLink(),
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
return $data;
|
return $data;
|
||||||
@ -557,7 +558,7 @@ class PaymentController extends \BaseController
|
|||||||
try {
|
try {
|
||||||
if ($paymentLibrary->id == PAYMENT_LIBRARY_OMNIPAY) {
|
if ($paymentLibrary->id == PAYMENT_LIBRARY_OMNIPAY) {
|
||||||
$gateway = self::createGateway($accountGateway);
|
$gateway = self::createGateway($accountGateway);
|
||||||
$details = self::getPaymentDetails($invoice, $useToken || !$onSite ? false : Input::all());
|
$details = self::getPaymentDetails($invitation, $useToken || !$onSite ? false : Input::all());
|
||||||
|
|
||||||
if ($accountGateway->gateway_id == GATEWAY_STRIPE) {
|
if ($accountGateway->gateway_id == GATEWAY_STRIPE) {
|
||||||
if ($useToken) {
|
if ($useToken) {
|
||||||
@ -671,7 +672,7 @@ class PaymentController extends \BaseController
|
|||||||
$gateway = self::createGateway($accountGateway);
|
$gateway = self::createGateway($accountGateway);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$details = self::getPaymentDetails($invoice);
|
$details = self::getPaymentDetails($invitation);
|
||||||
$response = $gateway->completePurchase($details)->send();
|
$response = $gateway->completePurchase($details)->send();
|
||||||
$ref = $response->getTransactionReference();
|
$ref = $response->getTransactionReference();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user