1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Fix for checkouit.com integration

This commit is contained in:
Hillel Coren 2016-03-09 16:58:21 +02:00
parent 4912c40650
commit ed48fb1a3f
3 changed files with 5 additions and 2 deletions

View File

@ -101,7 +101,9 @@ class PublicClientController extends BaseController
// Checkout.com requires first getting a payment token
$checkoutComToken = false;
$checkoutComKey = false;
$checkoutComDebug = false;
if ($accountGateway = $account->getGatewayConfig(GATEWAY_CHECKOUT_COM)) {
$checkoutComDebug = $accountGateway->getConfigField('testMode');
if ($checkoutComToken = $this->paymentService->getCheckoutComToken($invitation)) {
$checkoutComKey = $accountGateway->getConfigField('publicApiKey');
$invitation->transaction_reference = $checkoutComToken;
@ -126,6 +128,7 @@ class PublicClientController extends BaseController
'paymentURL' => $paymentURL,
'checkoutComToken' => $checkoutComToken,
'checkoutComKey' => $checkoutComKey,
'checkoutComDebug' => $checkoutComDebug,
'phantomjs' => Input::has('phantomjs'),
);

View File

@ -41,7 +41,7 @@ class AccountGatewayService extends BaseService
[
'name',
function ($model) {
return link_to("gateways/{$model->public_id}/edit", $model->name);
return link_to("gateways/{$model->public_id}/edit", $model->name)->toHtml();
}
],
[

View File

@ -3,7 +3,7 @@
<form method="POST" class="payment-form">
<script>
Checkout.render({
debugMode: true,
debugMode: {{ $checkoutComDebug }},
publicKey: '{{ $checkoutComKey }}',
paymentToken: '{{ $checkoutComToken }}',
customerEmail: '{{ $contact->email }}',