mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #9653 from turbo124/v5-develop
Stripe network updates
This commit is contained in:
commit
dc1ca43514
@ -133,6 +133,10 @@ class RecurringInvoiceFilters extends QueryFilters
|
|||||||
return $this->builder->orderByRaw("REGEXP_REPLACE(number,'[^0-9]+','')+0 " . $dir);
|
return $this->builder->orderByRaw("REGEXP_REPLACE(number,'[^0-9]+','')+0 " . $dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($sort_col[0] == 'status_id'){
|
||||||
|
return $this->builder->orderBy('status_id', $dir)->orderBy('last_sent_date', $dir);
|
||||||
|
}
|
||||||
|
|
||||||
if($sort_col[0] == 'next_send_datetime') {
|
if($sort_col[0] == 'next_send_datetime') {
|
||||||
$sort_col[0] = 'next_send_date';
|
$sort_col[0] = 'next_send_date';
|
||||||
}
|
}
|
||||||
|
@ -270,7 +270,7 @@ class BankIntegrationController extends BaseController
|
|||||||
|
|
||||||
$nordigen = new Nordigen();
|
$nordigen = new Nordigen();
|
||||||
|
|
||||||
BankIntegration::where("integration_type", BankIntegration::INTEGRATION_TYPE_NORDIGEN)->whereNotNull('nordigen_account_id')->each(function (BankIntegration $bank_integration) use ($nordigen) {
|
BankIntegration::where("integration_type", BankIntegration::INTEGRATION_TYPE_NORDIGEN)->where('account_id', $user->account_id)->whereNotNull('nordigen_account_id')->each(function (BankIntegration $bank_integration) use ($nordigen) {
|
||||||
$is_account_active = $nordigen->isAccountActive($bank_integration->nordigen_account_id);
|
$is_account_active = $nordigen->isAccountActive($bank_integration->nordigen_account_id);
|
||||||
$account = $nordigen->getAccount($bank_integration->nordigen_account_id);
|
$account = $nordigen->getAccount($bank_integration->nordigen_account_id);
|
||||||
|
|
||||||
|
@ -11,12 +11,15 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\Company;
|
namespace App\Http\Requests\Company;
|
||||||
|
|
||||||
use App\DataMapper\CompanySettings;
|
|
||||||
use App\Http\Requests\Request;
|
|
||||||
use App\Http\ValidationRules\Company\ValidSubdomain;
|
|
||||||
use App\Http\ValidationRules\ValidSettingsRule;
|
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
|
use App\Http\Requests\Request;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\DataMapper\CompanySettings;
|
||||||
|
use InvoiceNinja\EInvoice\EInvoice;
|
||||||
|
use App\Http\ValidationRules\ValidSettingsRule;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\Invoice;
|
||||||
|
use App\Http\ValidationRules\EInvoice\ValidScheme;
|
||||||
|
use App\Http\ValidationRules\Company\ValidSubdomain;
|
||||||
|
|
||||||
class UpdateCompanyRequest extends Request
|
class UpdateCompanyRequest extends Request
|
||||||
{
|
{
|
||||||
@ -64,6 +67,7 @@ class UpdateCompanyRequest extends Request
|
|||||||
$rules['smtp_local_domain'] = 'sometimes|string|nullable';
|
$rules['smtp_local_domain'] = 'sometimes|string|nullable';
|
||||||
// $rules['smtp_verify_peer'] = 'sometimes|string';
|
// $rules['smtp_verify_peer'] = 'sometimes|string';
|
||||||
|
|
||||||
|
// $rules['e_invoice'] = ['sometimes','nullable', new ValidScheme()];
|
||||||
|
|
||||||
if (isset($input['portal_mode']) && ($input['portal_mode'] == 'domain' || $input['portal_mode'] == 'iframe')) {
|
if (isset($input['portal_mode']) && ($input['portal_mode'] == 'domain' || $input['portal_mode'] == 'iframe')) {
|
||||||
$rules['portal_domain'] = 'bail|nullable|sometimes|url';
|
$rules['portal_domain'] = 'bail|nullable|sometimes|url';
|
||||||
@ -113,11 +117,6 @@ class UpdateCompanyRequest extends Request
|
|||||||
$input['smtp_verify_peer'] == 'true' ? true : false;
|
$input['smtp_verify_peer'] == 'true' ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if(isset($input['e_invoice'])){
|
|
||||||
// nlog("am i set?");
|
|
||||||
// $r = FatturaElettronica::validate($input['e_invoice']);
|
|
||||||
// }
|
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
62
app/Http/ValidationRules/EInvoice/ValidScheme.php
Normal file
62
app/Http/ValidationRules/EInvoice/ValidScheme.php
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com).
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*1`
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Http\ValidationRules\EInvoice;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use InvoiceNinja\EInvoice\EInvoice;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
use InvoiceNinja\EInvoice\Models\Peppol\Invoice;
|
||||||
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
|
use Illuminate\Contracts\Validation\ValidatorAwareRule;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class BlackListRule.
|
||||||
|
*/
|
||||||
|
class ValidScheme implements ValidationRule, ValidatorAwareRule
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The validator instance.
|
||||||
|
*
|
||||||
|
* @var Validator
|
||||||
|
*/
|
||||||
|
protected $validator;
|
||||||
|
|
||||||
|
public function validate(string $attribute, mixed $value, Closure $fail): void
|
||||||
|
{
|
||||||
|
|
||||||
|
$r = new EInvoice();
|
||||||
|
$errors = $r->validateRequest($value['Invoice'], Invoice::class);
|
||||||
|
|
||||||
|
foreach ($errors as $key => $msg) {
|
||||||
|
|
||||||
|
$this->validator->errors()->add(
|
||||||
|
"e_invoice.{$key}",
|
||||||
|
"{$key} - {$msg}"
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the current validator.
|
||||||
|
*/
|
||||||
|
public function setValidator(Validator $validator): static
|
||||||
|
{
|
||||||
|
$this->validator = $validator;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -391,7 +391,7 @@ class PaymentEmailEngine extends BaseEmailEngine
|
|||||||
$invoice_list = '<br><br>';
|
$invoice_list = '<br><br>';
|
||||||
|
|
||||||
foreach ($this->payment->invoices as $invoice) {
|
foreach ($this->payment->invoices as $invoice) {
|
||||||
$invoice_list .= ctrans('texts.invoice_number_short')." {$invoice->number} ".Number::formatMoney($invoice->pivot->amount, $this->client).'\n';
|
$invoice_list .= ctrans('texts.invoice_number_short')." {$invoice->number} ".Number::formatMoney($invoice->pivot->amount, $this->client).'<br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $invoice_list;
|
return $invoice_list;
|
||||||
|
@ -419,7 +419,7 @@ trait GeneratesCounter
|
|||||||
$check_counter = 1;
|
$check_counter = 1;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$number = $this->getFormattedEntityNumber($entity, $counter, $padding, $pattern);
|
$number = $this->getFormattedEntityNumber($entity, $counter, $padding, $pattern, $prefix);
|
||||||
|
|
||||||
$check = $class::where('company_id', $entity->company_id)->where('number', $number)->withTrashed()->exists();
|
$check = $class::where('company_id', $entity->company_id)->where('number', $number)->withTrashed()->exists();
|
||||||
|
|
||||||
|
64
composer.lock
generated
64
composer.lock
generated
@ -526,16 +526,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "aws/aws-sdk-php",
|
"name": "aws/aws-sdk-php",
|
||||||
"version": "3.314.3",
|
"version": "3.314.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||||
"reference": "c9e8a31cfa07f47b7ab9ecc741845a3a9d50fc61"
|
"reference": "fd1261a60495a7aeb2661d8b7eecfd5fc16abd41"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/c9e8a31cfa07f47b7ab9ecc741845a3a9d50fc61",
|
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/fd1261a60495a7aeb2661d8b7eecfd5fc16abd41",
|
||||||
"reference": "c9e8a31cfa07f47b7ab9ecc741845a3a9d50fc61",
|
"reference": "fd1261a60495a7aeb2661d8b7eecfd5fc16abd41",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -615,9 +615,9 @@
|
|||||||
"support": {
|
"support": {
|
||||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.314.3"
|
"source": "https://github.com/aws/aws-sdk-php/tree/3.314.4"
|
||||||
},
|
},
|
||||||
"time": "2024-06-17T18:13:22+00:00"
|
"time": "2024-06-18T18:13:34+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "bacon/bacon-qr-code",
|
"name": "bacon/bacon-qr-code",
|
||||||
@ -4173,12 +4173,12 @@
|
|||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/invoiceninja/einvoice.git",
|
"url": "https://github.com/invoiceninja/einvoice.git",
|
||||||
"reference": "c26ae46a132b00d9cba5b047218f530ae660ccc7"
|
"reference": "468a2a3696e76b1216a129e79177eb7c16ea9bdb"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/c26ae46a132b00d9cba5b047218f530ae660ccc7",
|
"url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/468a2a3696e76b1216a129e79177eb7c16ea9bdb",
|
||||||
"reference": "c26ae46a132b00d9cba5b047218f530ae660ccc7",
|
"reference": "468a2a3696e76b1216a129e79177eb7c16ea9bdb",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -4220,7 +4220,7 @@
|
|||||||
"source": "https://github.com/invoiceninja/einvoice/tree/main",
|
"source": "https://github.com/invoiceninja/einvoice/tree/main",
|
||||||
"issues": "https://github.com/invoiceninja/einvoice/issues"
|
"issues": "https://github.com/invoiceninja/einvoice/issues"
|
||||||
},
|
},
|
||||||
"time": "2024-06-12T06:01:18+00:00"
|
"time": "2024-06-19T00:29:39+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "invoiceninja/inspector",
|
"name": "invoiceninja/inspector",
|
||||||
@ -4725,16 +4725,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/framework",
|
"name": "laravel/framework",
|
||||||
"version": "v10.48.12",
|
"version": "v10.48.13",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/framework.git",
|
"url": "https://github.com/laravel/framework.git",
|
||||||
"reference": "590afea38e708022662629fbf5184351fa82cf08"
|
"reference": "2c6816d697a4362c09c066118addda251b70b98a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/framework/zipball/590afea38e708022662629fbf5184351fa82cf08",
|
"url": "https://api.github.com/repos/laravel/framework/zipball/2c6816d697a4362c09c066118addda251b70b98a",
|
||||||
"reference": "590afea38e708022662629fbf5184351fa82cf08",
|
"reference": "2c6816d697a4362c09c066118addda251b70b98a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -4928,20 +4928,20 @@
|
|||||||
"issues": "https://github.com/laravel/framework/issues",
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
"source": "https://github.com/laravel/framework"
|
"source": "https://github.com/laravel/framework"
|
||||||
},
|
},
|
||||||
"time": "2024-05-28T15:46:19+00:00"
|
"time": "2024-06-18T16:46:35+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/prompts",
|
"name": "laravel/prompts",
|
||||||
"version": "v0.1.23",
|
"version": "v0.1.24",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/prompts.git",
|
"url": "https://github.com/laravel/prompts.git",
|
||||||
"reference": "9bc4df7c699b0452c6b815e64a2d84b6d7f99400"
|
"reference": "409b0b4305273472f3754826e68f4edbd0150149"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/prompts/zipball/9bc4df7c699b0452c6b815e64a2d84b6d7f99400",
|
"url": "https://api.github.com/repos/laravel/prompts/zipball/409b0b4305273472f3754826e68f4edbd0150149",
|
||||||
"reference": "9bc4df7c699b0452c6b815e64a2d84b6d7f99400",
|
"reference": "409b0b4305273472f3754826e68f4edbd0150149",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -4984,9 +4984,9 @@
|
|||||||
"description": "Add beautiful and user-friendly forms to your command-line applications.",
|
"description": "Add beautiful and user-friendly forms to your command-line applications.",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/laravel/prompts/issues",
|
"issues": "https://github.com/laravel/prompts/issues",
|
||||||
"source": "https://github.com/laravel/prompts/tree/v0.1.23"
|
"source": "https://github.com/laravel/prompts/tree/v0.1.24"
|
||||||
},
|
},
|
||||||
"time": "2024-05-27T13:53:20+00:00"
|
"time": "2024-06-17T13:58:22+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/serializable-closure",
|
"name": "laravel/serializable-closure",
|
||||||
@ -5111,16 +5111,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/socialite",
|
"name": "laravel/socialite",
|
||||||
"version": "v5.14.0",
|
"version": "v5.15.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/socialite.git",
|
"url": "https://github.com/laravel/socialite.git",
|
||||||
"reference": "c7b0193a3753a29aff8ce80aa2f511917e6ed68a"
|
"reference": "c8234bfb286a8210df8d62f94562c71bfda4a446"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/socialite/zipball/c7b0193a3753a29aff8ce80aa2f511917e6ed68a",
|
"url": "https://api.github.com/repos/laravel/socialite/zipball/c8234bfb286a8210df8d62f94562c71bfda4a446",
|
||||||
"reference": "c7b0193a3753a29aff8ce80aa2f511917e6ed68a",
|
"reference": "c8234bfb286a8210df8d62f94562c71bfda4a446",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -5179,7 +5179,7 @@
|
|||||||
"issues": "https://github.com/laravel/socialite/issues",
|
"issues": "https://github.com/laravel/socialite/issues",
|
||||||
"source": "https://github.com/laravel/socialite"
|
"source": "https://github.com/laravel/socialite"
|
||||||
},
|
},
|
||||||
"time": "2024-05-03T20:31:38+00:00"
|
"time": "2024-06-11T13:33:20+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/tinker",
|
"name": "laravel/tinker",
|
||||||
@ -6178,16 +6178,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "livewire/livewire",
|
"name": "livewire/livewire",
|
||||||
"version": "v3.5.0",
|
"version": "v3.5.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/livewire/livewire.git",
|
"url": "https://github.com/livewire/livewire.git",
|
||||||
"reference": "72e900825c560f0e4e620185b26c5441a8914435"
|
"reference": "da044261bb5c5449397f18fda3409f14acf47c0a"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/livewire/livewire/zipball/72e900825c560f0e4e620185b26c5441a8914435",
|
"url": "https://api.github.com/repos/livewire/livewire/zipball/da044261bb5c5449397f18fda3409f14acf47c0a",
|
||||||
"reference": "72e900825c560f0e4e620185b26c5441a8914435",
|
"reference": "da044261bb5c5449397f18fda3409f14acf47c0a",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -6242,7 +6242,7 @@
|
|||||||
"description": "A front-end framework for Laravel.",
|
"description": "A front-end framework for Laravel.",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/livewire/livewire/issues",
|
"issues": "https://github.com/livewire/livewire/issues",
|
||||||
"source": "https://github.com/livewire/livewire/tree/v3.5.0"
|
"source": "https://github.com/livewire/livewire/tree/v3.5.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -6250,7 +6250,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2024-05-21T13:39:04+00:00"
|
"time": "2024-06-18T11:10:42+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "maennchen/zipstream-php",
|
"name": "maennchen/zipstream-php",
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
/**
|
|
||||||
* Invoice Ninja (https://invoiceninja.com)
|
|
||||||
*
|
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
||||||
*
|
|
||||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
|
||||||
*
|
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
|
||||||
*/class l{constructor(e,t,n,d){this.key=e,this.secret=t,this.onlyAuthorization=n,this.stripeConnect=d}setupStripe(){return this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this.elements=this.stripe.elements(),this}createElement(){var e;return this.cardElement=this.elements.create("card",{hidePostalCode:((e=document.querySelector("meta[name=stripe-require-postal-code]"))==null?void 0:e.content)==="0",value:{postalCode:document.querySelector("meta[name=client-postal-code]").content}}),this}mountCardElement(){return this.cardElement.mount("#card-element"),this}completePaymentUsingToken(){let e=document.querySelector("input[name=token]").value,t=document.getElementById("pay-now");this.payNowButton=t,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),this.stripe.handleCardPayment(this.secret,{payment_method:e}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}completePaymentWithoutToken(){let e=document.getElementById("pay-now");this.payNowButton=e,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden");let t=document.getElementById("cardholder-name");this.stripe.handleCardPayment(this.secret,this.cardElement,{payment_method_data:{billing_details:{name:t.value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}handleFailure(e){let t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,this.payNowButton.disabled=!1,this.payNowButton.querySelector("svg").classList.add("hidden"),this.payNowButton.querySelector("span").classList.remove("hidden")}handleAuthorization(){let e=document.getElementById("cardholder-name"),t=document.getElementById("authorize-card");this.payNowButton=t,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),this.stripe.handleCardSetup(this.secret,this.cardElement,{payment_method_data:{billing_details:{name:e.value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccessfulAuthorization(n))}handleSuccessfulAuthorization(e){document.getElementById("gateway_response").value=JSON.stringify(e.setupIntent),document.getElementById("server_response").submit()}handle(){this.setupStripe(),this.onlyAuthorization?(this.createElement().mountCardElement(),document.getElementById("authorize-card").addEventListener("click",()=>this.handleAuthorization())):(Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",t=>{document.getElementById("stripe--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=t.target.dataset.token})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",e=>{document.getElementById("stripe--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),this.createElement().mountCardElement(),document.getElementById("pay-now").addEventListener("click",()=>{try{return document.querySelector("input[name=token]").value?this.completePaymentUsingToken():this.completePaymentWithoutToken()}catch(e){console.log(e.message)}}))}}var o;const c=((o=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:o.content)??"";var r;const u=((r=document.querySelector('meta[name="stripe-secret"]'))==null?void 0:r.content)??"";var a;const m=((a=document.querySelector('meta[name="only-authorization"]'))==null?void 0:a.content)??"";var s;const h=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";let i=new l(c,u,m,h);i.handle();document.addEventListener("livewire:init",()=>{Livewire.on("passed-required-fields-check",()=>i.handle())});
|
|
9
public/build/assets/stripe-credit-card-75322a3b.js
vendored
Normal file
9
public/build/assets/stripe-credit-card-75322a3b.js
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
|
*/class l{constructor(e,t,n,d){this.key=e,this.secret=t,this.onlyAuthorization=n,this.stripeConnect=d}setupStripe(){return this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this.elements=this.stripe.elements(),this}createElement(){var e;return this.cardElement=this.elements.create("card",{hidePostalCode:((e=document.querySelector("meta[name=stripe-require-postal-code]"))==null?void 0:e.content)==="0",value:{postalCode:document.querySelector("meta[name=client-postal-code]").content},hideIcon:!1}),this}mountCardElement(){return this.cardElement.mount("#card-element"),this}completePaymentUsingToken(){let e=document.querySelector("input[name=token]").value,t=document.getElementById("pay-now");this.payNowButton=t,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),this.stripe.handleCardPayment(this.secret,{payment_method:e}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}completePaymentWithoutToken(){let e=document.getElementById("pay-now");this.payNowButton=e,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden");let t=document.getElementById("cardholder-name");this.stripe.handleCardPayment(this.secret,this.cardElement,{payment_method_data:{billing_details:{name:t.value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}handleFailure(e){let t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,this.payNowButton.disabled=!1,this.payNowButton.querySelector("svg").classList.add("hidden"),this.payNowButton.querySelector("span").classList.remove("hidden")}handleAuthorization(){let e=document.getElementById("cardholder-name"),t=document.getElementById("authorize-card");this.payNowButton=t,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),this.stripe.handleCardSetup(this.secret,this.cardElement,{payment_method_data:{billing_details:{name:e.value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccessfulAuthorization(n))}handleSuccessfulAuthorization(e){document.getElementById("gateway_response").value=JSON.stringify(e.setupIntent),document.getElementById("server_response").submit()}handle(){this.setupStripe(),this.onlyAuthorization?(this.createElement().mountCardElement(),document.getElementById("authorize-card").addEventListener("click",()=>this.handleAuthorization())):(Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",t=>{document.getElementById("stripe--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=t.target.dataset.token})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",e=>{document.getElementById("stripe--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),this.createElement().mountCardElement(),document.getElementById("pay-now").addEventListener("click",()=>{try{return document.querySelector("input[name=token]").value?this.completePaymentUsingToken():this.completePaymentWithoutToken()}catch(e){console.log(e.message)}}))}}var o;const c=((o=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:o.content)??"";var r;const u=((r=document.querySelector('meta[name="stripe-secret"]'))==null?void 0:r.content)??"";var a;const m=((a=document.querySelector('meta[name="only-authorization"]'))==null?void 0:a.content)??"";var s;const h=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";let i=new l(c,u,m,h);i.handle();document.addEventListener("livewire:init",()=>{Livewire.on("passed-required-fields-check",()=>i.handle())});
|
@ -146,7 +146,7 @@
|
|||||||
"src": "resources/js/clients/payments/stripe-browserpay.js"
|
"src": "resources/js/clients/payments/stripe-browserpay.js"
|
||||||
},
|
},
|
||||||
"resources/js/clients/payments/stripe-credit-card.js": {
|
"resources/js/clients/payments/stripe-credit-card.js": {
|
||||||
"file": "assets/stripe-credit-card-5690eb6c.js",
|
"file": "assets/stripe-credit-card-75322a3b.js",
|
||||||
"isEntry": true,
|
"isEntry": true,
|
||||||
"src": "resources/js/clients/payments/stripe-credit-card.js"
|
"src": "resources/js/clients/payments/stripe-credit-card.js"
|
||||||
},
|
},
|
||||||
|
@ -39,7 +39,8 @@ class StripeCreditCard {
|
|||||||
hidePostalCode: document.querySelector('meta[name=stripe-require-postal-code]')?.content === "0",
|
hidePostalCode: document.querySelector('meta[name=stripe-require-postal-code]')?.content === "0",
|
||||||
value: {
|
value: {
|
||||||
postalCode: document.querySelector('meta[name=client-postal-code]').content,
|
postalCode: document.querySelector('meta[name=client-postal-code]').content,
|
||||||
}
|
},
|
||||||
|
hideIcon: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
@ -37,6 +37,7 @@ Route::group(['middleware' => ['auth:vendor', 'vendor_locale', 'domain_db'], 'pr
|
|||||||
|
|
||||||
Route::get('profile/{vendor_contact}/edit', [VendorContactController::class, 'edit'])->name('profile.edit');
|
Route::get('profile/{vendor_contact}/edit', [VendorContactController::class, 'edit'])->name('profile.edit');
|
||||||
Route::put('profile/{vendor_contact}/edit', [VendorContactController::class, 'update'])->name('profile.update');
|
Route::put('profile/{vendor_contact}/edit', [VendorContactController::class, 'update'])->name('profile.update');
|
||||||
|
Route::get('purchase_order/{invitation_key}/download_e_purchase_order', [App\Http\Controllers\PurchaseOrderController::class, 'downloadEPurchaseOrder'])->name('purchase_order.download_e_purchase_order')->middleware('token_auth');
|
||||||
|
|
||||||
Route::post('purchase_orders/bulk', [PurchaseOrderController::class, 'bulk'])->name('purchase_orders.bulk');
|
Route::post('purchase_orders/bulk', [PurchaseOrderController::class, 'bulk'])->name('purchase_orders.bulk');
|
||||||
Route::get('logout', [VendorContactLoginController::class, 'logout'])->name('logout');
|
Route::get('logout', [VendorContactLoginController::class, 'logout'])->name('logout');
|
||||||
@ -50,6 +51,5 @@ Route::group(['middleware' => ['auth:vendor', 'vendor_locale', 'domain_db'], 'pr
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::get('purchase_order/{invitation_key}/download_e_purchase_order', [App\Http\Controllers\PurchaseOrderController::class, 'downloadEPurchaseOrder'])->name('purchase_order.download_e_purchase_order')->middleware('token_auth');
|
|
||||||
|
|
||||||
Route::fallback([BaseController::class, 'notFoundVendor']);
|
Route::fallback([BaseController::class, 'notFoundVendor']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user