@extends('layouts.auth') @section('content') @php /** * The approval step that stands between the signup form and an account existing. * * Public, because there is nobody to authenticate yet: the applicant's details are held in the * session and nothing has been written. Approving the agreement here is what causes the user, the * restaurant and the paid term to be created — abandoning it leaves no trace. * * Markup mirrors vendor/pay.php and feeds the SAME assets/js/pay-.js the rest of the * product uses, so there is one payment client rather than a second one for this page. The provider * SDK only ever reaches the browser when that gateway is enabled and keyed. * * @var array $plan the plan being subscribed to * @var string $provider 'paypal' | 'stripe' * @var string $planRef the gateway's own id for this plan — the agreement is made against it * @var string $publicKey PayPal client id / Stripe publishable key * @var string $currency ISO currency code * @var float $amount what the plan costs per cycle * @var int $trialDays free days before the first charge (0 = none) * @var string $ref the subscription the server opened, when the gateway works that way * @var string $clientSecret what the browser confirms it with (Stripe only) * @var string $confirmUrl @var string $callbackUrl @var string $cancelUrl */ /* WHAT THE FIGURE IS MADE OF. $amount is a GROSS — VendorSignupController hands this page Invoice::grossFor(), the same figure the gateway plan is published at — and this is the last screen before an account exists, which makes it the one place the charge has to be fully explained: list price and annual discount when one applies, the tax line, the total. All of that is partials/pay-summary.php, shared with vendor/pay.php so the two checkouts and the first invoice can never disagree. @var float|null $listAmount @var float $discountPct */ @endphp

{{ t_raw('vendor.billing.pay_page_title') }}

@php /* The page's messages belong UNDER its title band, inside the page the reader is looking at — not floating above it. getFlashes() consumes, so the layout's own call further out finds nothing and does not draw it twice. */ @endphp
@partial('flash')
@php /* container-fluid, not the boxed container: the cart, the vendor checkouts and every other payment surface run full-width, and the boxed variant made this one page read narrower than the product around it. */ @endphp
@php /* THE 8/4 SHAPE EVERY VENDOR PAYMENT USES: how it is paid on the left; what is being paid — net, tax, total — on the right, beside the button that acts on it. The method itself was chosen back on the signup form, so the left column carries ONE tender row, not a list; it keeps its checked radio so the row reads exactly like a chosen row on the vendor checkout. ONE form wraps both columns, or the button could not submit the element it sits beside. */ @endphp

{{ t_raw('checkout.payment_method') }}

@if ($provider !== 'paypal')
@endif

{{ t_raw('cart.summary') }}

@partial('pay-summary', [ 'label' => (string) $plan['name'], 'amount' => (float) $amount, 'listAmount' => $listAmount ?? null, 'discountPct' => (float) ($discountPct ?? 0), ]) @php $termCycle = (string) ($termCycle ?? ''); @endphp @if ($termCycle === 'yearly')

{{ t_raw('vendor.billing.term_yearly_note') }}

@elseif ($termCycle === 'monthly')

{{ t_raw('vendor.billing.term_monthly_note') }}

@endif @if ($provider === 'paypal') @php /* Shown while the PayPal window is open: the only thing this page used to do was grey its button out, which reads as "stuck" to someone approving in another window. */ @endphp @endif @php /* Back to the FORM — nothing exists yet, so there is nothing to cancel. */ @endphp
@php /* WHAT THE BUYER SEES ONCE THE GATEWAY HAS SAID YES. The confirm call answers with the facts of what was just created and the page shows them HERE, in place of the payment card — not a redirect into a dashboard with a one-line flash. The markup and its labels are rendered now; the scripts fill the values from the JSON and swap it in. */ @endphp
@php /* BOTH providers get a config block and their SDK. Only PayPal's was ever emitted, so the Stripe branch above rendered its Payment Element and its Pay button into a page with no Stripe.js and nothing to confirm — a button wired to nothing. The two carry different things because the providers work differently: PayPal is handed the published plan and opens the agreement itself, Stripe is handed the secret of a subscription the server has already opened. Both post the same id back to the same confirmUrl. */ @endphp @php /* No PayPal SDK: the approval link was minted server-side and the signup's own script opens it — nothing on this page talks to PayPal directly any more. */ @endphp @if ($provider !== 'paypal') @endif @endsection