diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php
index 12b63a617e57..4e536e7dc0ff 100644
--- a/app/Console/Commands/CheckData.php
+++ b/app/Console/Commands/CheckData.php
@@ -235,7 +235,7 @@ class CheckData extends Command {
'updated_at' => new Carbon,
'account_id' => $client->account_id,
'client_id' => $client->id,
- 'message' => 'Recovered update to invoice [details]',
+ 'message' => 'Corrected client balance',
'adjustment' => $client->actual_balance - $activity->balance,
'balance' => $client->actual_balance,
]);
diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php
index daa32853ae03..00d787d6a022 100644
--- a/app/Http/Controllers/PaymentController.php
+++ b/app/Http/Controllers/PaymentController.php
@@ -174,7 +174,8 @@ class PaymentController extends BaseController
$acceptedCreditCardTypes = $accountGateway->getCreditcardTypes();
// Handle offsite payments
- if ($useToken || $paymentType != PAYMENT_TYPE_CREDIT_CARD || $gateway->id == GATEWAY_EWAY) {
+ if ($useToken || $paymentType != PAYMENT_TYPE_CREDIT_CARD
+ || $gateway->id == GATEWAY_EWAY || $gateway->id == GATEWAY_TWO_CHECKOUT) {
if (Session::has('error')) {
Session::reflash();
return Redirect::to('view/'.$invitationKey);
@@ -436,14 +437,15 @@ class PaymentController extends BaseController
}
$response = $gateway->purchase($details)->send();
-
+
if ($accountGateway->gateway_id == GATEWAY_EWAY) {
$ref = $response->getData()['AccessCode'];
- $token = $response->getCardReference();
+ } elseif ($accountGateway->gateway_id == GATEWAY_TWO_CHECKOUT) {
+ $ref = $response->getData()['cart_order_id'];
} else {
$ref = $response->getTransactionReference();
}
-
+
if (!$ref) {
$this->error('No-Ref', $response->getMessage(), $accountGateway);
@@ -467,7 +469,6 @@ class PaymentController extends BaseController
} elseif ($response->isRedirect()) {
$invitation->transaction_reference = $ref;
$invitation->save();
-
Session::put('transaction_reference', $ref);
Session::save();
$response->redirect();
@@ -513,7 +514,7 @@ class PaymentController extends BaseController
}
try {
- if (method_exists($gateway, 'completePurchase')) {
+ if (method_exists($gateway, 'completePurchase') && !$accountGateway->isGateway(GATEWAY_TWO_CHECKOUT)) {
$details = $this->paymentService->getPaymentDetails($invitation);
$response = $gateway->completePurchase($details)->send();
$ref = $response->getTransactionReference();
diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php
index dfbd480b7ae1..fc264a39a2f7 100644
--- a/resources/lang/en/texts.php
+++ b/resources/lang/en/texts.php
@@ -829,6 +829,8 @@ return array(
'oneclick_login_help' => 'Connect an account to login without a password',
'referral_code_help' => 'Earn money by sharing our app online',
+
+ 'enable_with_stripe' => 'Enable | Requires Stripe',
);
diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php
index 167b1af24667..906e4b8a4d3f 100644
--- a/resources/views/invoices/edit.blade.php
+++ b/resources/views/invoices/edit.blade.php
@@ -133,7 +133,7 @@
{!! Former::checkbox('auto_bill')
->label(trans('texts.auto_bill'))
- ->text(trans('texts.enable'))
+ ->text(trans('texts.enable_with_stripe'))
->data_bind("checked: auto_bill, valueUpdate: 'afterkeydown'") !!}
{!! Former::text('po_number')->label(trans('texts.po_number_short'))->data_bind("value: po_number, valueUpdate: 'afterkeydown'") !!}