Fix for tests

This commit is contained in:
Hillel Coren 2016-06-21 12:40:10 +03:00
parent 3e068be315
commit 8a6227bf89
2 changed files with 13 additions and 8 deletions

View File

@ -107,8 +107,6 @@ class ClientPortalController extends BaseController
} }
} }
$paymentDriver = $account->paymentDriver($invitation, GATEWAY_TYPE_CREDIT_CARD);
if ($wepayGateway = $account->getGatewayConfig(GATEWAY_WEPAY)){ if ($wepayGateway = $account->getGatewayConfig(GATEWAY_WEPAY)){
$data['enableWePayACH'] = $wepayGateway->getAchEnabled(); $data['enableWePayACH'] = $wepayGateway->getAchEnabled();
} }
@ -132,12 +130,19 @@ class ClientPortalController extends BaseController
'contact' => $contact, 'contact' => $contact,
'paymentTypes' => $paymentTypes, 'paymentTypes' => $paymentTypes,
'paymentURL' => $paymentURL, 'paymentURL' => $paymentURL,
'transactionToken' => $paymentDriver->createTransactionToken(),
'partialView' => $paymentDriver->partialView(),
'accountGateway' => $paymentDriver->accountGateway,
'phantomjs' => Input::has('phantomjs'), 'phantomjs' => Input::has('phantomjs'),
); );
if ($paymentDriver = $account->paymentDriver($invitation, GATEWAY_TYPE_CREDIT_CARD)) {
$data += [
'transactionToken' => $paymentDriver->createTransactionToken(),
'partialView' => $paymentDriver->partialView(),
'accountGateway' => $paymentDriver->accountGateway,
];
}
if($account->hasFeature(FEATURE_DOCUMENTS) && $this->canCreateZip()){ if($account->hasFeature(FEATURE_DOCUMENTS) && $this->canCreateZip()){
$zipDocs = $this->getInvoiceZipDocuments($invoice, $size); $zipDocs = $this->getInvoiceZipDocuments($invoice, $size);
@ -740,7 +745,7 @@ class ClientPortalController extends BaseController
return redirect()->to($client->account->enable_client_portal?'/client/dashboard':'/client/payment_methods/'); return redirect()->to($client->account->enable_client_portal?'/client/dashboard':'/client/payment_methods/');
} }
public function setDefaultPaymentMethod(){ public function setDefaultPaymentMethod(){
if (!$contact = $this->getContact()) { if (!$contact = $this->getContact()) {
return $this->returnError(); return $this->returnError();

View File

@ -22,7 +22,7 @@
} }
</style> </style>
@if ($accountGateway->gateway_id == GATEWAY_BRAINTREE && !empty($transactionToken)) @if (!empty($transactionToken) && $accountGateway->gateway_id == GATEWAY_BRAINTREE)
<div id="paypal-container"></div> <div id="paypal-container"></div>
<script type="text/javascript" src="https://js.braintreegateway.com/js/braintree-2.23.0.min.js"></script> <script type="text/javascript" src="https://js.braintreegateway.com/js/braintree-2.23.0.min.js"></script>
<script type="text/javascript" > <script type="text/javascript" >
@ -97,7 +97,7 @@
<div class="container"> <div class="container">
@if ($partialView) @if (!empty($partialView))
@include($partialView) @include($partialView)
@else @else
<div class="pull-right" style="text-align:right"> <div class="pull-right" style="text-align:right">