{{-- Connecting one POS shop's billing to BCP. Two halves, on two systems. This screen is BCP's: it says what connecting changes for the shop, takes the opening SMS credit, and after the button shows the token once with the command that finishes the job on the POS's server. It never writes anything in the POS. Every class here is one the token screens or the subscription screens already use, so the built stylesheet carries all of them. --}}

Connect {{ $shop['name'] }} to BCP

Shop #{{ $shop['id'] }} in the POS{{ $shop['owner'] ? ' · '.$shop['owner'] : '' }}

Back
@if ($newToken) {{-- Step two. The token is on this page once: it was flashed by the action and is gone on the next request. --}} {{-- The colours of the success notice, not of the token screen's panel: that one is light text on a dark ground the panel no longer has, and a credential nobody can read is copied wrong. --}}
Step 1 is done. Now finish on the POS's server.
1. In cPanel → Terminal on the POS's server, run this line:
{{ $command }}
2. It asks for the token and shows nothing as you paste. Paste this, then press Enter:
{{ $newToken }}
Copy the token now. It is shown this once and BCP keeps only a hash of it. Nothing more happens by itself: the shop turns Connected on the Shops screen only after that command answers ok.
The token is a password. Do not take a screenshot of this page or send the token to anyone.
@elseif ($state === 'pending') {{-- Come back to later, with no token on the page. The first wording here was "Waiting for the POS", and the owner waited: it read as something in progress. Nothing is in progress. It is their turn, so the screen says so and shows what to run. --}} @endif

What connecting changes for this shop

Its packages and subscriptions are mirrored here, and its invoices and payments are kept here.

Its next package purchase or renewal is paid on BCP's payment page.

Its SMS is counted against the credit it holds here. A shop with none is refused every SMS, so release what it should start with below, before it is connected.

Package in the POS
{{ $shop['package'] ?? 'None in force' }}
BCP account
{{ $tenant ? '#'.$tenant->id.' · '.$tenant->slug : 'None yet' }}
SMS credit here
{{ number_format($smsBalance) }}
Billing in BCP
{{ [ 'connected' => 'Connected', 'linked' => 'Connected, no subscription yet', 'pending' => 'Not finished', 'none' => 'Not connected', ][$state] }}
@csrf
@error('sms_credit')

{{ $message }}

@enderror

@if ($tenant) This shop already has an account here, with {{ number_format($smsBalance) }} SMS credit. Leave 0 to add none. @else How many SMS the shop starts with. With 0, the POS stops sending this shop's SMS as soon as it is connected. @endif

Cancel