diff --git a/app/Http/Controllers/MigrationController.php b/app/Http/Controllers/MigrationController.php index 73268eb0caf3..7a70ab910dcf 100644 --- a/app/Http/Controllers/MigrationController.php +++ b/app/Http/Controllers/MigrationController.php @@ -183,7 +183,7 @@ class MigrationController extends BaseController $company->expenses()->forceDelete(); $company->bank_transaction_rules()->forceDelete(); $company->bank_transactions()->forceDelete(); - $company->bank_integrations()->forceDelete(); + // $company->bank_integrations()->forceDelete(); $company->all_activities()->forceDelete(); diff --git a/app/Http/Livewire/BillingPortalPurchasev2.php b/app/Http/Livewire/BillingPortalPurchasev2.php index 9d062007fe10..79bf70f3bd40 100644 --- a/app/Http/Livewire/BillingPortalPurchasev2.php +++ b/app/Http/Livewire/BillingPortalPurchasev2.php @@ -39,14 +39,6 @@ class BillingPortalPurchasev2 extends Component */ public $hash; - /** - * Top level text on the left side of billing page. - * - * @var string - */ - public $heading_text; - - /** * E-mail address model for user input. * @@ -80,9 +72,13 @@ class BillingPortalPurchasev2 extends Component * * @var \string[][] */ - protected $rules = [ - 'email' => ['required', 'email'], - ]; + // protected $rules = [ + // 'email' => ['required', 'email'], + // 'data' => ['required', 'array'], + // 'data.*.recurring_qty' => ['required', 'between:100,1000'], + // 'data.*.optional_recurring_qty' => ['required', 'between:100,1000'], + // 'data.*.optional_qty' => ['required', 'between:100,1000'], + // ]; /** * Id for CompanyGateway record. @@ -120,6 +116,8 @@ class BillingPortalPurchasev2 extends Component 'payment_required' => true, ]; + public $data = []; + /** * List of payment methods fetched from client. * @@ -187,6 +185,8 @@ class BillingPortalPurchasev2 extends Component $this->quantity = 1; + $this->data = []; + $this->price = $this->subscription->price; if (request()->query('coupon')) { @@ -198,6 +198,44 @@ class BillingPortalPurchasev2 extends Component } } + public function updatingData() + { + nlog('updating'); + // nlog($this->data); + } + + public function updatedData() + { + nlog('updated'); + nlog($this->data); + $validatedData = $this->validate(); + nlog( $validatedData ); + } + + public function updated($propertyName) + { + nlog("validating {$propertyName}"); + $this->errors = $this->validateOnly($propertyName); + + nlog($this->errors); + $validatedData = $this->validate(); + nlog( $validatedData ); + + } + + public function rules() + { + $rules = [ + 'email' => ['required', 'email'], + 'data' => ['required', 'array'], + 'data.*.recurring_qty' => ['required', 'between:100,1000'], + 'data.*.optional_recurring_qty' => ['required', 'between:100,1000'], + 'data.*.optional_qty' => ['required', 'between:100,1000'], + ]; + + return $rules; + } + /** * Handle user authentication * @@ -265,9 +303,6 @@ class BillingPortalPurchasev2 extends Component } } -// nlog($this->subscription->group_settings->settings); -// nlog($this->subscription->group_settings->settings->currency_id); - if(array_key_exists('currency_id', $this->request_data)) { $currency = Cache::get('currencies')->filter(function ($item){ @@ -525,4 +560,11 @@ class BillingPortalPurchasev2 extends Component return render('components.livewire.billing-portal-purchasev2'); } + + public function changeData() + { + + nlog($this->data); + + } } diff --git a/app/PaymentDrivers/Stripe/ACH.php b/app/PaymentDrivers/Stripe/ACH.php index 8e8a8f70ebf4..517022afcb82 100644 --- a/app/PaymentDrivers/Stripe/ACH.php +++ b/app/PaymentDrivers/Stripe/ACH.php @@ -175,7 +175,7 @@ class ACH if ($invoice) { $description = ctrans('texts.stripe_paymenttext', ['invoicenumber' => $invoice->number, 'amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); } else { - $description = ctrans('text.stripe_paymenttext_without_invoice', ['amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); + $description = ctrans('texts.stripe_paymenttext_without_invoice', ['amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); } @@ -213,7 +213,7 @@ class ACH if ($invoice) { $description = ctrans('texts.stripe_paymenttext', ['invoicenumber' => $invoice->number, 'amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); } else { - $description = ctrans('text.stripe_paymenttext_without_invoice', ['amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); + $description = ctrans('texts.stripe_paymenttext_without_invoice', ['amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); } if (substr($cgt->token, 0, 2) === 'pm') { @@ -457,7 +457,7 @@ class ACH if ($invoice) { $description = ctrans('texts.stripe_paymenttext', ['invoicenumber' => $invoice->number, 'amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); } else { - $description = ctrans('text.stripe_paymenttext_without_invoice', ['amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); + $description = ctrans('texts.stripe_paymenttext_without_invoice', ['amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); } if (substr($source->token, 0, 2) === 'pm') { diff --git a/app/PaymentDrivers/Stripe/Charge.php b/app/PaymentDrivers/Stripe/Charge.php index dabef4a6fbf6..36fb40e9a104 100644 --- a/app/PaymentDrivers/Stripe/Charge.php +++ b/app/PaymentDrivers/Stripe/Charge.php @@ -65,7 +65,7 @@ class Charge if ($invoice) { $description = ctrans('texts.stripe_paymenttext', ['invoicenumber' => $invoice->number, 'amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); } else { - $description = ctrans('text.stripe_paymenttext_without_invoice', ['amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); + $description = ctrans('texts.stripe_paymenttext_without_invoice', ['amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()]); } $this->stripe->init(); diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php index 08db6b38075b..5300edf2bad8 100644 --- a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchasev2.blade.php @@ -1,7 +1,3 @@ - -
{{ \App\Utils\Number::formatMoney($product->price, $subscription->company) }} / {{ App\Models\RecurringInvoice::frequencyForKey($subscription->frequency_id) }}
{{ ctrans('texts.qty') }}
+ +{{ \App\Utils\Number::formatMoney($product->price, $subscription->company) }}
{{ ctrans('texts.qty') }}
- +{{ ctrans('texts.qty') }}
- +