Merge pull request #7017 from turbo124/v5-develop

v5.3.34
This commit is contained in:
David Bomba 2021-12-08 09:00:49 +11:00 committed by GitHub
commit ada65baca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 61 additions and 65 deletions

View File

@ -1 +1 @@
5.3.33 5.3.34

View File

@ -42,16 +42,15 @@ class ContactLoginController extends Controller
if($request->has('company_key')){ if($request->has('company_key')){
MultiDB::findAndSetDbByCompanyKey($request->input('company_key')); MultiDB::findAndSetDbByCompanyKey($request->input('company_key'));
$company = Company::where('company_key', $request->input('company_key'))->first(); $company = Company::where('company_key', $request->input('company_key'))->first();
} }
if (!$company && strpos($request->getHost(), 'invoicing.co') !== false) { if($company){
$account = $company->account;
}
elseif (!$company && strpos($request->getHost(), 'invoicing.co') !== false) {
$subdomain = explode('.', $request->getHost())[0]; $subdomain = explode('.', $request->getHost())[0];
MultiDB::findAndSetDbByDomain(['subdomain' => $subdomain]); MultiDB::findAndSetDbByDomain(['subdomain' => $subdomain]);
$company = Company::where('subdomain', $subdomain)->first(); $company = Company::where('subdomain', $subdomain)->first();
} elseif(Ninja::isHosted()){ } elseif(Ninja::isHosted()){
@ -107,7 +106,7 @@ class ContactLoginController extends Controller
public function authenticated(Request $request, ClientContact $client) public function authenticated(Request $request, ClientContact $client)
{ {
Auth::guard('contact')->login($client, true); Auth::guard('contact')->loginUsingId($client->id, true);
event(new ContactLoggedIn($client, $client->company, Ninja::eventVars())); event(new ContactLoggedIn($client, $client->company, Ninja::eventVars()));

View File

@ -43,7 +43,7 @@ class ContactRegisterController extends Controller
$client = $this->getClient($request->all()); $client = $this->getClient($request->all());
$client_contact = $this->getClientContact($request->all(), $client); $client_contact = $this->getClientContact($request->all(), $client);
Auth::guard('contact')->login($client_contact, true); Auth::guard('contact')->loginUsingId($client_contact->id, true);
return redirect()->route('client.dashboard'); return redirect()->route('client.dashboard');
} }

View File

@ -25,7 +25,7 @@ class ContactHashLoginController extends Controller
*/ */
public function login(string $contact_key) public function login(string $contact_key)
{ {
if(request()->has('subscription') && $request->subscription == 'true') { if(request()->has('subscription') && request()->subscription == 'true') {
$recurring_invoice = RecurringInvoice::where('client_id', auth()->guard('contact')->client->id) $recurring_invoice = RecurringInvoice::where('client_id', auth()->guard('contact')->client->id)
->whereNotNull('subscription_id') ->whereNotNull('subscription_id')

View File

@ -94,7 +94,7 @@ class InvitationController extends Controller
$client_contact->email = Str::random(15) . "@example.com"; $client_contact->save(); $client_contact->email = Str::random(15) . "@example.com"; $client_contact->save();
if (request()->has('client_hash') && request()->input('client_hash') == $invitation->contact->client->client_hash) { if (request()->has('client_hash') && request()->input('client_hash') == $invitation->contact->client->client_hash) {
auth()->guard('contact')->login($client_contact, true); auth()->guard('contact')->loginUsingId($client_contact->id, true);
} elseif ((bool) $invitation->contact->client->getSetting('enable_client_portal_password') !== false) { } elseif ((bool) $invitation->contact->client->getSetting('enable_client_portal_password') !== false) {
$this->middleware('auth:contact'); $this->middleware('auth:contact');
@ -102,7 +102,7 @@ class InvitationController extends Controller
} else { } else {
nlog("else - default - login contact"); nlog("else - default - login contact");
auth()->guard('contact')->login($client_contact, true); auth()->guard('contact')->loginUsingId($client_contact->id, true);
} }
@ -201,7 +201,7 @@ class InvitationController extends Controller
if($payment->client_id != $contact->client_id) if($payment->client_id != $contact->client_id)
abort(403, 'You are not authorized to view this resource'); abort(403, 'You are not authorized to view this resource');
auth()->guard('contact')->login($contact, true); auth()->guard('contact')->loginUsingId($contact->id, true);
return redirect()->route('client.payments.show', $payment->hashed_id); return redirect()->route('client.payments.show', $payment->hashed_id);
@ -213,7 +213,7 @@ class InvitationController extends Controller
->with('contact.client') ->with('contact.client')
->firstOrFail(); ->firstOrFail();
auth()->guard('contact')->login($invitation->contact, true); auth()->guard('contact')->loginUsingId($invitation->contact->id, true);
$invoice = $invitation->invoice; $invoice = $invitation->invoice;

View File

@ -50,7 +50,7 @@ class NinjaPlanController extends Controller
nlog("Ninja Plan Controller - Found and set Client Contact"); nlog("Ninja Plan Controller - Found and set Client Contact");
Auth::guard('contact')->login($client_contact,true); Auth::guard('contact')->loginUsingId($client_contact->id,true);
// /* Current paid users get pushed straight to subscription overview page*/ // /* Current paid users get pushed straight to subscription overview page*/
// if($account->isPaidHostedClient()) // if($account->isPaidHostedClient())

View File

@ -27,7 +27,7 @@ class SwitchCompanyController extends Controller
->where('id', $this->transformKeys($contact)) ->where('id', $this->transformKeys($contact))
->first(); ->first();
auth()->guard('contact')->login($client_contact, true); auth()->guard('contact')->loginUsingId($client_contact->id, true);
return redirect('/client/dashboard'); return redirect('/client/dashboard');
} }

View File

@ -285,7 +285,7 @@ class BillingPortalPurchase extends Component
*/ */
protected function getPaymentMethods(ClientContact $contact): self protected function getPaymentMethods(ClientContact $contact): self
{ {
Auth::guard('contact')->login($contact, true); Auth::guard('contact')->loginUsingId($contact->id, true);
$this->contact = $contact; $this->contact = $contact;

View File

@ -43,6 +43,7 @@ class InvoicesTable extends Component
$local_status = []; $local_status = [];
$query = Invoice::query() $query = Invoice::query()
->with('client.gateway_tokens','company','client.contacts')
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc') ->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
->where('company_id', $this->company->id) ->where('company_id', $this->company->id)
->where('is_deleted', false); ->where('is_deleted', false);
@ -82,6 +83,7 @@ class InvoicesTable extends Component
return render('components.livewire.invoices-table', [ return render('components.livewire.invoices-table', [
'invoices' => $query, 'invoices' => $query,
'gateway_available' => !empty(auth()->user()->client->service()->getPaymentMethods(0)),
]); ]);
} }
} }

View File

@ -38,6 +38,7 @@ class QuotesTable extends Component
public function render() public function render()
{ {
$query = Quote::query() $query = Quote::query()
->with('client.gateway_tokens','company','client.contacts')
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc'); ->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc');
if (count($this->status) > 0) { if (count($this->status) > 0) {
@ -48,6 +49,7 @@ class QuotesTable extends Component
->where('company_id', $this->company->id) ->where('company_id', $this->company->id)
->where('client_id', auth('contact')->user()->client->id) ->where('client_id', auth('contact')->user()->client->id)
->where('status_id', '<>', Quote::STATUS_DRAFT) ->where('status_id', '<>', Quote::STATUS_DRAFT)
->where('is_deleted', 0)
->withTrashed() ->withTrashed()
->paginate($this->per_page); ->paginate($this->per_page);

View File

@ -29,7 +29,7 @@ class CheckClientExistence
public function handle(Request $request, Closure $next) public function handle(Request $request, Closure $next)
{ {
$multiple_contacts = ClientContact::query() $multiple_contacts = ClientContact::query()
->with('company','client') ->with('client.gateway_tokens')
->where('email', auth('contact')->user()->email) ->where('email', auth('contact')->user()->email)
->whereNotNull('email') ->whereNotNull('email')
->where('email', '<>', '') ->where('email', '<>', '')
@ -52,7 +52,7 @@ class CheckClientExistence
} }
if (count($multiple_contacts) == 1) { if (count($multiple_contacts) == 1) {
Auth::guard('contact')->login($multiple_contacts[0], true); Auth::guard('contact')->loginUsingId($multiple_contacts[0]->id, true);
} }
session()->put('multiple_contacts', $multiple_contacts); session()->put('multiple_contacts', $multiple_contacts);

View File

@ -52,7 +52,7 @@ class ContactKeyLogin
if(empty($client_contact->email)) if(empty($client_contact->email))
$client_contact->email = Str::random(15) . "@example.com"; $client_contact->save(); $client_contact->email = Str::random(15) . "@example.com"; $client_contact->save();
auth()->guard('contact')->login($client_contact, true); auth()->guard('contact')->loginUsingId($client_contact->id, true);
if ($request->query('redirect') && !empty($request->query('redirect'))) { if ($request->query('redirect') && !empty($request->query('redirect'))) {
return redirect()->to($request->query('redirect')); return redirect()->to($request->query('redirect'));
@ -70,7 +70,7 @@ class ContactKeyLogin
if(empty($client_contact->email)) if(empty($client_contact->email))
$client_contact->email = Str::random(6) . "@example.com"; $client_contact->save(); $client_contact->email = Str::random(6) . "@example.com"; $client_contact->save();
auth()->guard('contact')->login($client_contact, true); auth()->guard('contact')->loginUsingId($client_contact->id, true);
if ($request->query('next')) { if ($request->query('next')) {
return redirect()->to($request->query('next')); return redirect()->to($request->query('next'));
@ -86,7 +86,7 @@ class ContactKeyLogin
$client_contact->email = Str::random(6) . "@example.com"; $client_contact->save(); $client_contact->email = Str::random(6) . "@example.com"; $client_contact->save();
} }
auth()->guard('contact')->login($client_contact, true); auth()->guard('contact')->loginUsingId($client_contact->id, true);
if ($request->query('next')) { if ($request->query('next')) {
return redirect($request->query('next')); return redirect($request->query('next'));
@ -104,7 +104,7 @@ class ContactKeyLogin
if(empty($primary_contact->email)) if(empty($primary_contact->email))
$primary_contact->email = Str::random(6) . "@example.com"; $primary_contact->save(); $primary_contact->email = Str::random(6) . "@example.com"; $primary_contact->save();
auth()->guard('contact')->login($primary_contact, true); auth()->guard('contact')->loginUsingId($primary_contact->id, true);
return redirect()->to('client/dashboard'); return redirect()->to('client/dashboard');
} }
} }
@ -116,7 +116,7 @@ class ContactKeyLogin
if(empty($primary_contact->email)) if(empty($primary_contact->email))
$primary_contact->email = Str::random(6) . "@example.com"; $primary_contact->save(); $primary_contact->email = Str::random(6) . "@example.com"; $primary_contact->save();
auth()->guard('contact')->login($primary_contact, true); auth()->guard('contact')->loginUsingId($primary_contact->id, true);
return redirect()->to('client/dashboard'); return redirect()->to('client/dashboard');
} }

View File

@ -19,10 +19,11 @@ class ContactRegister
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
$domain_name = $request->getHost();
if (strpos($request->getHost(), 'invoicing.co') !== false) if (strpos($domain_name, 'invoicing.co') !== false)
{ {
$subdomain = explode('.', $request->getHost())[0]; $subdomain = explode('.', $domain_name)[0];
$query = [ $query = [
'subdomain' => $subdomain, 'subdomain' => $subdomain,
@ -86,6 +87,6 @@ class ContactRegister
return $next($request); return $next($request);
} }
abort(404, 'ContactRegister Middlware'); abort(404, 'ContactRegister Middleware');
} }
} }

View File

@ -51,7 +51,7 @@ class ContactTokenAuth
} }
//stateless, don't remember the contact. //stateless, don't remember the contact.
auth()->guard('contact')->login($client_contact, false); auth()->guard('contact')->loginUsingId($client_contact->id, false);
event(new ContactLoggedIn($client_contact, $client_contact->company, Ninja::eventVars())); event(new ContactLoggedIn($client_contact, $client_contact->company, Ninja::eventVars()));
} else { } else {

View File

@ -38,10 +38,11 @@ class SetDomainNameDb
if(!config('ninja.db.multi_db_enabled')) if(!config('ninja.db.multi_db_enabled'))
return $next($request); return $next($request);
$domain_name = $request->getHost();
if (strpos($request->getHost(), 'invoicing.co') !== false) if (strpos($domain_name, 'invoicing.co') !== false)
{ {
$subdomain = explode('.', $request->getHost())[0]; $subdomain = explode('.', $domain_name)[0];
$query = [ $query = [
'subdomain' => $subdomain, 'subdomain' => $subdomain,
@ -86,8 +87,6 @@ class SetDomainNameDb
} }
// config(['app.url' => $request->getSchemeAndHttpHost()]);
return $next($request); return $next($request);
} }
} }

View File

@ -49,7 +49,7 @@ class InvoiceTransformer extends BaseTransformer {
'due_date' => isset( $invoice_data['invoice.due_date'] ) ? date( 'Y-m-d', strtotime( $invoice_data['invoice.due_date'] ) ) : null, 'due_date' => isset( $invoice_data['invoice.due_date'] ) ? date( 'Y-m-d', strtotime( $invoice_data['invoice.due_date'] ) ) : null,
'terms' => $this->getString( $invoice_data, 'invoice.terms' ), 'terms' => $this->getString( $invoice_data, 'invoice.terms' ),
'public_notes' => $this->getString( $invoice_data, 'invoice.public_notes' ), 'public_notes' => $this->getString( $invoice_data, 'invoice.public_notes' ),
'is_sent' => $this->getString( $invoice_data, 'invoice.is_sent' ), // 'is_sent' => $this->getString( $invoice_data, 'invoice.is_sent' ),
'private_notes' => $this->getString( $invoice_data, 'invoice.private_notes' ), 'private_notes' => $this->getString( $invoice_data, 'invoice.private_notes' ),
'tax_name1' => $this->getString( $invoice_data, 'invoice.tax_name1' ), 'tax_name1' => $this->getString( $invoice_data, 'invoice.tax_name1' ),
'tax_rate1' => $this->getFloat( $invoice_data, 'invoice.tax_rate1' ), 'tax_rate1' => $this->getFloat( $invoice_data, 'invoice.tax_rate1' ),

View File

@ -160,11 +160,11 @@ class ACH implements MethodInterface
*/ */
public function paymentResponse(PaymentResponseRequest $request) public function paymentResponse(PaymentResponseRequest $request)
{ {
$token = ClientGatewayToken::find( // $token = ClientGatewayToken::find(
$this->decodePrimaryKey($request->source) // $this->decodePrimaryKey($request->source)
)->firstOrFail(); // )->firstOrFail();
$this->go_cardless->ensureMandateIsReady($token); $this->go_cardless->ensureMandateIsReady($request->source);
try { try {
$payment = $this->go_cardless->gateway->payments()->create([ $payment = $this->go_cardless->gateway->payments()->create([
@ -175,7 +175,7 @@ class ACH implements MethodInterface
'payment_hash' => $this->go_cardless->payment_hash->hash, 'payment_hash' => $this->go_cardless->payment_hash->hash,
], ],
'links' => [ 'links' => [
'mandate' => $token->token, 'mandate' => $request->source,
], ],
], ],
]); ]);
@ -201,7 +201,6 @@ class ACH implements MethodInterface
public function processPendingPayment(\GoCardlessPro\Resources\Payment $payment, array $data = []) public function processPendingPayment(\GoCardlessPro\Resources\Payment $payment, array $data = [])
{ {
$data = [ $data = [
'payment_method' => $data['token'],
'payment_type' => PaymentType::ACH, 'payment_type' => PaymentType::ACH,
'amount' => $this->go_cardless->payment_hash->data->amount_with_fee, 'amount' => $this->go_cardless->payment_hash->data->amount_with_fee,
'transaction_reference' => $payment->id, 'transaction_reference' => $payment->id,

View File

@ -190,7 +190,6 @@ class DirectDebit implements MethodInterface
public function processPendingPayment(\GoCardlessPro\Resources\Payment $payment, array $data = []) public function processPendingPayment(\GoCardlessPro\Resources\Payment $payment, array $data = [])
{ {
$data = [ $data = [
'payment_method' => $data['token'],
'payment_type' => PaymentType::DIRECT_DEBIT, 'payment_type' => PaymentType::DIRECT_DEBIT,
'amount' => $this->go_cardless->payment_hash->data->amount_with_fee, 'amount' => $this->go_cardless->payment_hash->data->amount_with_fee,
'transaction_reference' => $payment->id, 'transaction_reference' => $payment->id,

View File

@ -160,11 +160,7 @@ class SEPA implements MethodInterface
*/ */
public function paymentResponse(PaymentResponseRequest $request) public function paymentResponse(PaymentResponseRequest $request)
{ {
$token = ClientGatewayToken::find( $this->go_cardless->ensureMandateIsReady($request->source);
$this->decodePrimaryKey($request->source)
)->firstOrFail();
$this->go_cardless->ensureMandateIsReady($token);
try { try {
$payment = $this->go_cardless->gateway->payments()->create([ $payment = $this->go_cardless->gateway->payments()->create([
@ -175,13 +171,13 @@ class SEPA implements MethodInterface
'payment_hash' => $this->go_cardless->payment_hash->hash, 'payment_hash' => $this->go_cardless->payment_hash->hash,
], ],
'links' => [ 'links' => [
'mandate' => $token->token, 'mandate' => $request->source,
], ],
], ],
]); ]);
if ($payment->status === 'pending_submission') { if ($payment->status === 'pending_submission') {
return $this->processPendingPayment($payment, ['token' => $token->hashed_id]); return $this->processPendingPayment($payment, ['token' => $request->source]);
} }
return $this->processUnsuccessfulPayment($payment); return $this->processUnsuccessfulPayment($payment);
@ -200,7 +196,6 @@ class SEPA implements MethodInterface
public function processPendingPayment(\GoCardlessPro\Resources\Payment $payment, array $data = []) public function processPendingPayment(\GoCardlessPro\Resources\Payment $payment, array $data = [])
{ {
$data = [ $data = [
'payment_method' => $data['token'],
'payment_type' => PaymentType::SEPA, 'payment_type' => PaymentType::SEPA,
'amount' => $this->go_cardless->payment_hash->data->amount_with_fee, 'amount' => $this->go_cardless->payment_hash->data->amount_with_fee,
'transaction_reference' => $payment->id, 'transaction_reference' => $payment->id,

View File

@ -319,7 +319,7 @@ class MolliePaymentDriver extends BaseDriver
// we may not have a payment record - in these cases we need to re-construct the payment // we may not have a payment record - in these cases we need to re-construct the payment
// record from the meta data in the payment hash. // record from the meta data in the payment hash.
if($payment && $payment->metadata->payment_hash){ if($payment && property_exists($payment->metadata, 'payment_hash') && $payment->metadata->payment_hash){
/* Harvest Payment Hash*/ /* Harvest Payment Hash*/
$payment_hash = PaymentHash::where('hash', $payment->metadata->hash)->first(); $payment_hash = PaymentHash::where('hash', $payment->metadata->hash)->first();

View File

@ -436,7 +436,7 @@ class StripePaymentDriver extends BaseDriver
//Else create a new record //Else create a new record
$data['name'] = $this->client->present()->name(); $data['name'] = $this->client->present()->name();
$data['phone'] = $this->client->present()->phone(); $data['phone'] = substr($this->client->present()->phone(), 0 , 20);
if (filter_var($this->client->present()->email(), FILTER_VALIDATE_EMAIL)) { if (filter_var($this->client->present()->email(), FILTER_VALIDATE_EMAIL)) {
$data['email'] = $this->client->present()->email(); $data['email'] = $this->client->present()->email();

View File

@ -37,7 +37,7 @@ class TriggeredActions extends AbstractService
public function run() public function run()
{ {
if ($this->request->has('auto_bill') && $this->request->input('auto_bill') == 'true') { if ($this->request->has('auto_bill') && $this->request->input('auto_bill') == 'true') {
$this->invoice = $this->invoice->service()->autoBill(); $this->invoice->service()->autoBill();
} }
if ($this->request->has('paid') && $this->request->input('paid') == 'true') { if ($this->request->has('paid') && $this->request->input('paid') == 'true') {

View File

@ -14,8 +14,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true), 'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => '5.3.33', 'app_version' => '5.3.34',
'app_tag' => '5.3.33', 'app_tag' => '5.3.34',
'minimum_client_version' => '5.0.16', 'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1', 'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', ''), 'api_secret' => env('API_SECRET', ''),

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"/livewire.js":"/livewire.js?id=21fa1dd78491a49255cd"} {"/livewire.js":"/livewire.js?id=ece4c4ab4b746f6f1739"}

View File

@ -94,7 +94,7 @@
{!! App\Models\Invoice::badgeForStatus($invoice->status) !!} {!! App\Models\Invoice::badgeForStatus($invoice->status) !!}
</td> </td>
<td class="flex items-center justify-end px-6 py-4 text-sm font-medium leading-5 whitespace-nowrap"> <td class="flex items-center justify-end px-6 py-4 text-sm font-medium leading-5 whitespace-nowrap">
@if($invoice->isPayable() && $invoice->balance > 0 && !empty(auth()->user()->client->service()->getPaymentMethods(0))) @if($invoice->isPayable() && $invoice->balance > 0 && $gateway_available)
<form action="{{ route('client.invoices.bulk') }}" method="post"> <form action="{{ route('client.invoices.bulk') }}" method="post">
@csrf @csrf
<input type="hidden" name="invoices[]" value="{{ $invoice->hashed_id }}"> <input type="hidden" name="invoices[]" value="{{ $invoice->hashed_id }}">
@ -121,7 +121,7 @@
</div> </div>
</div> </div>
<div class="flex justify-center mt-6 mb-6 md:justify-between"> <div class="flex justify-center mt-6 mb-6 md:justify-between">
@if($invoices->total() > 0) @if($invoices && $invoices->total() > 0)
<span class="hidden text-sm text-gray-700 md:block mr-2"> <span class="hidden text-sm text-gray-700 md:block mr-2">
{{ ctrans('texts.showing_x_of', ['first' => $invoices->firstItem(), 'last' => $invoices->lastItem(), 'total' => $invoices->total()]) }} {{ ctrans('texts.showing_x_of', ['first' => $invoices->firstItem(), 'last' => $invoices->lastItem(), 'total' => $invoices->total()]) }}
</span> </span>

View File

@ -20,10 +20,10 @@
@if (count($tokens) > 0) @if (count($tokens) > 0)
@foreach ($tokens as $token) @foreach ($tokens as $token)
<label class="mr-4"> <label class="mr-4">
<input type="radio" data-token="{{ $token->hashed_id }}" name="payment-type" <input type="radio" data-token="{{ $token->token }}" name="payment-type"
class="form-radio cursor-pointer toggle-payment-with-token" /> class="form-radio cursor-pointer toggle-payment-with-token" />
<span class="ml-1 cursor-pointer">{{ ctrans('texts.bank_transfer') }} <span class="ml-1 cursor-pointer">{{ ctrans('texts.bank_transfer') }}
(#{{ $token->hashed_id }})</span> (#{{ $token->token }})</span>
</label> </label>
@endforeach @endforeach
@endisset @endisset

View File

@ -20,10 +20,10 @@
@if (count($tokens) > 0) @if (count($tokens) > 0)
@foreach ($tokens as $token) @foreach ($tokens as $token)
<label class="mr-4"> <label class="mr-4">
<input type="radio" data-token="{{ $token->hashed_id }}" name="payment-type" <input type="radio" data-token="{{ $token->token }}" name="payment-type"
class="form-radio cursor-pointer toggle-payment-with-token" /> class="form-radio cursor-pointer toggle-payment-with-token" />
<span class="ml-1 cursor-pointer">{{ ctrans('texts.payment_type_direct_debit') }} <span class="ml-1 cursor-pointer">{{ ctrans('texts.payment_type_direct_debit') }}
(#{{ $token->hashed_id }})</span> (#{{ $token->token }})</span>
</label> </label>
@endforeach @endforeach
@endisset @endisset

View File

@ -20,10 +20,10 @@
@if (count($tokens) > 0) @if (count($tokens) > 0)
@foreach ($tokens as $token) @foreach ($tokens as $token)
<label class="mr-4"> <label class="mr-4">
<input type="radio" data-token="{{ $token->hashed_id }}" name="payment-type" <input type="radio" data-token="{{ $token->token }}" name="payment-type"
class="form-radio cursor-pointer toggle-payment-with-token" /> class="form-radio cursor-pointer toggle-payment-with-token" />
<span class="ml-1 cursor-pointer">{{ ctrans('texts.payment_type_SEPA') }} <span class="ml-1 cursor-pointer">{{ ctrans('texts.payment_type_SEPA') }}
(#{{ $token->hashed_id }})</span> (#{{ $token->token }})</span>
</label> </label>
@endforeach @endforeach
@endisset @endisset

View File

@ -110,14 +110,14 @@
document.getElementById('handlePlanChange').addEventListener('click', function() { document.getElementById('handlePlanChange').addEventListener('click', function() {
if(document.getElementById("newPlan").value.length > 1) if(document.getElementById("newPlan").value.length > 1)
location.href = 'http://devhosted.test:8000/client/subscriptions/{{ $current_recurring_id }}/plan_switch/' + document.getElementById("newPlan").value + ''; location.href = 'https://invoiceninja.invoicing.co/client/subscriptions/{{ $current_recurring_id }}/plan_switch/' + document.getElementById("newPlan").value + '';
}); });
@else @else
document.getElementById('handleNewPlan').addEventListener('click', function() { document.getElementById('handleNewPlan').addEventListener('click', function() {
if(document.getElementById("newPlan").value.length > 1) if(document.getElementById("newPlan").value.length > 1)
location.href = 'http://devhosted.test:8000/client/subscriptions/' + document.getElementById("newPlan").value + '/purchase'; location.href = 'https://invoiceninja.invoicing.co/client/subscriptions/' + document.getElementById("newPlan").value + '/purchase';
}); });
@endif @endif