Merge pull request #8533 from turbo124/v5-develop

v5.5.123
This commit is contained in:
David Bomba 2023-06-02 11:55:30 +10:00 committed by GitHub
commit 1cbc6adc1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
77 changed files with 617 additions and 202372 deletions

View File

@ -1 +1 @@
5.5.122 5.5.123

View File

@ -127,7 +127,8 @@ class CheckData extends Command
$this->checkClientSettings(); $this->checkClientSettings();
$this->checkCompanyTokens(); $this->checkCompanyTokens();
$this->checkUserState(); $this->checkUserState();
$this->checkContactEmailAndSendEmailStatus();
if (Ninja::isHosted()) { if (Ninja::isHosted()) {
$this->checkAccountStatuses(); $this->checkAccountStatuses();
$this->checkNinjaPortalUrls(); $this->checkNinjaPortalUrls();
@ -1114,4 +1115,23 @@ class CheckData extends Command
}); });
} }
public function checkContactEmailAndSendEmailStatus()
{
$q = ClientContact::whereNull('email')
->where('send_email', true);
$this->logMessage($q->count() . " Contacts with Send Email = true but no email address");
if ($this->option('fix') == 'true') {
$q->cursor()->each(function ($c){
$c->send_email = false;
$c->saveQuietly();
$this->logMessage("Fixing - {$c->id}");
});
}
}
} }

View File

@ -0,0 +1,259 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\DataMapper\Tax\AU;
use App\DataMapper\Tax\BaseRule;
use App\DataMapper\Tax\RuleInterface;
use App\Models\Product;
class Rule extends BaseRule implements RuleInterface
{
/** @var string $seller_region */
public string $seller_region = 'AU';
/** @var bool $consumer_tax_exempt */
public bool $consumer_tax_exempt = false;
/** @var bool $business_tax_exempt */
public bool $business_tax_exempt = false;
/** @var bool $eu_business_tax_exempt */
public bool $eu_business_tax_exempt = true;
/** @var bool $foreign_business_tax_exempt */
public bool $foreign_business_tax_exempt = false;
/** @var bool $foreign_consumer_tax_exempt */
public bool $foreign_consumer_tax_exempt = false;
/** @var float $tax_rate */
public float $tax_rate = 0;
/** @var float $reduced_tax_rate */
public float $reduced_tax_rate = 0;
/**
* Initializes the rules and builds any required data.
*
* @return self
*/
public function init(): self
{
$this->calculateRates();
return $this;
}
/**
* Sets the correct tax rate based on the product type.
*
* @param mixed $item
* @return self
*/
public function taxByType($item): self
{
if ($this->client->is_tax_exempt) {
return $this->taxExempt($item);
}
match(intval($item->tax_id)) {
Product::PRODUCT_TYPE_EXEMPT => $this->taxExempt($item),
Product::PRODUCT_TYPE_DIGITAL => $this->taxDigital($item),
Product::PRODUCT_TYPE_SERVICE => $this->taxService($item),
Product::PRODUCT_TYPE_SHIPPING => $this->taxShipping($item),
Product::PRODUCT_TYPE_PHYSICAL => $this->taxPhysical($item),
Product::PRODUCT_TYPE_REDUCED_TAX => $this->taxReduced($item),
Product::PRODUCT_TYPE_OVERRIDE_TAX => $this->override($item),
Product::PRODUCT_TYPE_ZERO_RATED => $this->zeroRated($item),
Product::PRODUCT_TYPE_REVERSE_TAX => $this->reverseTax($item),
default => $this->default($item),
};
return $this;
}
/**
* Calculates the tax rate for a reduced tax product
*
* @return self
*/
public function reverseTax($item): self
{
$this->tax_rate1 = 10;
$this->tax_name1 = 'GST';
return $this;
}
/**
* Calculates the tax rate for a reduced tax product
*
* @return self
*/
public function taxReduced($item): self
{
$this->tax_rate1 = $this->reduced_tax_rate;
$this->tax_name1 = 'GST';
return $this;
}
/**
* Calculates the tax rate for a zero rated tax product
*
* @return self
*/
public function zeroRated($item): self
{
$this->tax_rate1 = 0;
$this->tax_name1 = 'GST';
return $this;
}
/**
* Calculates the tax rate for a tax exempt product
*
* @return self
*/
public function taxExempt($item): self
{
$this->tax_name1 = '';
$this->tax_rate1 = 0;
return $this;
}
/**
* Calculates the tax rate for a digital product
*
* @return self
*/
public function taxDigital($item): self
{
$this->tax_rate1 = $this->tax_rate;
$this->tax_name1 = 'GST';
return $this;
}
/**
* Calculates the tax rate for a service product
*
* @return self
*/
public function taxService($item): self
{
$this->tax_rate1 = $this->tax_rate;
$this->tax_name1 = 'GST';
return $this;
}
/**
* Calculates the tax rate for a shipping product
*
* @return self
*/
public function taxShipping($item): self
{
$this->tax_rate1 = $this->tax_rate;
$this->tax_name1 = 'GST';
return $this;
}
/**
* Calculates the tax rate for a physical product
*
* @return self
*/
public function taxPhysical($item): self
{
$this->tax_rate1 = $this->tax_rate;
$this->tax_name1 = 'GST';
return $this;
}
/**
* Calculates the tax rate for a default product
*
* @return self
*/
public function default($item): self
{
$this->tax_name1 = '';
$this->tax_rate1 = 0;
return $this;
}
/**
* Calculates the tax rate for an override product
*
* @return self
*/
public function override($item): self
{
return $this;
}
/**
* Calculates the tax rates based on the client's location.
*
* @return self
*/
public function calculateRates(): self
{
if ($this->client->is_tax_exempt) {
nlog("tax exempt");
$this->tax_rate = 0;
$this->reduced_tax_rate = 0;
// } elseif($this->client_subregion != $this->client->company->tax_data->seller_subregion && in_array($this->client_subregion, $this->eu_country_codes) && $this->client->has_valid_vat_number && $this->eu_business_tax_exempt) {
// nlog("euro zone and tax exempt");
// $this->tax_rate = 0;
// $this->reduced_tax_rate = 0;
// } elseif(!in_array($this->client_subregion, $this->eu_country_codes) && ($this->foreign_consumer_tax_exempt || $this->foreign_business_tax_exempt)) { //foreign + tax exempt
// nlog("foreign and tax exempt");
// $this->tax_rate = 0;
// $this->reduced_tax_rate = 0;
// } elseif(!in_array($this->client_subregion, $this->eu_country_codes)) {
// $this->defaultForeign();
// } elseif(in_array($this->client_subregion, $this->eu_country_codes) && !$this->client->has_valid_vat_number) { //eu country / no valid vat
// if(($this->client->company->tax_data->seller_subregion != $this->client_subregion) && $this->client->company->tax_data->regions->EU->has_sales_above_threshold) {
// nlog("eu zone with sales above threshold");
// $this->tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->country->iso_3166_2}->tax_rate;
// $this->reduced_tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->country->iso_3166_2}->reduced_tax_rate;
// } else {
// nlog("EU with intra-community supply ie DE to DE");
// $this->tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->tax_rate;
// $this->reduced_tax_rate = $this->client->company->tax_data->regions->EU->subregions->{$this->client->company->country()->iso_3166_2}->reduced_tax_rate;
// }
} else {
nlog("default tax");
$this->tax_rate = $this->client->company->tax_data->regions->AU->subregions->{$this->client->company->country()->iso_3166_2}->tax_rate;
$this->reduced_tax_rate = $this->client->company->tax_data->regions->AU->subregions->{$this->client->company->country()->iso_3166_2}->reduced_tax_rate;
}
return $this;
}
}

View File

@ -104,7 +104,8 @@ class Handler extends ExceptionHandler
if (Ninja::isHosted()) { if (Ninja::isHosted()) {
if($exception instanceof ThrottleRequestsException && class_exists(\Modules\Admin\Events\ThrottledExceptionRaised::class)) { if($exception instanceof ThrottleRequestsException && class_exists(\Modules\Admin\Events\ThrottledExceptionRaised::class)) {
event(new \Modules\Admin\Events\ThrottledExceptionRaised(auth()->user()->account->key)); $uri = urldecode(request()->getRequestUri());
event(new \Modules\Admin\Events\ThrottledExceptionRaised(auth()->user()?->account?->key, $uri));
} }
Integration::configureScope(function (Scope $scope): void { Integration::configureScope(function (Scope $scope): void {

View File

@ -170,7 +170,7 @@ class InvoiceItemSum
private function shouldCalculateTax(): self private function shouldCalculateTax(): self
{ {
if (!$this->invoice->company->calculate_taxes || $this->invoice->company->account->isFreeHostedClient()) { if (!$this->invoice->company?->calculate_taxes || $this->invoice->company->account->isFreeHostedClient()) {
$this->calc_tax = false; $this->calc_tax = false;
return $this; return $this;
} }

View File

@ -365,21 +365,22 @@ class LoginController extends BaseController
private function hydrateCompanyUser(): Builder private function hydrateCompanyUser(): Builder
{ {
$cu = CompanyUser::query()->where('user_id', auth()->user()->id);
/** @var \App\Models\User $user */
$user = auth()->user();
$cu = CompanyUser::query()->where('user_id', $user->id);
if ($cu->count() == 0) { if ($cu->count() == 0) {
return $cu; return $cu;
} }
if (CompanyUser::query()->where('user_id', auth()->user()->id)->where('company_id', auth()->user()->account->default_company_id)->exists()) { if (CompanyUser::query()->where('user_id', $user->id)->where('company_id', $user->account->default_company_id)->exists()) {
$set_company = auth()->user()->account->default_company; $set_company = $user->account->default_company;
} else { } else {
$set_company = $cu->first()->company; $set_company = CompanyUser::query()->where('user_id', $user->id)->first()->company;
} }
/** @var \App\Models\User $user */
$user = auth()->user();
$user->setCompany($set_company); $user->setCompany($set_company);
$this->setLoginCache($user); $this->setLoginCache($user);
@ -389,15 +390,15 @@ class LoginController extends BaseController
$truth->setUser($user); $truth->setUser($user);
$truth->setCompany($set_company); $truth->setCompany($set_company);
$cu->first()->account->companies->each(function ($company) use ($cu) { $user->account->companies->each(function ($company) use ($user) {
if ($company->tokens()->where('is_system', true)->count() == 0) { if ($company->tokens()->where('is_system', true)->count() == 0) {
(new CreateCompanyToken($company, $cu->first()->user, request()->server('HTTP_USER_AGENT')))->handle(); (new CreateCompanyToken($company, $user, request()->server('HTTP_USER_AGENT')))->handle();
} }
}); });
$truth->setCompanyToken(CompanyToken::where('user_id', auth()->user()->id)->where('company_id', $set_company->id)->first()); $truth->setCompanyToken(CompanyToken::where('user_id', $user->id)->where('company_id', $set_company->id)->first());
return $cu; return CompanyUser::query()->where('user_id', $user->id);
} }
private function handleMicrosoftOauth() private function handleMicrosoftOauth()
@ -639,8 +640,8 @@ class LoginController extends BaseController
$parameters = ['response_type' => 'code', 'redirect_uri' => config('ninja.app_url') . "/auth/microsoft"]; $parameters = ['response_type' => 'code', 'redirect_uri' => config('ninja.app_url') . "/auth/microsoft"];
} }
if(request()->hasHeader('X-REACT')) if(request()->hasHeader('X-REACT') || request()->query('react'))
Cache::put("react_redir:".auth()->user()->account->key, 'true', 300); Cache::put("react_redir:".auth()->user()?->account->key, 'true', 300);
if (request()->has('code')) { if (request()->has('code')) {
return $this->handleProviderCallback($provider); return $this->handleProviderCallback($provider);
@ -696,7 +697,7 @@ class LoginController extends BaseController
$redirect_url = '/#/'; $redirect_url = '/#/';
$request_from_react = Cache::pull("react_redir:".auth()->user()->account->key); $request_from_react = Cache::pull("react_redir:".auth()->user()?->account?->key);
if($request_from_react) if($request_from_react)
$redirect_url = config('ninja.react_url')."/#/settings/user_details/connect"; $redirect_url = config('ninja.react_url')."/#/settings/user_details/connect";

View File

@ -422,8 +422,12 @@ class CompanyController extends BaseController
if($request->has('e_invoice_certificate') && !is_null($request->file("e_invoice_certificate"))){ if($request->has('e_invoice_certificate') && !is_null($request->file("e_invoice_certificate"))){
$company->e_invoice_certificate = base64_encode($request->file("e_invoice_certificate")->get()); $company->e_invoice_certificate = base64_encode($request->file("e_invoice_certificate")->get());
$company->save();
$settings = $company->settings;
$settings->enable_e_invoice = true;
$company->save();
} }
$this->uploadLogo($request->file('company_logo'), $company, $company); $this->uploadLogo($request->file('company_logo'), $company, $company);

View File

@ -748,33 +748,12 @@ class InvoiceController extends BaseController
break; break;
case 'email': case 'email':
//check query parameter for email_type and set the template else use calculateTemplate
// if (request()->has('email_type') && in_array(request()->input('email_type'), ['reminder1', 'reminder2', 'reminder3', 'reminder_endless', 'custom1', 'custom2', 'custom3'])) {
if (request()->has('email_type') && property_exists($invoice->company->settings, request()->input('email_type'))) {
$this->reminder_template = $invoice->client->getSetting(request()->input('email_type'));
} else {
$this->reminder_template = $invoice->calculateTemplate('invoice');
}
BulkInvoiceJob::dispatch($invoice, $this->reminder_template);
if (! $bulk) {
return response()->json(['message' => 'email sent'], 200);
}
break;
case 'send_email': case 'send_email':
//check query parameter for email_type and set the template else use calculateTemplate //check query parameter for email_type and set the template else use calculateTemplate
$template = request()->has('email_type') ? request()->input('email_type') : $invoice->calculateTemplate('invoice');
if (request()->has('email_type') && property_exists($invoice->company->settings, request()->input('email_type'))) { BulkInvoiceJob::dispatch($invoice, $template);
$this->reminder_template = $invoice->client->getSetting(request()->input('email_type'));
} else {
$this->reminder_template = $invoice->calculateTemplate('invoice');
}
BulkInvoiceJob::dispatch($invoice, $this->reminder_template);
if (! $bulk) { if (! $bulk) {
return response()->json(['message' => 'email sent'], 200); return response()->json(['message' => 'email sent'], 200);

View File

@ -11,10 +11,11 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Requests\TwoFactor\EnableTwoFactorRequest;
use App\Models\User; use App\Models\User;
use App\Transformers\UserTransformer; use App\Utils\Ninja;
use PragmaRX\Google2FA\Google2FA; use PragmaRX\Google2FA\Google2FA;
use App\Transformers\UserTransformer;
use App\Http\Requests\TwoFactor\EnableTwoFactorRequest;
class TwoFactorController extends BaseController class TwoFactorController extends BaseController
{ {
@ -24,11 +25,15 @@ class TwoFactorController extends BaseController
public function setupTwoFactor() public function setupTwoFactor()
{ {
/** @var \App\Models\User $user */
$user = auth()->user(); $user = auth()->user();
if ($user->google_2fa_secret) { if ($user->google_2fa_secret) {
return response()->json(['message' => '2FA already enabled'], 400); return response()->json(['message' => '2FA already enabled'], 400);
} elseif (! $user->phone) { } elseif(Ninja::isSelfHost()){
}
elseif (! $user->phone) {
return response()->json(['message' => ctrans('texts.set_phone_for_two_factor')], 400); return response()->json(['message' => ctrans('texts.set_phone_for_two_factor')], 400);
} elseif (! $user->isVerified()) { } elseif (! $user->isVerified()) {
return response()->json(['message' => 'Please confirm your account first'], 400); return response()->json(['message' => 'Please confirm your account first'], 400);

View File

@ -146,25 +146,30 @@ class PurchaseOrderController extends Controller
$purchase_orders = PurchaseOrder::query() $purchase_orders = PurchaseOrder::query()
->whereIn('id', $this->transformKeys($data['purchase_orders'])) ->whereIn('id', $this->transformKeys($data['purchase_orders']))
->where('company_id', auth()->guard('vendor')->user()->vendor->company_id) ->where('company_id', auth()->guard('vendor')->user()->vendor->company_id)
->whereIn('status_id', [PurchaseOrder::STATUS_DRAFT, PurchaseOrder::STATUS_SENT])
->where('is_deleted', 0) ->where('is_deleted', 0)
->withTrashed() ->withTrashed();
->cursor()->each(function ($purchase_order) {
$purchase_order->service()
->markSent()
->applyNumber()
->setStatus(PurchaseOrder::STATUS_ACCEPTED)
->save();
if (request()->has('signature') && ! is_null(request()->signature) && ! empty(request()->signature)) { $purchase_count_query = clone $purchase_orders;
InjectSignature::dispatch($purchase_order, request()->signature);
}
event(new PurchaseOrderWasAccepted($purchase_order, auth()->guard('vendor')->user(), $purchase_order->company, Ninja::eventVars())); $purchase_orders->whereIn('status_id', [PurchaseOrder::STATUS_DRAFT, PurchaseOrder::STATUS_SENT])
}); ->cursor()->each(function ($purchase_order) {
$purchase_order->service()
->markSent()
->applyNumber()
->setStatus(PurchaseOrder::STATUS_ACCEPTED)
->save();
if (count($data['purchase_orders']) == 1) { if (request()->has('signature') && ! is_null(request()->signature) && ! empty(request()->signature)) {
$purchase_order = PurchaseOrder::withTrashed()->where('is_deleted', 0)->whereIn('id', $this->transformKeys($data['purchase_orders']))->first(); (new InjectSignature($purchase_order, request()->signature))->handle();
// InjectSignature::dispatch($purchase_order, request()->signature);
}
event(new PurchaseOrderWasAccepted($purchase_order, auth()->guard('vendor')->user(), $purchase_order->company, Ninja::eventVars()));
});
if ($purchase_count_query->count() == 1) {
$purchase_order = $purchase_count_query->first();
return redirect()->route('vendor.purchase_order.show', ['purchase_order' => $purchase_order->hashed_id]); return redirect()->route('vendor.purchase_order.show', ['purchase_order' => $purchase_order->hashed_id]);
} else { } else {

View File

@ -23,6 +23,7 @@ use Turbo124\Beacon\Facades\LightLogs;
*/ */
class QueryLogging class QueryLogging
{ {
/** /**
* Handle an incoming request. * Handle an incoming request.
* *
@ -33,26 +34,30 @@ class QueryLogging
*/ */
public function handle(Request $request, Closure $next) public function handle(Request $request, Closure $next)
{ {
// Enable query logging for development // Enable query logging for development
if (! Ninja::isHosted() || ! config('beacon.enabled')) { if (! Ninja::isHosted() || ! config('beacon.enabled')) {
return $next($request); return $next($request);
} }
$timeStart = microtime(true);
DB::enableQueryLog(); DB::enableQueryLog();
return $next($request);
}
public function terminate($request, $response)
{
if (! Ninja::isHosted() || ! config('beacon.enabled'))
return;
$response = $next($request);
// hide requests made by debugbar // hide requests made by debugbar
if (strstr($request->url(), '_debugbar') === false) { if (strstr($request->url(), '_debugbar') === false) {
$queries = DB::getQueryLog(); $queries = DB::getQueryLog();
$count = count($queries); $count = count($queries);
$timeEnd = microtime(true); $timeEnd = microtime(true);
$time = $timeEnd - $timeStart; $time = $timeEnd - LARAVEL_START;
// nlog("Query count = {$count}");
// nlog($queries);
// nlog($request->url());
if ($count > 175) { if ($count > 175) {
nlog("Query count = {$count}"); nlog("Query count = {$count}");
nlog($queries); nlog($queries);
@ -60,18 +65,17 @@ class QueryLogging
$ip = ''; $ip = '';
if (request()->hasHeader('Cf-Connecting-Ip')) { if ($request->hasHeader('Cf-Connecting-Ip')) {
$ip = request()->header('Cf-Connecting-Ip'); $ip = $request->header('Cf-Connecting-Ip');
} elseif (request()->hasHeader('X-Forwarded-For')) { } elseif ($request->hasHeader('X-Forwarded-For')) {
$ip = request()->header('Cf-Connecting-Ip'); $ip = $request->header('Cf-Connecting-Ip');
} else { } else {
$ip = request()->ip(); $ip = $request->ip();
} }
LightLogs::create(new DbQuery($request->method(), substr(urldecode($request->url()), 0, 180), $count, $time, $ip)) LightLogs::create(new DbQuery($request->method(), substr(urldecode($request->url()), 0, 180), $count, $time, $ip))
->batch(); ->batch();
} }
return $response;
} }
} }

View File

@ -37,7 +37,9 @@ class UpdateCompanyRequest extends Request
*/ */
public function authorize() : bool public function authorize() : bool
{ {
return auth()->user()->can('edit', $this->company); /** @var \App\Models\User $user */
$user = auth()->user();
return $user->can('edit', $this->company);
} }
public function rules() public function rules()

View File

@ -24,7 +24,8 @@ class BulkInvoiceRequest extends Request
{ {
return [ return [
'action' => 'required|string', 'action' => 'required|string',
'ids' => 'required' 'ids' => 'required',
'email_type' => 'sometimes|in:reminder1,reminder2,reminder3,reminder_endless,custom1,custom2,custom3,invoice,quote,credit,payment,payment_partial,statement,purchase_order'
]; ];
} }
} }

View File

@ -216,7 +216,7 @@ class CreateEntityPdf implements ShouldQueue
(new CreateEInvoice($this->entity, true))->handle(); (new CreateEInvoice($this->entity, true))->handle();
} }
$this->invitation = null; $this->invitation = null;
$this->entity = null; // $this->entity = null;
$this->company = null; $this->company = null;
$this->client = null; $this->client = null;
$this->contact = null; $this->contact = null;

View File

@ -41,7 +41,6 @@ class CheckGatewayFee implements ShouldQueue
*/ */
public function handle() public function handle()
{ {
nlog("Checking Gateway Fees for Invoice Id = {$this->invoice_id}");
MultiDB::setDb($this->db); MultiDB::setDb($this->db);

View File

@ -3,6 +3,8 @@
namespace App\Jobs\Invoice; namespace App\Jobs\Invoice;
use App\Jobs\Entity\CreateEntityPdf; use App\Jobs\Entity\CreateEntityPdf;
use App\Jobs\Vendor\CreatePurchaseOrderPdf;
use App\Models\PurchaseOrder;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Foundation\Bus\Dispatchable;
@ -52,6 +54,11 @@ class InjectSignature implements ShouldQueue
$invitation->signature_base64 = $this->signature; $invitation->signature_base64 = $this->signature;
$invitation->save(); $invitation->save();
CreateEntityPdf::dispatch($invitation); $this->entity->refresh()->service()->touchPdf(true);
// if($this->entity instanceof PurchaseOrder)
// (new CreatePurchaseOrderPdf($invitation))->handle();
// else
// (new CreateEntityPdf($invitation))->handle();
} }
} }

View File

@ -71,21 +71,21 @@ class OAuth
public static function providerToString(int $social_provider): string public static function providerToString(int $social_provider): string
{ {
switch ($social_provider) { switch ($social_provider) {
case SOCIAL_GOOGLE: case self::SOCIAL_GOOGLE:
return 'google'; return 'google';
case SOCIAL_FACEBOOK: case self::SOCIAL_FACEBOOK:
return 'facebook'; return 'facebook';
case SOCIAL_GITHUB: case self::SOCIAL_GITHUB:
return 'github'; return 'github';
case SOCIAL_LINKEDIN: case self::SOCIAL_LINKEDIN:
return 'linkedin'; return 'linkedin';
case SOCIAL_TWITTER: case self::SOCIAL_TWITTER:
return 'twitter'; return 'twitter';
case SOCIAL_BITBUCKET: case self::SOCIAL_BITBUCKET:
return 'bitbucket'; return 'bitbucket';
case SOCIAL_MICROSOFT: case self::SOCIAL_MICROSOFT:
return 'microsoft'; return 'microsoft';
case SOCIAL_APPLE: case self::SOCIAL_APPLE:
return 'apple'; return 'apple';
} }
} }
@ -94,21 +94,21 @@ class OAuth
{ {
switch ($social_provider) { switch ($social_provider) {
case 'google': case 'google':
return SOCIAL_GOOGLE; return self::SOCIAL_GOOGLE;
case 'facebook': case 'facebook':
return SOCIAL_FACEBOOK; return self::SOCIAL_FACEBOOK;
case 'github': case 'github':
return SOCIAL_GITHUB; return self::SOCIAL_GITHUB;
case 'linkedin': case 'linkedin':
return SOCIAL_LINKEDIN; return self::SOCIAL_LINKEDIN;
case 'twitter': case 'twitter':
return SOCIAL_TWITTER; return self::SOCIAL_TWITTER;
case 'bitbucket': case 'bitbucket':
return SOCIAL_BITBUCKET; return self::SOCIAL_BITBUCKET;
case 'microsoft': case 'microsoft':
return SOCIAL_MICROSOFT; return self::SOCIAL_MICROSOFT;
case 'apple': case 'apple':
return SOCIAL_APPLE; return self::SOCIAL_APPLE;
} }
} }

View File

@ -11,15 +11,16 @@
namespace App\Mail\Engine; namespace App\Mail\Engine;
use App\DataMapper\EmailTemplateDefaults;
use App\Jobs\Entity\CreateRawPdf;
use App\Models\Account;
use App\Utils\Helpers;
use App\Utils\Ninja; use App\Utils\Ninja;
use App\Utils\Number; use App\Utils\Number;
use App\Utils\Helpers;
use App\Models\Account;
use App\Utils\Traits\MakesDates; use App\Utils\Traits\MakesDates;
use App\Jobs\Entity\CreateRawPdf;
use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\URL; use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\Storage;
use App\DataMapper\EmailTemplateDefaults;
class PaymentEmailEngine extends BaseEmailEngine class PaymentEmailEngine extends BaseEmailEngine
{ {
@ -105,6 +106,18 @@ class PaymentEmailEngine extends BaseEmailEngine
} }
} }
} }
if($this->client->getSetting('enable_e_invoice'))
{
$e_invoice_filepath = $invoice->service()->getEInvoice($this->contact);
if(Storage::disk(config('filesystems.default'))->exists($e_invoice_filepath)) {
$this->setAttachments([['path' => Storage::disk(config('filesystems.default'))->path($e_invoice_filepath), 'name' => $invoice->getFileName("xml"), 'mime' => null]]);
}
}
}); });
} }

View File

@ -251,6 +251,7 @@ class Client extends BaseModel implements HasLocalePreference
'number', 'number',
'routing_id', 'routing_id',
'is_tax_exempt', 'is_tax_exempt',
'has_valid_vat_number',
]; ];
protected $with = [ protected $with = [

View File

@ -91,6 +91,27 @@ class AuthorizeTransaction
$duplicateWindowSetting->setSettingName("duplicateWindow"); $duplicateWindowSetting->setSettingName("duplicateWindow");
$duplicateWindowSetting->setSettingValue("60"); $duplicateWindowSetting->setSettingValue("60");
$contact = $this->authorize->client->primary_contact()->first() ?: $this->authorize->client->contacts()->first();
if($contact) {
$billto = new \net\authorize\api\contract\v1\CustomerAddressType();
$billto->setFirstName(substr($contact->present()->first_name(), 0, 50));
$billto->setLastName(substr($contact->present()->last_name(), 0, 50));
$billto->setCompany(substr($this->authorize->client->present()->name(), 0, 50));
$billto->setAddress(substr($this->authorize->client->address1, 0, 60));
$billto->setCity(substr($this->authorize->client->city, 0, 40));
$billto->setState(substr($this->authorize->client->state, 0, 40));
$billto->setZip(substr($this->authorize->client->postal_code, 0, 20));
if ($this->authorize->client->country_id) {
$billto->setCountry($this->authorize->client->country->name);
}
$billto->setPhoneNumber(substr($this->authorize->client->phone, 0, 20));
}
//Assign to the transactionRequest field
$transactionRequestType = new TransactionRequestType(); $transactionRequestType = new TransactionRequestType();
$transactionRequestType->setTransactionType('authCaptureTransaction'); $transactionRequestType->setTransactionType('authCaptureTransaction');
$transactionRequestType->setAmount($amount); $transactionRequestType->setAmount($amount);
@ -100,9 +121,11 @@ class AuthorizeTransaction
$transactionRequestType->addToTransactionSettings($duplicateWindowSetting); $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);
$transactionRequestType->setPayment($paymentOne); $transactionRequestType->setPayment($paymentOne);
// $transactionRequestType->setProfile($profileToCharge);
$transactionRequestType->setCurrencyCode($this->authorize->client->currency()->code); $transactionRequestType->setCurrencyCode($this->authorize->client->currency()->code);
if($billto)
$transactionRequestType->setBillTo($billto);
$request = new CreateTransactionRequest(); $request = new CreateTransactionRequest();
$request->setMerchantAuthentication($this->authorize->merchant_authentication); $request->setMerchantAuthentication($this->authorize->merchant_authentication);
$request->setRefId($refId); $request->setRefId($refId);

View File

@ -728,12 +728,14 @@ class BaseDriver extends AbstractPaymentDriver
App::setLocale($this->client->company->locale()); App::setLocale($this->client->company->locale());
if (! $this->payment_hash || !$this->client) if (! $this->payment_hash || !$this->client)
return 'x'; return 'Descriptor';
$invoices_string = \implode(', ', collect($this->payment_hash->invoices())->pluck('invoice_number')->toArray()) ?: null; $invoices_string = \implode(', ', collect($this->payment_hash->invoices())->pluck('invoice_number')->toArray()) ?: null;
$invoices_string = str_replace(["*","<",">","'",'"'], "-", $invoices_string); $invoices_string = str_replace(["*","<",">","'",'"'], "-", $invoices_string);
$invoices_string = "I-".$invoices_string;
$invoices_string = substr($invoices_string,0,22); $invoices_string = substr($invoices_string,0,22);
$invoices_string = str_pad($invoices_string, 5, ctrans('texts.invoice'), STR_PAD_LEFT); $invoices_string = str_pad($invoices_string, 5, ctrans('texts.invoice'), STR_PAD_LEFT);

View File

@ -36,7 +36,9 @@ class EmailStatementService
//Email only the selected clients //Email only the selected clients
if (count($this->scheduler->parameters['clients']) >= 1) { if (count($this->scheduler->parameters['clients']) >= 1) {
$query->whereIn('id', $this->transformKeys($this->scheduler->parameters['clients']))->where('balance', '>', 0); $query->whereIn('id', $this->transformKeys($this->scheduler->parameters['clients']));
}else {
$query->where('balance', '>', 0);
} }
$query->cursor() $query->cursor()

View File

@ -15,8 +15,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.5.122', 'app_version' => '5.5.123',
'app_tag' => '5.5.122', 'app_tag' => '5.5.123',
'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', ''),

View File

@ -386,11 +386,6 @@ $LANG = array(
'invoice_issued_to' => 'Invoice issued to', 'invoice_issued_to' => 'Invoice issued to',
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix', 'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
'mark_sent' => 'Mark Sent', 'mark_sent' => 'Mark Sent',
'gateway_help_1' => ':link to sign up for Authorize.net.',
'gateway_help_2' => ':link to sign up for Authorize.net.',
'gateway_help_17' => ':link to get your PayPal API signature.',
'gateway_help_27' => ':link to sign up for 2Checkout.com. To ensure payments are tracked set :complete_link as the redirect URL under Account > Site Management in the 2Checkout portal.',
'gateway_help_60' => ':link to create a WePay account.',
'more_designs' => 'More designs', 'more_designs' => 'More designs',
'more_designs_title' => 'Additional Invoice Designs', 'more_designs_title' => 'Additional Invoice Designs',
'more_designs_cloud_header' => 'Go Pro for more invoice designs', 'more_designs_cloud_header' => 'Go Pro for more invoice designs',
@ -505,7 +500,6 @@ $LANG = array(
'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.', 'notification_quote_approved' => 'The following client :client approved Quote :invoice for :amount.',
'resend_confirmation' => 'Resend confirmation email', 'resend_confirmation' => 'Resend confirmation email',
'confirmation_resent' => 'The confirmation email was resent', 'confirmation_resent' => 'The confirmation email was resent',
'gateway_help_42' => ':link to sign up for BitPay.<br/>Note: use a Legacy API Key, not an API token.',
'payment_type_credit_card' => 'Credit Card', 'payment_type_credit_card' => 'Credit Card',
'payment_type_paypal' => 'PayPal', 'payment_type_paypal' => 'PayPal',
'payment_type_bitcoin' => 'Bitcoin', 'payment_type_bitcoin' => 'Bitcoin',
@ -590,7 +584,6 @@ $LANG = array(
'prefix' => 'Prefix', 'prefix' => 'Prefix',
'counter' => 'Counter', 'counter' => 'Counter',
'payment_type_dwolla' => 'Dwolla', 'payment_type_dwolla' => 'Dwolla',
'gateway_help_43' => ':link to sign up for Dwolla',
'partial_value' => 'Must be greater than zero and less than the total', 'partial_value' => 'Must be greater than zero and less than the total',
'more_actions' => 'More Actions', 'more_actions' => 'More Actions',
'pro_plan_title' => 'NINJA PRO', 'pro_plan_title' => 'NINJA PRO',
@ -1096,8 +1089,6 @@ $LANG = array(
'user_create_all' => 'Create clients, invoices, etc.', 'user_create_all' => 'Create clients, invoices, etc.',
'user_view_all' => 'View all clients, invoices, etc.', 'user_view_all' => 'View all clients, invoices, etc.',
'user_edit_all' => 'Edit all clients, invoices, etc.', 'user_edit_all' => 'Edit all clients, invoices, etc.',
'gateway_help_20' => ':link to sign up for Sage Pay.',
'gateway_help_21' => ':link to sign up for Sage Pay.',
'partial_due' => 'Partial Due', 'partial_due' => 'Partial Due',
'restore_vendor' => 'Restore Vendor', 'restore_vendor' => 'Restore Vendor',
'restored_vendor' => 'Successfully restored vendor', 'restored_vendor' => 'Successfully restored vendor',
@ -2281,7 +2272,6 @@ $LANG = array(
'product_notes' => 'Product Notes', 'product_notes' => 'Product Notes',
'app_version' => 'App Version', 'app_version' => 'App Version',
'ofx_version' => 'OFX Version', 'ofx_version' => 'OFX Version',
'gateway_help_23' => ':link to get your Stripe API keys.',
'error_app_key_set_to_default' => 'Error: APP_KEY is set to a default value, to update it backup your database and then run <code>php artisan ninja:update-key</code>', 'error_app_key_set_to_default' => 'Error: APP_KEY is set to a default value, to update it backup your database and then run <code>php artisan ninja:update-key</code>',
'charge_late_fee' => 'Charge Late Fee', 'charge_late_fee' => 'Charge Late Fee',
'late_fee_amount' => 'Late Fee Amount', 'late_fee_amount' => 'Late Fee Amount',
@ -2521,7 +2511,6 @@ $LANG = array(
'videos' => 'Videos', 'videos' => 'Videos',
'video' => 'Video', 'video' => 'Video',
'return_to_invoice' => 'Return to Invoice', 'return_to_invoice' => 'Return to Invoice',
'gateway_help_13' => 'To use ITN leave the PDT Key field blank.',
'partial_due_date' => 'Partial Due Date', 'partial_due_date' => 'Partial Due Date',
'task_fields' => 'Task Fields', 'task_fields' => 'Task Fields',
'product_fields_help' => 'Drag and drop fields to change their order', 'product_fields_help' => 'Drag and drop fields to change their order',
@ -4677,7 +4666,6 @@ $LANG = array(
'vat' => 'VAT', 'vat' => 'VAT',
'view_map' => 'View Map', 'view_map' => 'View Map',
'set_default_design' => 'Set Default Design', 'set_default_design' => 'Set Default Design',
'add_gateway_help_message' => 'Add a payment gateway (ie. Stripe, WePay or PayPal) to accept online payments',
'purchase_order_issued_to' => 'Purchase Order issued to', 'purchase_order_issued_to' => 'Purchase Order issued to',
'archive_task_status' => 'Archive Task Status', 'archive_task_status' => 'Archive Task Status',
'delete_task_status' => 'Delete Task Status', 'delete_task_status' => 'Delete Task Status',
@ -5095,6 +5083,18 @@ $LANG = array(
'total_invoices_outstanding' => 'Total Invoices Outstanding', 'total_invoices_outstanding' => 'Total Invoices Outstanding',
'recent_activity' => 'Recent Activity', 'recent_activity' => 'Recent Activity',
'enable_auto_bill' => 'Enable auto billing', 'enable_auto_bill' => 'Enable auto billing',
'email_count_invoices' => 'Email :count invoices',
'invoice_task_item_description' => 'Invoice Task Item Description',
'invoice_task_item_description_help' => 'Add the item description to the invoice line items',
'next_send_time' => 'Next Send Time',
'uploaded_certificate' => 'Successfully uploaded certificate',
'certificate_set' => 'Certificate set',
'certificate_not_set' => 'Certificate not set',
'passphrase_set' => 'Passphrase set',
'passphrase_not_set' => 'Passphrase not set',
'upload_certificate' => 'Upload Certificate',
'certificate_passphrase' => 'Certificate Passphrase',
'valid_vat_number' => 'Valid VAT Number',
); );

View File

@ -5078,9 +5078,18 @@ Lorsque les montant apparaîtront sur votre relevé, veuillez revenir sur cette
'e_invoice' => 'Facture électronique', 'e_invoice' => 'Facture électronique',
'light_dark_mode' => 'Mode clair/sombre', 'light_dark_mode' => 'Mode clair/sombre',
'activities' => 'Activités', 'activities' => 'Activités',
'recent_transactions' => "Voici les transations les plus récentes de votre entreprise:",
'country_Palestine' => "Palestine",
'country_Taiwan' => 'Taiwan',
'duties' => 'Droits',
'order_number' => 'Numéro de commande',
'order_id' => 'Commande',
'total_invoices_outstanding' => 'Total des factures impayées',
'recent_activity' => 'Activité récente',
'enable_auto_bill' => 'Activer l\'autofacturation',
); );
return $LANG; return $LANG;
?> ?>

190902
public/css/app.css vendored

File diff suppressed because one or more lines are too long

3632
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,112 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see action-selectors.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,u=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){l=!0,c=e},f:function(){try{u||null==r.return||r.return()}finally{if(l)throw c}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.key,c=void 0,c=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(c)?c:String(c)),o)}var i,c}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var n,o,i;return n=e,o=[{key:"watchCheckboxes",value:function(e){var t=this;document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),document.querySelectorAll(".form-check-child").forEach((function(n){e.checked?(n.checked=e.checked,t.processChildItem(n,document.getElementById("bulkActions"))):(n.checked=!1,document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})))}))}},{key:"processChildItem",value:function(e,n){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),!1!==e.checked){var r=document.createElement("INPUT");r.setAttribute("name","invoices[]"),r.setAttribute("value",e.dataset.value),r.setAttribute("class","child-hidden-input"),r.hidden=!0,n.append(r)}else{var o,i=t(document.querySelectorAll("input.child-hidden-input"));try{for(i.s();!(o=i.n()).done;){var c=o.value;c.value==e.dataset.value&&c.remove()}}catch(e){i.e(e)}finally{i.f()}}}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var n,r=t(document.querySelectorAll(".form-check-child"));try{var o=function(){var t=n.value;t.addEventListener("click",(function(){e.processChildItem(t,e.parentForm)}))};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}}}],o&&r(n.prototype,o),i&&r(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!***********************************************************!*\
!*** ./resources/js/clients/invoices/action-selectors.js ***!
\***********************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ActionSelectors = /*#__PURE__*/function () {
function ActionSelectors() {
_classCallCheck(this, ActionSelectors);
this.parentElement = document.querySelector('.form-check-parent');
this.parentForm = document.getElementById('bulkActions');
}
_createClass(ActionSelectors, [{
key: "watchCheckboxes",
value: function watchCheckboxes(parentElement) {
var _this = this;
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
return element.remove();
});
document.querySelectorAll('.form-check-child').forEach(function (child) {
if (parentElement.checked) {
child.checked = parentElement.checked;
_this.processChildItem(child, document.getElementById('bulkActions'));
} else {
child.checked = false;
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
return element.remove();
});
}
});
}
}, {
key: "processChildItem",
value: function processChildItem(element, parent) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (options.hasOwnProperty('single')) {
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
return element.remove();
});
}
if (element.checked === false) {
var inputs = document.querySelectorAll('input.child-hidden-input');
var _iterator = _createForOfIteratorHelper(inputs),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var i = _step.value;
if (i.value == element.dataset.value) i.remove();
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return;
}
var _temp = document.createElement('INPUT');
_temp.setAttribute('name', 'invoices[]');
_temp.setAttribute('value', element.dataset.value);
_temp.setAttribute('class', 'child-hidden-input');
_temp.hidden = true;
parent.append(_temp);
}
}, {
key: "handle",
value: function handle() {
var _this2 = this;
this.parentElement.addEventListener('click', function () {
_this2.watchCheckboxes(_this2.parentElement);
});
var _iterator2 = _createForOfIteratorHelper(document.querySelectorAll('.form-check-child')),
_step2;
try {
var _loop = function _loop() {
var child = _step2.value;
child.addEventListener('click', function () {
_this2.processChildItem(child, _this2.parentForm);
});
};
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
_loop();
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
}]);
return ActionSelectors;
}();
/** @handle **/
new ActionSelectors().handle();
/******/ })()
;

View File

@ -1,110 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see payment.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var i=0;i<n.length;i++){var a=n[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,(o=a.key,r=void 0,r=function(t,n){if("object"!==e(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var a=i.call(t,n||"default");if("object"!==e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(o,"string"),"symbol"===e(r)?r:String(r)),a)}var o,r}var n=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shouldDisplayTerms=t,this.shouldDisplaySignature=n,this.termsAccepted=!1,this.submitting=!1}var n,i,a;return n=e,(i=[{key:"handleMethodSelect",value:function(e){var t=this;document.getElementById("company_gateway_id").value=e.dataset.companyGatewayId,document.getElementById("payment_method_id").value=e.dataset.gatewayTypeId,this.shouldDisplaySignature&&!this.shouldDisplayTerms&&(this.signaturePad&&this.signaturePad.isEmpty()&&alert("Please sign"),this.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){t.termsAccepted=!0,t.submitForm()}))),!this.shouldDisplaySignature&&this.shouldDisplayTerms&&(this.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=t.signaturePad.toDataURL(),t.submitForm()}))),this.shouldDisplaySignature&&this.shouldDisplayTerms&&(this.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){t.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=t.signaturePad.toDataURL(),t.termsAccepted=!0,t.submitForm()}))}))),this.shouldDisplaySignature||this.shouldDisplayTerms||this.submitForm()}},{key:"submitForm",value:function(){this.submitting=!0,document.getElementById("payment-form").submit()}},{key:"displayTerms",value:function(){document.getElementById("displayTermsModal").removeAttribute("style")}},{key:"displaySignature",value:function(){document.getElementById("displaySignatureModal").removeAttribute("style");var e=new SignaturePad(document.getElementById("signature-pad"),{penColor:"rgb(0, 0, 0)"});e.onEnd=function(){document.getElementById("signature-next-step").disabled=!1},this.signaturePad=e}},{key:"handle",value:function(){var e=this;document.getElementById("signature-next-step").disabled=!0,document.querySelectorAll(".dropdown-gateway-button").forEach((function(t){t.addEventListener("click",(function(){e.submitting||e.handleMethodSelect(t)}))}))}}])&&t(n.prototype,i),a&&t(n,a),Object.defineProperty(n,"prototype",{writable:!1}),e}(),i=document.querySelector('meta[name="require-invoice-signature"]').content,a=document.querySelector('meta[name="show-invoice-terms"]').content;new n(Boolean(+i),Boolean(+a)).handle()})();
/*!**************************************************!*\
!*** ./resources/js/clients/invoices/payment.js ***!
\**************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var Payment = /*#__PURE__*/function () {
function Payment(displayTerms, displaySignature) {
_classCallCheck(this, Payment);
this.shouldDisplayTerms = displayTerms;
this.shouldDisplaySignature = displaySignature;
this.termsAccepted = false;
this.submitting = false;
}
_createClass(Payment, [{
key: "handleMethodSelect",
value: function handleMethodSelect(element) {
var _this = this;
document.getElementById("company_gateway_id").value = element.dataset.companyGatewayId;
document.getElementById("payment_method_id").value = element.dataset.gatewayTypeId;
if (this.shouldDisplaySignature && !this.shouldDisplayTerms) {
if (this.signaturePad && this.signaturePad.isEmpty()) alert("Please sign");
this.displayTerms();
document.getElementById("accept-terms-button").addEventListener("click", function () {
_this.termsAccepted = true;
_this.submitForm();
});
}
if (!this.shouldDisplaySignature && this.shouldDisplayTerms) {
this.displaySignature();
document.getElementById("signature-next-step").addEventListener("click", function () {
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
_this.submitForm();
});
}
if (this.shouldDisplaySignature && this.shouldDisplayTerms) {
this.displaySignature();
document.getElementById("signature-next-step").addEventListener("click", function () {
_this.displayTerms();
document.getElementById("accept-terms-button").addEventListener("click", function () {
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
_this.termsAccepted = true;
_this.submitForm();
});
});
}
if (!this.shouldDisplaySignature && !this.shouldDisplayTerms) {
this.submitForm();
}
}
}, {
key: "submitForm",
value: function submitForm() {
this.submitting = true;
document.getElementById("payment-form").submit();
}
}, {
key: "displayTerms",
value: function displayTerms() {
var displayTermsModal = document.getElementById("displayTermsModal");
displayTermsModal.removeAttribute("style");
}
}, {
key: "displaySignature",
value: function displaySignature() {
var displaySignatureModal = document.getElementById("displaySignatureModal");
displaySignatureModal.removeAttribute("style");
var signaturePad = new SignaturePad(document.getElementById("signature-pad"), {
penColor: "rgb(0, 0, 0)"
});
signaturePad.onEnd = function () {
document.getElementById("signature-next-step").disabled = false;
};
this.signaturePad = signaturePad;
}
}, {
key: "handle",
value: function handle() {
var _this2 = this;
document.getElementById("signature-next-step").disabled = true;
document.querySelectorAll(".dropdown-gateway-button").forEach(function (element) {
element.addEventListener("click", function () {
if (!_this2.submitting) {
_this2.handleMethodSelect(element);
}
});
});
}
}]);
return Payment;
}();
var signature = document.querySelector('meta[name="require-invoice-signature"]').content;
var terms = document.querySelector('meta[name="show-invoice-terms"]').content;
new Payment(Boolean(+signature), Boolean(+terms)).handle();
/******/ })()
;

View File

@ -1,376 +1 @@
/******/ (() => { // webpackBootstrap (()=>{var e,t={2623:(e,t,r)=>{"use strict";e.exports=r(4666)},1886:(e,t)=>{"use strict";const r=e=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),n=e=>e.replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&#0?39;/g,"'").replace(/&quot;/g,'"').replace(/&amp;/g,"&");t.T=(e,...t)=>{if("string"==typeof e)return r(e);let n=e[0];for(const[o,a]of t.entries())n=n+r(String(a))+e[o+1];return n}},2395:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var n=r(1886);var o=r(2623);const a=e=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;");const i=new Set(o);function c({name:e="div",attributes:t={},html:r="",text:o}={}){if(r&&o)throw new Error("The `html` and `text` options are mutually exclusive");const c=o?function(e,...t){if("string"==typeof e)return a(e);let r=e[0];for(const[n,o]of t.entries())r=r+a(String(o))+e[n+1];return r}(o):r;let l=`<${e}${function(e){const t=[];for(let[r,o]of Object.entries(e)){if(!1===o)continue;Array.isArray(o)&&(o=o.join(" "));let e=(0,n.T)(r);!0!==o&&(e+=`="${(0,n.T)(String(o))}"`),t.push(e)}return t.length>0?" "+t.join(" "):""}(t)}>`;return i.has(e)||(l+=`${c}</${e}>`),l}const l=(e,t)=>c({name:"a",attributes:{href:"",...t.attributes,href:e},text:void 0===t.value?e:void 0,html:void 0===t.value?void 0:"function"==typeof t.value?t.value(e):t.value}),s=(e,t)=>e.replace(/((?<!\+)https?:\/\/(?:www\.)?(?:[-\w.]+?[.@][a-zA-Z\d]{2,}|localhost)(?:[-\w.:%+~#*$!?&/=@]*?(?:,(?!\s))*?)*)/g,(e=>l(e,t))),u=(e,t)=>{const r=document.createDocumentFragment();for(const[o,a]of Object.entries(e.split(/((?<!\+)https?:\/\/(?:www\.)?(?:[-\w.]+?[.@][a-zA-Z\d]{2,}|localhost)(?:[-\w.:%+~#*$!?&/=@]*?(?:,(?!\s))*?)*)/g)))o%2?r.append((n=l(a,t),document.createRange().createContextualFragment(n))):a.length>0&&r.append(a);var n;return r};function p(e,t){if("string"===(t={attributes:{},type:"string",...t}).type)return s(e,t);if("dom"===t.type)return u(e,t);throw new TypeError("The type option must be either `dom` or `string`")}},4666:e=>{"use strict";e.exports=JSON.parse('["area","base","br","col","embed","hr","img","input","link","menuitem","meta","param","source","track","wbr"]')}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,n),a.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e=n(2395),document.querySelectorAll("[data-ref=entity-terms]").forEach((function(t){"function"===e&&(t.innerHTML=e(t.innerText,{attributes:{target:"_blank",class:"text-primary"}}))}))})();
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/html-tags/void.js":
/*!****************************************!*\
!*** ./node_modules/html-tags/void.js ***!
\****************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
"use strict";
module.exports = __webpack_require__(/*! ./html-tags-void.json */ "./node_modules/html-tags/html-tags-void.json");
/***/ }),
/***/ "./node_modules/stringify-attributes/node_modules/escape-goat/index.js":
/*!*****************************************************************************!*\
!*** ./node_modules/stringify-attributes/node_modules/escape-goat/index.js ***!
\*****************************************************************************/
/***/ ((__unused_webpack_module, exports) => {
"use strict";
const htmlEscape = string => string
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
const htmlUnescape = htmlString => htmlString
.replace(/&gt;/g, '>')
.replace(/&lt;/g, '<')
.replace(/&#0?39;/g, '\'')
.replace(/&quot;/g, '"')
.replace(/&amp;/g, '&');
exports.htmlEscape = (strings, ...values) => {
if (typeof strings === 'string') {
return htmlEscape(strings);
}
let output = strings[0];
for (const [index, value] of values.entries()) {
output = output + htmlEscape(String(value)) + strings[index + 1];
}
return output;
};
exports.htmlUnescape = (strings, ...values) => {
if (typeof strings === 'string') {
return htmlUnescape(strings);
}
let output = strings[0];
for (const [index, value] of values.entries()) {
output = output + htmlUnescape(String(value)) + strings[index + 1];
}
return output;
};
/***/ }),
/***/ "./node_modules/create-html-element/index.js":
/*!***************************************************!*\
!*** ./node_modules/create-html-element/index.js ***!
\***************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ createHtmlElement)
/* harmony export */ });
/* harmony import */ var stringify_attributes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stringify-attributes */ "./node_modules/stringify-attributes/index.js");
/* harmony import */ var html_tags_void_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! html-tags/void.js */ "./node_modules/html-tags/void.js");
/* harmony import */ var escape_goat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! escape-goat */ "./node_modules/escape-goat/index.js");
const voidHtmlTags = new Set(html_tags_void_js__WEBPACK_IMPORTED_MODULE_1__);
function createHtmlElement(
{
name = 'div',
attributes = {},
html = '',
text,
} = {},
) {
if (html && text) {
throw new Error('The `html` and `text` options are mutually exclusive');
}
const content = text ? (0,escape_goat__WEBPACK_IMPORTED_MODULE_2__.htmlEscape)(text) : html;
let result = `<${name}${(0,stringify_attributes__WEBPACK_IMPORTED_MODULE_0__["default"])(attributes)}>`;
if (!voidHtmlTags.has(name)) {
result += `${content}</${name}>`;
}
return result;
}
/***/ }),
/***/ "./node_modules/escape-goat/index.js":
/*!*******************************************!*\
!*** ./node_modules/escape-goat/index.js ***!
\*******************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "htmlEscape": () => (/* binding */ htmlEscape),
/* harmony export */ "htmlUnescape": () => (/* binding */ htmlUnescape)
/* harmony export */ });
const _htmlEscape = string => string
.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
const _htmlUnescape = htmlString => htmlString
.replace(/&gt;/g, '>')
.replace(/&lt;/g, '<')
.replace(/&#0?39;/g, '\'')
.replace(/&quot;/g, '"')
.replace(/&amp;/g, '&');
function htmlEscape(strings, ...values) {
if (typeof strings === 'string') {
return _htmlEscape(strings);
}
let output = strings[0];
for (const [index, value] of values.entries()) {
output = output + _htmlEscape(String(value)) + strings[index + 1];
}
return output;
}
function htmlUnescape(strings, ...values) {
if (typeof strings === 'string') {
return _htmlUnescape(strings);
}
let output = strings[0];
for (const [index, value] of values.entries()) {
output = output + _htmlUnescape(String(value)) + strings[index + 1];
}
return output;
}
/***/ }),
/***/ "./node_modules/linkify-urls/index.js":
/*!********************************************!*\
!*** ./node_modules/linkify-urls/index.js ***!
\********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ linkifyUrls)
/* harmony export */ });
/* harmony import */ var create_html_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! create-html-element */ "./node_modules/create-html-element/index.js");
// Capture the whole URL in group 1 to keep `String#split()` support
const urlRegex = () => (/((?<!\+)https?:\/\/(?:www\.)?(?:[-\w.]+?[.@][a-zA-Z\d]{2,}|localhost)(?:[-\w.:%+~#*$!?&/=@]*?(?:,(?!\s))*?)*)/g);
// Get `<a>` element as string
const linkify = (href, options) => (0,create_html_element__WEBPACK_IMPORTED_MODULE_0__["default"])({
name: 'a',
attributes: {
href: '',
...options.attributes,
href, // eslint-disable-line no-dupe-keys
},
text: typeof options.value === 'undefined' ? href : undefined,
html: typeof options.value === 'undefined' ? undefined
: (typeof options.value === 'function' ? options.value(href) : options.value),
});
// Get DOM node from HTML
const domify = html => document.createRange().createContextualFragment(html);
const getAsString = (string, options) => string.replace(urlRegex(), match => linkify(match, options));
const getAsDocumentFragment = (string, options) => {
const fragment = document.createDocumentFragment();
for (const [index, text] of Object.entries(string.split(urlRegex()))) {
if (index % 2) { // URLs are always in odd positions
fragment.append(domify(linkify(text, options)));
} else if (text.length > 0) {
fragment.append(text);
}
}
return fragment;
};
function linkifyUrls(string, options) {
options = {
attributes: {},
type: 'string',
...options,
};
if (options.type === 'string') {
return getAsString(string, options);
}
if (options.type === 'dom') {
return getAsDocumentFragment(string, options);
}
throw new TypeError('The type option must be either `dom` or `string`');
}
/***/ }),
/***/ "./node_modules/stringify-attributes/index.js":
/*!****************************************************!*\
!*** ./node_modules/stringify-attributes/index.js ***!
\****************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (/* binding */ stringifyAttributes)
/* harmony export */ });
/* harmony import */ var escape_goat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! escape-goat */ "./node_modules/stringify-attributes/node_modules/escape-goat/index.js");
function stringifyAttributes(attributes) {
const handledAttributes = [];
for (let [key, value] of Object.entries(attributes)) {
if (value === false) {
continue;
}
if (Array.isArray(value)) {
value = value.join(' ');
}
let attribute = (0,escape_goat__WEBPACK_IMPORTED_MODULE_0__.htmlEscape)(key);
if (value !== true) {
attribute += `="${(0,escape_goat__WEBPACK_IMPORTED_MODULE_0__.htmlEscape)(String(value))}"`;
}
handledAttributes.push(attribute);
}
return handledAttributes.length > 0 ? ' ' + handledAttributes.join(' ') : '';
}
/***/ }),
/***/ "./node_modules/html-tags/html-tags-void.json":
/*!****************************************************!*\
!*** ./node_modules/html-tags/html-tags-void.json ***!
\****************************************************/
/***/ ((module) => {
"use strict";
module.exports = JSON.parse('["area","base","br","col","embed","hr","img","input","link","menuitem","meta","param","source","track","wbr"]');
/***/ })
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ var __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __webpack_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */
/******/ (() => {
/******/ // define __esModule on exports
/******/ __webpack_require__.r = (exports) => {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
/*!**********************************************!*\
!*** ./resources/js/clients/linkify-urls.js ***!
\**********************************************/
/**
* 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
*/
var linkifyUrls = __webpack_require__(/*! linkify-urls */ "./node_modules/linkify-urls/index.js");
document.querySelectorAll('[data-ref=entity-terms]').forEach(function (text) {
if (linkifyUrls === 'function') {
text.innerHTML = linkifyUrls(text.innerText, {
attributes: {
target: '_blank',
"class": 'text-primary'
}
});
}
});
})();
/******/ })()
;

View File

@ -1,87 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see authorize-authorize-card.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,(o=a.key,d=void 0,d=function(t,r){if("object"!==e(t)||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var a=n.call(t,r||"default");if("object"!==e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}(o,"string"),"symbol"===e(d)?d:String(d)),a)}var o,d}var r=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.publicKey=t,this.loginId=r,this.cardHolderName=document.getElementById("cardholder_name"),this.cardButton=document.getElementById("card_button")}var r,n,a;return r=e,(n=[{key:"handleAuthorization",value:function(){var e=$("#my-card"),t={};t.clientKey=this.publicKey,t.apiLoginID=this.loginId;var r={};r.cardNumber=e.CardJs("cardNumber").replace(/[^\d]/g,""),r.month=e.CardJs("expiryMonth").replace(/[^\d]/g,""),r.year=e.CardJs("expiryYear").replace(/[^\d]/g,""),r.cardCode=document.getElementById("cvv").value.replace(/[^\d]/g,"");var n={};return n.authData=t,n.cardData=r,document.getElementById("card_button").disabled=!0,document.querySelector("#card_button > svg").classList.remove("hidden"),document.querySelector("#card_button > span").classList.add("hidden"),Accept.dispatchData(n,this.responseHandler),!1}},{key:"responseHandler",value:function(e){return"Error"===e.messages.resultCode?($("#errors").show().html("<p>"+e.messages.message[0].code+": "+e.messages.message[0].text+"</p>"),document.getElementById("card_button").disabled=!1,document.querySelector("#card_button > svg").classList.add("hidden"),document.querySelector("#card_button > span").classList.remove("hidden")):"Ok"===e.messages.resultCode&&(document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue,document.getElementById("server_response").submit()),!1}},{key:"handle",value:function(){var e=this;return this.cardButton.addEventListener("click",(function(){e.cardButton.disabled=!e.cardButton.disabled,e.handleAuthorization()})),this}}])&&t(r.prototype,n),a&&t(r,a),Object.defineProperty(r,"prototype",{writable:!1}),e}();new r(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()})();
/*!**************************************************************************!*\
!*** ./resources/js/clients/payment_methods/authorize-authorize-card.js ***!
\**************************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var AuthorizeAuthorizeCard = /*#__PURE__*/function () {
function AuthorizeAuthorizeCard(publicKey, loginId) {
_classCallCheck(this, AuthorizeAuthorizeCard);
this.publicKey = publicKey;
this.loginId = loginId;
this.cardHolderName = document.getElementById("cardholder_name");
this.cardButton = document.getElementById("card_button");
}
_createClass(AuthorizeAuthorizeCard, [{
key: "handleAuthorization",
value: function handleAuthorization() {
var myCard = $('#my-card');
var authData = {};
authData.clientKey = this.publicKey;
authData.apiLoginID = this.loginId;
var cardData = {};
cardData.cardNumber = myCard.CardJs('cardNumber').replace(/[^\d]/g, '');
cardData.month = myCard.CardJs('expiryMonth').replace(/[^\d]/g, '');
cardData.year = myCard.CardJs('expiryYear').replace(/[^\d]/g, '');
cardData.cardCode = document.getElementById("cvv").value.replace(/[^\d]/g, '');
;
var secureData = {};
secureData.authData = authData;
secureData.cardData = cardData;
document.getElementById('card_button').disabled = true;
document.querySelector('#card_button > svg').classList.remove('hidden');
document.querySelector('#card_button > span').classList.add('hidden');
Accept.dispatchData(secureData, this.responseHandler);
return false;
}
}, {
key: "responseHandler",
value: function responseHandler(response) {
if (response.messages.resultCode === "Error") {
var i = 0;
var $errors = $('#errors'); // get the reference of the div
$errors.show().html("<p>" + response.messages.message[i].code + ": " + response.messages.message[i].text + "</p>");
document.getElementById('card_button').disabled = false;
document.querySelector('#card_button > svg').classList.add('hidden');
document.querySelector('#card_button > span').classList.remove('hidden');
} else if (response.messages.resultCode === "Ok") {
document.getElementById("dataDescriptor").value = response.opaqueData.dataDescriptor;
document.getElementById("dataValue").value = response.opaqueData.dataValue;
document.getElementById("server_response").submit();
}
return false;
}
}, {
key: "handle",
value: function handle() {
var _this = this;
this.cardButton.addEventListener("click", function () {
_this.cardButton.disabled = !_this.cardButton.disabled;
_this.handleAuthorization();
});
return this;
}
}]);
return AuthorizeAuthorizeCard;
}();
var publicKey = document.querySelector('meta[name="authorize-public-key"]').content;
var loginId = document.querySelector('meta[name="authorize-login-id"]').content;
/** @handle */
new AuthorizeAuthorizeCard(publicKey, loginId).handle();
/******/ })()
;

View File

@ -1,54 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see authorize-checkout-card.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.key,a=void 0,a=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(a)?a:String(a)),o)}var i,a}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.button=document.querySelector("#pay-button")}var n,r,o;return n=e,(r=[{key:"init",value:function(){this.frames=Frames.init(document.querySelector("meta[name=public-key]").content)}},{key:"handle",value:function(){var e=this;this.init(),Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED,(function(t){e.button.disabled=!Frames.isCardValid()})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZED,(function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e),document.getElementById("server_response").submit()})),document.querySelector("#authorization-form").addEventListener("submit",(function(t){e.button.disabled=!0,t.preventDefault(),Frames.submitCard()}))}}])&&t(n.prototype,r),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!*************************************************************************!*\
!*** ./resources/js/clients/payment_methods/authorize-checkout-card.js ***!
\*************************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var CheckoutCreditCardAuthorization = /*#__PURE__*/function () {
function CheckoutCreditCardAuthorization() {
_classCallCheck(this, CheckoutCreditCardAuthorization);
this.button = document.querySelector('#pay-button');
}
_createClass(CheckoutCreditCardAuthorization, [{
key: "init",
value: function init() {
this.frames = Frames.init(document.querySelector('meta[name=public-key]').content);
}
}, {
key: "handle",
value: function handle() {
var _this = this;
this.init();
Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED, function (event) {
_this.button.disabled = !Frames.isCardValid();
});
Frames.addEventHandler(Frames.Events.CARD_TOKENIZED, function (event) {
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(event);
document.getElementById('server_response').submit();
});
document.querySelector('#authorization-form').addEventListener('submit', function (event) {
_this.button.disabled = true;
event.preventDefault();
Frames.submitCard();
});
}
}]);
return CheckoutCreditCardAuthorization;
}();
new CheckoutCreditCardAuthorization().handle();
/******/ })()
;

View File

@ -1,66 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see braintree-ach.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e;window.braintree.client.create({authorization:null===(e=document.querySelector('meta[name="client-token"]'))||void 0===e?void 0:e.content}).then((function(e){return braintree.usBankAccount.create({client:e})})).then((function(e){var t;null===(t=document.getElementById("authorize-bank-account"))||void 0===t||t.addEventListener("click",(function(t){t.target.parentElement.disabled=!0,document.getElementById("errors").hidden=!0,document.getElementById("errors").textContent="";var n={accountNumber:document.getElementById("account-number").value,routingNumber:document.getElementById("routing-number").value,accountType:document.querySelector('input[name="account-type"]:checked').value,ownershipType:document.querySelector('input[name="ownership-type"]:checked').value,billingAddress:{streetAddress:document.getElementById("billing-street-address").value,extendedAddress:document.getElementById("billing-extended-address").value,locality:document.getElementById("billing-locality").value,region:document.getElementById("billing-region").value,postalCode:document.getElementById("billing-postal-code").value}};if("personal"===n.ownershipType){var o=document.getElementById("account-holder-name").value.split(" ",2);n.firstName=o[0],n.lastName=o[1]}else n.businessName=document.getElementById("account-holder-name").value;e.tokenize({bankDetails:n,mandateText:'By clicking ["Checkout"], I authorize Braintree, a service of PayPal, on behalf of [your business name here] (i) to verify my bank account information using bank information and consumer reports and (ii) to debit my bank account.'}).then((function(e){document.querySelector("input[name=nonce]").value=e.nonce,document.getElementById("server_response").submit()})).catch((function(e){t.target.parentElement.disabled=!1,document.getElementById("errors").textContent="".concat(e.details.originalError.message," ").concat(e.details.originalError.details.originalError[0].message),document.getElementById("errors").hidden=!1}))}))})).catch((function(e){document.getElementById("errors").textContent=e.message,document.getElementById("errors").hidden=!1}))})();
/*!***************************************************************!*\
!*** ./resources/js/clients/payment_methods/braintree-ach.js ***!
\***************************************************************/
var _document$querySelect;
/**
* 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
*/
window.braintree.client.create({
authorization: (_document$querySelect = document.querySelector('meta[name="client-token"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content
}).then(function (clientInstance) {
return braintree.usBankAccount.create({
client: clientInstance
});
}).then(function (usBankAccountInstance) {
var _document$getElementB;
(_document$getElementB = document.getElementById('authorize-bank-account')) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.addEventListener('click', function (e) {
e.target.parentElement.disabled = true;
document.getElementById('errors').hidden = true;
document.getElementById('errors').textContent = '';
var bankDetails = {
accountNumber: document.getElementById('account-number').value,
routingNumber: document.getElementById('routing-number').value,
accountType: document.querySelector('input[name="account-type"]:checked').value,
ownershipType: document.querySelector('input[name="ownership-type"]:checked').value,
billingAddress: {
streetAddress: document.getElementById('billing-street-address').value,
extendedAddress: document.getElementById('billing-extended-address').value,
locality: document.getElementById('billing-locality').value,
region: document.getElementById('billing-region').value,
postalCode: document.getElementById('billing-postal-code').value
}
};
if (bankDetails.ownershipType === 'personal') {
var name = document.getElementById('account-holder-name').value.split(' ', 2);
bankDetails.firstName = name[0];
bankDetails.lastName = name[1];
} else {
bankDetails.businessName = document.getElementById('account-holder-name').value;
}
usBankAccountInstance.tokenize({
bankDetails: bankDetails,
mandateText: 'By clicking ["Checkout"], I authorize Braintree, a service of PayPal, on behalf of [your business name here] (i) to verify my bank account information using bank information and consumer reports and (ii) to debit my bank account.'
}).then(function (payload) {
document.querySelector('input[name=nonce]').value = payload.nonce;
document.getElementById('server_response').submit();
})["catch"](function (error) {
e.target.parentElement.disabled = false;
document.getElementById('errors').textContent = "".concat(error.details.originalError.message, " ").concat(error.details.originalError.details.originalError[0].message);
document.getElementById('errors').hidden = false;
});
});
})["catch"](function (err) {
document.getElementById('errors').textContent = err.message;
document.getElementById('errors').hidden = false;
});
/******/ })()
;

View File

@ -1,72 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see wepay-bank-account.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(i=r.key,a=void 0,a=function(t,n){if("object"!==e(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,n||"default");if("object"!==e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(a)?a:String(a)),r)}var i,a}var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,o,r;return n=e,(o=[{key:"initializeWePay",value:function(){var e,t=null===(e=document.querySelector('meta[name="wepay-environment"]'))||void 0===e?void 0:e.content;return WePay.set_endpoint("staging"===t?"stage":"production"),this}},{key:"showBankPopup",value:function(){var e,t;WePay.bank_account.create({client_id:null===(e=document.querySelector("meta[name=wepay-client-id]"))||void 0===e?void 0:e.content,email:null===(t=document.querySelector("meta[name=contact-email]"))||void 0===t?void 0:t.content,options:{avoidMicrodeposits:!0}},(function(e){e.error?(errors.textContent="",errors.textContent=e.error_description,errors.hidden=!1):(document.querySelector('input[name="bank_account_id"]').value=e.bank_account_id,document.getElementById("server_response").submit())}),(function(e){e.error&&(errors.textContent="",errors.textContent=e.error_description,errors.hidden=!1)}))}},{key:"handle",value:function(){this.initializeWePay().showBankPopup()}}])&&t(n.prototype,o),r&&t(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();document.addEventListener("DOMContentLoaded",(function(){(new n).handle()}))})();
/*!********************************************************************!*\
!*** ./resources/js/clients/payment_methods/wepay-bank-account.js ***!
\********************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var WePayBank = /*#__PURE__*/function () {
function WePayBank() {
_classCallCheck(this, WePayBank);
}
_createClass(WePayBank, [{
key: "initializeWePay",
value: function initializeWePay() {
var _document$querySelect;
var environment = (_document$querySelect = document.querySelector('meta[name="wepay-environment"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content;
WePay.set_endpoint(environment === 'staging' ? 'stage' : 'production');
return this;
}
}, {
key: "showBankPopup",
value: function showBankPopup() {
var _document$querySelect2, _document$querySelect3;
WePay.bank_account.create({
client_id: (_document$querySelect2 = document.querySelector('meta[name=wepay-client-id]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content,
email: (_document$querySelect3 = document.querySelector('meta[name=contact-email]')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.content,
options: {
avoidMicrodeposits: true
}
}, function (data) {
if (data.error) {
errors.textContent = '';
errors.textContent = data.error_description;
errors.hidden = false;
} else {
document.querySelector('input[name="bank_account_id"]').value = data.bank_account_id;
document.getElementById('server_response').submit();
}
}, function (data) {
if (data.error) {
errors.textContent = '';
errors.textContent = data.error_description;
errors.hidden = false;
}
});
}
}, {
key: "handle",
value: function handle() {
this.initializeWePay().showBankPopup();
}
}]);
return WePayBank;
}();
document.addEventListener('DOMContentLoaded', function () {
new WePayBank().handle();
});
/******/ })()
;

View File

@ -1,118 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see authorize-credit-card-payment.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,r(a.key),a)}}function n(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!==e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===e(n)?n:String(n)}var a=function(){function e(t,r){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n(this,"handleAuthorization",(function(){var e=$("#my-card"),t={};t.clientKey=a.publicKey,t.apiLoginID=a.loginId;var n={};n.cardNumber=e.CardJs("cardNumber").replace(/[^\d]/g,""),n.month=e.CardJs("expiryMonth").replace(/[^\d]/g,""),n.year=e.CardJs("expiryYear").replace(/[^\d]/g,""),n.cardCode=document.getElementById("cvv").value.replace(/[^\d]/g,"");var r={};return r.authData=t,r.cardData=n,document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),Accept.dispatchData(r,a.responseHandler),!1})),n(this,"responseHandler",(function(e){if("Error"===e.messages.resultCode){$("#errors").show().html("<p>"+e.messages.message[0].code+": "+e.messages.message[0].text+"</p>"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}else if("Ok"===e.messages.resultCode){document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue;var t=document.querySelector("input[name=token-billing-checkbox]:checked");t&&(document.getElementById("store_card").value=t.value),document.getElementById("server_response").submit()}return!1})),n(this,"handle",(function(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("save-card--container").style.display="none",document.getElementById("authorize--credit-card-container").style.display="none",document.getElementById("token").value=e.target.dataset.token}))}));var e=document.getElementById("toggle-payment-with-credit-card");e&&e.addEventListener("click",(function(){document.getElementById("save-card--container").style.display="grid",document.getElementById("authorize--credit-card-container").style.display="flex",document.getElementById("token").value=null}));var t=document.getElementById("pay-now");return t&&t.addEventListener("click",(function(e){var t=document.getElementById("token");t.value?a.handlePayNowAction(t.value):a.handleAuthorization()})),a})),this.publicKey=t,this.loginId=r,this.cardHolderName=document.getElementById("cardholder_name")}var r,a,o;return r=e,(a=[{key:"handlePayNowAction",value:function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),document.getElementById("token").value=e,document.getElementById("server_response").submit()}}])&&t(r.prototype,a),o&&t(r,o),Object.defineProperty(r,"prototype",{writable:!1}),e}();new a(document.querySelector('meta[name="authorize-public-key"]').content,document.querySelector('meta[name="authorize-login-id"]').content).handle()})();
/*!************************************************************************!*\
!*** ./resources/js/clients/payments/authorize-credit-card-payment.js ***!
\************************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var AuthorizeAuthorizeCard = /*#__PURE__*/function () {
function AuthorizeAuthorizeCard(publicKey, loginId) {
var _this = this;
_classCallCheck(this, AuthorizeAuthorizeCard);
_defineProperty(this, "handleAuthorization", function () {
var myCard = $('#my-card');
var authData = {};
authData.clientKey = _this.publicKey;
authData.apiLoginID = _this.loginId;
var cardData = {};
cardData.cardNumber = myCard.CardJs('cardNumber').replace(/[^\d]/g, '');
cardData.month = myCard.CardJs('expiryMonth').replace(/[^\d]/g, '');
cardData.year = myCard.CardJs('expiryYear').replace(/[^\d]/g, '');
cardData.cardCode = document.getElementById("cvv").value.replace(/[^\d]/g, '');
var secureData = {};
secureData.authData = authData;
secureData.cardData = cardData;
// If using banking information instead of card information,
// send the bankData object instead of the cardData object.
//
// secureData.bankData = bankData;
var payNowButton = document.getElementById('pay-now');
if (payNowButton) {
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
}
Accept.dispatchData(secureData, _this.responseHandler);
return false;
});
_defineProperty(this, "responseHandler", function (response) {
if (response.messages.resultCode === "Error") {
var i = 0;
var $errors = $('#errors'); // get the reference of the div
$errors.show().html("<p>" + response.messages.message[i].code + ": " + response.messages.message[i].text + "</p>");
document.getElementById('pay-now').disabled = false;
document.querySelector('#pay-now > svg').classList.add('hidden');
document.querySelector('#pay-now > span').classList.remove('hidden');
} else if (response.messages.resultCode === "Ok") {
document.getElementById("dataDescriptor").value = response.opaqueData.dataDescriptor;
document.getElementById("dataValue").value = response.opaqueData.dataValue;
var storeCard = document.querySelector('input[name=token-billing-checkbox]:checked');
if (storeCard) {
document.getElementById("store_card").value = storeCard.value;
}
document.getElementById("server_response").submit();
}
return false;
});
_defineProperty(this, "handle", function () {
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
return element.addEventListener('click', function (e) {
document.getElementById('save-card--container').style.display = 'none';
document.getElementById('authorize--credit-card-container').style.display = 'none';
document.getElementById('token').value = e.target.dataset.token;
});
});
var payWithCreditCardToggle = document.getElementById('toggle-payment-with-credit-card');
if (payWithCreditCardToggle) {
payWithCreditCardToggle.addEventListener('click', function () {
document.getElementById('save-card--container').style.display = 'grid';
document.getElementById('authorize--credit-card-container').style.display = 'flex';
document.getElementById('token').value = null;
});
}
var payNowButton = document.getElementById('pay-now');
if (payNowButton) {
payNowButton.addEventListener('click', function (e) {
var token = document.getElementById('token');
token.value ? _this.handlePayNowAction(token.value) : _this.handleAuthorization();
});
}
return _this;
});
this.publicKey = publicKey;
this.loginId = loginId;
this.cardHolderName = document.getElementById("cardholder_name");
}
_createClass(AuthorizeAuthorizeCard, [{
key: "handlePayNowAction",
value: function handlePayNowAction(token_hashed_id) {
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
document.getElementById("token").value = token_hashed_id;
document.getElementById("server_response").submit();
}
}]);
return AuthorizeAuthorizeCard;
}();
var publicKey = document.querySelector('meta[name="authorize-public-key"]').content;
var loginId = document.querySelector('meta[name="authorize-login-id"]').content;
/** @handle */
new AuthorizeAuthorizeCard(publicKey, loginId).handle();
/******/ })()
;

View File

@ -1,138 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see braintree-credit-card.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r<n.length;r++){var a=n[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,(o=a.key,i=void 0,i=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!==e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(o,"string"),"symbol"===e(i)?i:String(i)),a)}var o,i}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,r,a;return n=e,(r=[{key:"initBraintreeDataCollector",value:function(){window.braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content},(function(e,t){window.braintree.dataCollector.create({client:t,paypal:!0},(function(e,t){e||(document.querySelector("input[name=client-data]").value=t.deviceData)}))}))}},{key:"mountBraintreePaymentWidget",value:function(){window.braintree.dropin.create({authorization:document.querySelector("meta[name=client-token]").content,container:"#dropin-container",threeDSecure:"true"===document.querySelector("input[name=threeds_enable]").value.toLowerCase()},this.handleCallback)}},{key:"handleCallback",value:function(e,t){if(e)console.error(e);else{var n=document.getElementById("pay-now");params=JSON.parse(document.querySelector("input[name=threeds]").value),n.addEventListener("click",(function(){t.requestPaymentMethod({threeDSecure:{challengeRequested:!0,amount:params.amount,email:params.email,billingAddress:{givenName:params.billingAddress.givenName,surname:params.billingAddress.surname,phoneNumber:params.billingAddress.phoneNumber,streetAddress:params.billingAddress.streetAddress,extendedAddress:params.billingAddress.extendedAddress,locality:params.billingAddress.locality,region:params.billingAddress.region,postalCode:params.billingAddress.postalCode,countryCodeAlpha2:params.billingAddress.countryCodeAlpha2}}},(function(e,t){if(e)return console.log(e),dropin.clearSelectedPaymentMethod(),void alert("There was a problem verifying this card, please contact your merchant");if("true"===document.querySelector("input[name=threeds_enable]").value&&!t.liabilityShifted)return console.log("Liability did not shift",t),void alert("There was a problem verifying this card, please contact your merchant");n.disabled=!0,n.querySelector("svg").classList.remove("hidden"),n.querySelector("span").classList.add("hidden"),document.querySelector("input[name=gateway_response]").value=JSON.stringify(t);var r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.getElementById("server-response").submit()}))}))}}},{key:"handle",value:function(){this.initBraintreeDataCollector(),this.mountBraintreePaymentWidget(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("dropin-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token,document.getElementById("pay-now-with-token").classList.remove("hidden"),document.getElementById("pay-now").classList.add("hidden")}))})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",(function(e){document.getElementById("dropin-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",document.getElementById("pay-now-with-token").classList.add("hidden"),document.getElementById("pay-now").classList.remove("hidden")}));var e=document.getElementById("pay-now-with-token");e.addEventListener("click",(function(t){e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}))}}])&&t(n.prototype,r),a&&t(n,a),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!****************************************************************!*\
!*** ./resources/js/clients/payments/braintree-credit-card.js ***!
\****************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var BraintreeCreditCard = /*#__PURE__*/function () {
function BraintreeCreditCard() {
_classCallCheck(this, BraintreeCreditCard);
}
_createClass(BraintreeCreditCard, [{
key: "initBraintreeDataCollector",
value: function initBraintreeDataCollector() {
window.braintree.client.create({
authorization: document.querySelector('meta[name=client-token]').content
}, function (err, clientInstance) {
window.braintree.dataCollector.create({
client: clientInstance,
paypal: true
}, function (err, dataCollectorInstance) {
if (err) {
return;
}
document.querySelector('input[name=client-data]').value = dataCollectorInstance.deviceData;
});
});
}
}, {
key: "mountBraintreePaymentWidget",
value: function mountBraintreePaymentWidget() {
window.braintree.dropin.create({
authorization: document.querySelector('meta[name=client-token]').content,
container: '#dropin-container',
threeDSecure: document.querySelector('input[name=threeds_enable]').value.toLowerCase() === 'true'
}, this.handleCallback);
}
}, {
key: "handleCallback",
value: function handleCallback(error, dropinInstance) {
if (error) {
console.error(error);
return;
}
var payNow = document.getElementById('pay-now');
params = JSON.parse(document.querySelector('input[name=threeds]').value);
payNow.addEventListener('click', function () {
dropinInstance.requestPaymentMethod({
threeDSecure: {
challengeRequested: true,
amount: params.amount,
email: params.email,
billingAddress: {
givenName: params.billingAddress.givenName,
// ASCII-printable characters required, else will throw a validation error
surname: params.billingAddress.surname,
// ASCII-printable characters required, else will throw a validation error
phoneNumber: params.billingAddress.phoneNumber,
streetAddress: params.billingAddress.streetAddress,
extendedAddress: params.billingAddress.extendedAddress,
locality: params.billingAddress.locality,
region: params.billingAddress.region,
postalCode: params.billingAddress.postalCode,
countryCodeAlpha2: params.billingAddress.countryCodeAlpha2
}
}
}, function (err, payload) {
if (err) {
console.log(err);
dropin.clearSelectedPaymentMethod();
alert("There was a problem verifying this card, please contact your merchant");
return;
}
if (document.querySelector('input[name=threeds_enable]').value === 'true' && !payload.liabilityShifted) {
console.log('Liability did not shift', payload);
alert("There was a problem verifying this card, please contact your merchant");
return;
}
payNow.disabled = true;
payNow.querySelector('svg').classList.remove('hidden');
payNow.querySelector('span').classList.add('hidden');
document.querySelector('input[name=gateway_response]').value = JSON.stringify(payload);
var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]:checked');
if (tokenBillingCheckbox) {
document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.value;
}
document.getElementById('server-response').submit();
});
});
}
}, {
key: "handle",
value: function handle() {
this.initBraintreeDataCollector();
this.mountBraintreePaymentWidget();
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
return element.addEventListener('click', function (element) {
document.getElementById('dropin-container').classList.add('hidden');
document.getElementById('save-card--container').style.display = 'none';
document.querySelector('input[name=token]').value = element.target.dataset.token;
document.getElementById('pay-now-with-token').classList.remove('hidden');
document.getElementById('pay-now').classList.add('hidden');
});
});
document.getElementById('toggle-payment-with-credit-card').addEventListener('click', function (element) {
document.getElementById('dropin-container').classList.remove('hidden');
document.getElementById('save-card--container').style.display = 'grid';
document.querySelector('input[name=token]').value = "";
document.getElementById('pay-now-with-token').classList.add('hidden');
document.getElementById('pay-now').classList.remove('hidden');
});
var payNowWithToken = document.getElementById('pay-now-with-token');
payNowWithToken.addEventListener('click', function (element) {
payNowWithToken.disabled = true;
payNowWithToken.querySelector('svg').classList.remove('hidden');
payNowWithToken.querySelector('span').classList.add('hidden');
document.getElementById('server-response').submit();
});
}
}]);
return BraintreeCreditCard;
}();
new BraintreeCreditCard().handle();
/******/ })()
;

View File

@ -1,125 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see braintree-paypal.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(a=r.key,i=void 0,i=function(t,n){if("object"!==e(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,n||"default");if("object"!==e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(a,"string"),"symbol"===e(i)?i:String(i)),r)}var a,i}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,o,r;return n=e,r=[{key:"getPaymentDetails",value:function(){return{flow:"vault"}}},{key:"handleErrorMessage",value:function(e){var t=document.getElementById("errors");t.innerText=e,t.hidden=!1}}],(o=[{key:"initBraintreeDataCollector",value:function(){window.braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content},(function(e,t){window.braintree.dataCollector.create({client:t,paypal:!0},(function(e,t){e||(document.querySelector("input[name=client-data]").value=t.deviceData)}))}))}},{key:"handlePaymentWithToken",value:function(){Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("paypal-button").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token,document.getElementById("pay-now-with-token").classList.remove("hidden"),document.getElementById("pay-now").classList.add("hidden")}))}));var e=document.getElementById("pay-now-with-token");e.addEventListener("click",(function(t){e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}))}},{key:"handle",value:function(){this.initBraintreeDataCollector(),this.handlePaymentWithToken(),braintree.client.create({authorization:document.querySelector("meta[name=client-token]").content}).then((function(e){return braintree.paypalCheckout.create({client:e})})).then((function(t){return t.loadPayPalSDK({vault:!0}).then((function(t){return paypal.Buttons({fundingSource:paypal.FUNDING.PAYPAL,createBillingAgreement:function(){return t.createPayment(e.getPaymentDetails())},onApprove:function(e,n){return t.tokenizePayment(e).then((function(e){var t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.querySelector("input[name=gateway_response]").value=JSON.stringify(e),document.getElementById("server-response").submit()}))},onCancel:function(e){},onError:function(t){console.log(t.message),e.handleErrorMessage(t.message)}}).render("#paypal-button")}))})).catch((function(t){console.log(t.message),e.handleErrorMessage(t.message)}))}}])&&t(n.prototype,o),r&&t(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!***********************************************************!*\
!*** ./resources/js/clients/payments/braintree-paypal.js ***!
\***********************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var BraintreePayPal = /*#__PURE__*/function () {
function BraintreePayPal() {
_classCallCheck(this, BraintreePayPal);
}
_createClass(BraintreePayPal, [{
key: "initBraintreeDataCollector",
value: function initBraintreeDataCollector() {
window.braintree.client.create({
authorization: document.querySelector('meta[name=client-token]').content
}, function (err, clientInstance) {
window.braintree.dataCollector.create({
client: clientInstance,
paypal: true
}, function (err, dataCollectorInstance) {
if (err) {
return;
}
document.querySelector('input[name=client-data]').value = dataCollectorInstance.deviceData;
});
});
}
}, {
key: "handlePaymentWithToken",
value: function handlePaymentWithToken() {
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
return element.addEventListener('click', function (element) {
document.getElementById('paypal-button').classList.add('hidden');
document.getElementById('save-card--container').style.display = 'none';
document.querySelector('input[name=token]').value = element.target.dataset.token;
document.getElementById('pay-now-with-token').classList.remove('hidden');
document.getElementById('pay-now').classList.add('hidden');
});
});
var payNowWithToken = document.getElementById('pay-now-with-token');
payNowWithToken.addEventListener('click', function (element) {
payNowWithToken.disabled = true;
payNowWithToken.querySelector('svg').classList.remove('hidden');
payNowWithToken.querySelector('span').classList.add('hidden');
document.getElementById('server-response').submit();
});
}
}, {
key: "handle",
value: function handle() {
this.initBraintreeDataCollector();
this.handlePaymentWithToken();
braintree.client.create({
authorization: document.querySelector('meta[name=client-token]').content
}).then(function (clientInstance) {
return braintree.paypalCheckout.create({
client: clientInstance
});
}).then(function (paypalCheckoutInstance) {
return paypalCheckoutInstance.loadPayPalSDK({
vault: true
}).then(function (paypalCheckoutInstance) {
return paypal.Buttons({
fundingSource: paypal.FUNDING.PAYPAL,
createBillingAgreement: function createBillingAgreement() {
return paypalCheckoutInstance.createPayment(BraintreePayPal.getPaymentDetails());
},
onApprove: function onApprove(data, actions) {
return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {
var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]:checked');
if (tokenBillingCheckbox) {
document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.value;
}
document.querySelector('input[name=gateway_response]').value = JSON.stringify(payload);
document.getElementById('server-response').submit();
});
},
onCancel: function onCancel(data) {
// ..
},
onError: function onError(err) {
console.log(err.message);
BraintreePayPal.handleErrorMessage(err.message);
}
}).render('#paypal-button');
});
})["catch"](function (err) {
console.log(err.message);
BraintreePayPal.handleErrorMessage(err.message);
});
}
}], [{
key: "getPaymentDetails",
value: function getPaymentDetails() {
return {
flow: 'vault'
};
}
}, {
key: "handleErrorMessage",
value: function handleErrorMessage(message) {
var errorsContainer = document.getElementById('errors');
errorsContainer.innerText = message;
errorsContainer.hidden = false;
}
}]);
return BraintreePayPal;
}();
new BraintreePayPal().handle();
/******/ })()
;

File diff suppressed because one or more lines are too long

View File

@ -1,93 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see checkout-credit-card.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var o=0;o<n.length;o++){var r=n[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(a=r.key,i=void 0,i=function(t,n){if("object"!==e(t)||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var r=o.call(t,n||"default");if("object"!==e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(a,"string"),"symbol"===e(i)?i:String(i)),r)}var a,i}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.tokens=[]}var n,o,r;return n=e,(o=[{key:"mountFrames",value:function(){console.log("Mount checkout frames..")}},{key:"handlePaymentUsingToken",value:function(e){document.getElementById("checkout--container").classList.add("hidden"),document.getElementById("pay-now-with-token--container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token}},{key:"handlePaymentUsingCreditCard",value:function(e){var t;document.getElementById("checkout--container").classList.remove("hidden"),document.getElementById("pay-now-with-token--container").classList.add("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="";var n=document.getElementById("pay-button"),o=null!==(t=document.querySelector('meta[name="public-key"]').content)&&void 0!==t?t:"",r=document.getElementById("payment-form");Frames.init(o),Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED,(function(e){n.disabled=!Frames.isCardValid()})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZATION_FAILED,(function(e){pay.button.disabled=!1})),Frames.addEventHandler(Frames.Events.CARD_TOKENIZED,(function(e){n.disabled=!0,document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e),document.querySelector('input[name="store_card"]').value=document.querySelector("input[name=token-billing-checkbox]:checked").value,document.getElementById("server-response").submit()})),r.addEventListener("submit",(function(e){e.preventDefault(),Frames.submitCard()}))}},{key:"completePaymentUsingToken",value:function(e){var t=document.getElementById("pay-now-with-token");t.disabled=!0,t.querySelector("svg").classList.remove("hidden"),t.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}},{key:"handle",value:function(){var e=this;this.handlePaymentUsingCreditCard(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(t){return t.addEventListener("click",e.handlePaymentUsingToken)})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",this.handlePaymentUsingCreditCard),document.getElementById("pay-now-with-token").addEventListener("click",this.completePaymentUsingToken)}}])&&t(n.prototype,o),r&&t(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!***************************************************************!*\
!*** ./resources/js/clients/payments/checkout-credit-card.js ***!
\***************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var CheckoutCreditCard = /*#__PURE__*/function () {
function CheckoutCreditCard() {
_classCallCheck(this, CheckoutCreditCard);
this.tokens = [];
}
_createClass(CheckoutCreditCard, [{
key: "mountFrames",
value: function mountFrames() {
console.log('Mount checkout frames..');
}
}, {
key: "handlePaymentUsingToken",
value: function handlePaymentUsingToken(e) {
document.getElementById('checkout--container').classList.add('hidden');
document.getElementById('pay-now-with-token--container').classList.remove('hidden');
document.getElementById('save-card--container').style.display = 'none';
document.querySelector('input[name=token]').value = e.target.dataset.token;
}
}, {
key: "handlePaymentUsingCreditCard",
value: function handlePaymentUsingCreditCard(e) {
var _document$querySelect;
document.getElementById('checkout--container').classList.remove('hidden');
document.getElementById('pay-now-with-token--container').classList.add('hidden');
document.getElementById('save-card--container').style.display = 'grid';
document.querySelector('input[name=token]').value = '';
var payButton = document.getElementById('pay-button');
var publicKey = (_document$querySelect = document.querySelector('meta[name="public-key"]').content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var form = document.getElementById('payment-form');
Frames.init(publicKey);
Frames.addEventHandler(Frames.Events.CARD_VALIDATION_CHANGED, function (event) {
payButton.disabled = !Frames.isCardValid();
});
Frames.addEventHandler(Frames.Events.CARD_TOKENIZATION_FAILED, function (event) {
pay.button.disabled = false;
});
Frames.addEventHandler(Frames.Events.CARD_TOKENIZED, function (event) {
payButton.disabled = true;
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(event);
document.querySelector('input[name="store_card"]').value = document.querySelector('input[name=token-billing-checkbox]:checked').value;
document.getElementById('server-response').submit();
});
form.addEventListener('submit', function (event) {
event.preventDefault();
Frames.submitCard();
});
}
}, {
key: "completePaymentUsingToken",
value: function completePaymentUsingToken(e) {
var btn = document.getElementById('pay-now-with-token');
btn.disabled = true;
btn.querySelector('svg').classList.remove('hidden');
btn.querySelector('span').classList.add('hidden');
document.getElementById('server-response').submit();
}
}, {
key: "handle",
value: function handle() {
var _this = this;
this.handlePaymentUsingCreditCard();
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
return element.addEventListener('click', _this.handlePaymentUsingToken);
});
document.getElementById('toggle-payment-with-credit-card').addEventListener('click', this.handlePaymentUsingCreditCard);
document.getElementById('pay-now-with-token').addEventListener('click', this.completePaymentUsingToken);
}
}]);
return CheckoutCreditCard;
}();
new CheckoutCreditCard().handle();
/******/ })()
;

File diff suppressed because one or more lines are too long

View File

@ -1,73 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see forte-ach-payment.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(n){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(n)}function n(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function t(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,n,t){return(n=o(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(n){var t=function(n,t){if("object"!==e(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var o=r.call(n,t||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(n)}(n,"string");return"symbol"===e(t)?t:String(t)}var i=t((function e(n){var t=this;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),r(this,"handleAuthorization",(function(){var e=document.getElementById("account-number").value,n=document.getElementById("routing-number").value,r={api_login_id:t.apiLoginId,account_number:e,routing_number:n,account_type:"checking"};return document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),forte.createToken(r).success(t.successResponseHandler).error(t.failedResponseHandler),!1})),r(this,"successResponseHandler",(function(e){return document.getElementById("payment_token").value=e.onetime_token,document.getElementById("server_response").submit(),!1})),r(this,"failedResponseHandler",(function(e){var n='<div class="alert alert-failure mb-4"><ul><li>'+e.response_description+"</li></ul></div>";return document.getElementById("forte_errors").innerHTML=n,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),!1})),r(this,"handle",(function(){var e=document.getElementById("pay-now");return e&&e.addEventListener("click",(function(e){t.handleAuthorization()})),t})),this.apiLoginId=n}));new i(document.querySelector('meta[name="forte-api-login-id"]').content).handle()})();
/*!************************************************************!*\
!*** ./resources/js/clients/payments/forte-ach-payment.js ***!
\************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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://opensource.org/licenses/AAL
*/
var ForteAuthorizeACH = /*#__PURE__*/_createClass(function ForteAuthorizeACH(apiLoginId) {
var _this = this;
_classCallCheck(this, ForteAuthorizeACH);
_defineProperty(this, "handleAuthorization", function () {
var account_number = document.getElementById('account-number').value;
var routing_number = document.getElementById('routing-number').value;
var data = {
api_login_id: _this.apiLoginId,
account_number: account_number,
routing_number: routing_number,
account_type: 'checking'
};
var payNowButton = document.getElementById('pay-now');
if (payNowButton) {
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
}
// console.log(data);
forte.createToken(data).success(_this.successResponseHandler).error(_this.failedResponseHandler);
return false;
});
_defineProperty(this, "successResponseHandler", function (response) {
document.getElementById('payment_token').value = response.onetime_token;
document.getElementById('server_response').submit();
return false;
});
_defineProperty(this, "failedResponseHandler", function (response) {
var errors = '<div class="alert alert-failure mb-4"><ul><li>' + response.response_description + '</li></ul></div>';
document.getElementById('forte_errors').innerHTML = errors;
document.getElementById('pay-now').disabled = false;
document.querySelector('#pay-now > svg').classList.add('hidden');
document.querySelector('#pay-now > span').classList.remove('hidden');
return false;
});
_defineProperty(this, "handle", function () {
var payNowButton = document.getElementById('pay-now');
if (payNowButton) {
payNowButton.addEventListener('click', function (e) {
_this.handleAuthorization();
});
}
return _this;
});
this.apiLoginId = apiLoginId;
});
var apiLoginId = document.querySelector('meta[name="forte-api-login-id"]').content;
/** @handle */
new ForteAuthorizeACH(apiLoginId).handle();
/******/ })()
;

View File

@ -1,74 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see forte-credit-card-payment.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(n){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(n)}function n(e,n){for(var t=0;t<n.length;t++){var r=n[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function t(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,n,t){return(n=o(n))in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(n){var t=function(n,t){if("object"!==e(n)||null===n)return n;var r=n[Symbol.toPrimitive];if(void 0!==r){var o=r.call(n,t||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(n)}(n,"string");return"symbol"===e(t)?t:String(t)}var i=t((function e(n){var t=this;!function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}(this,e),r(this,"handleAuthorization",(function(){var e=$("#my-card"),n={api_login_id:t.apiLoginId,card_number:e.CardJs("cardNumber").replace(/[^\d]/g,""),expire_year:e.CardJs("expiryYear").replace(/[^\d]/g,""),expire_month:e.CardJs("expiryMonth").replace(/[^\d]/g,""),cvv:document.getElementById("cvv").value.replace(/[^\d]/g,"")};return document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),forte.createToken(n).success(t.successResponseHandler).error(t.failedResponseHandler),!1})),r(this,"successResponseHandler",(function(e){return document.getElementById("payment_token").value=e.onetime_token,document.getElementById("card_brand").value=e.card_type,document.getElementById("server_response").submit(),!1})),r(this,"failedResponseHandler",(function(e){var n='<div class="alert alert-failure mb-4"><ul><li>'+e.response_description+"</li></ul></div>";return document.getElementById("forte_errors").innerHTML=n,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),!1})),r(this,"handle",(function(){var e=document.getElementById("pay-now");return e&&e.addEventListener("click",(function(e){t.handleAuthorization()})),t})),this.apiLoginId=n,this.cardHolderName=document.getElementById("cardholder_name")}));new i(document.querySelector('meta[name="forte-api-login-id"]').content).handle()})();
/*!********************************************************************!*\
!*** ./resources/js/clients/payments/forte-credit-card-payment.js ***!
\********************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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://opensource.org/licenses/AAL
*/
var ForteAuthorizeCard = /*#__PURE__*/_createClass(function ForteAuthorizeCard(apiLoginId) {
var _this = this;
_classCallCheck(this, ForteAuthorizeCard);
_defineProperty(this, "handleAuthorization", function () {
var myCard = $('#my-card');
var data = {
api_login_id: _this.apiLoginId,
card_number: myCard.CardJs('cardNumber').replace(/[^\d]/g, ''),
expire_year: myCard.CardJs('expiryYear').replace(/[^\d]/g, ''),
expire_month: myCard.CardJs('expiryMonth').replace(/[^\d]/g, ''),
cvv: document.getElementById('cvv').value.replace(/[^\d]/g, '')
};
var payNowButton = document.getElementById('pay-now');
if (payNowButton) {
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
}
forte.createToken(data).success(_this.successResponseHandler).error(_this.failedResponseHandler);
return false;
});
_defineProperty(this, "successResponseHandler", function (response) {
document.getElementById('payment_token').value = response.onetime_token;
document.getElementById('card_brand').value = response.card_type;
document.getElementById('server_response').submit();
return false;
});
_defineProperty(this, "failedResponseHandler", function (response) {
var errors = '<div class="alert alert-failure mb-4"><ul><li>' + response.response_description + '</li></ul></div>';
document.getElementById('forte_errors').innerHTML = errors;
document.getElementById('pay-now').disabled = false;
document.querySelector('#pay-now > svg').classList.add('hidden');
document.querySelector('#pay-now > span').classList.remove('hidden');
return false;
});
_defineProperty(this, "handle", function () {
var payNowButton = document.getElementById('pay-now');
if (payNowButton) {
payNowButton.addEventListener('click', function (e) {
_this.handleAuthorization();
});
}
return _this;
});
this.apiLoginId = apiLoginId;
this.cardHolderName = document.getElementById('cardholder_name');
});
var apiLoginId = document.querySelector('meta[name="forte-api-login-id"]').content;
/** @handle */
new ForteAuthorizeCard(apiLoginId).handle();
/******/ })()
;

View File

@ -1,143 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see mollie-credit-card.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(a=o.key,u=void 0,u=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(a,"string"),"symbol"===e(u)?u:String(u)),o)}var a,u}(new(function(){function e(){var t,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mollie=Mollie(null===(t=document.querySelector("meta[name=mollie-profileId]"))||void 0===t?void 0:t.content,{testmode:null===(n=document.querySelector("meta[name=mollie-testmode]"))||void 0===n?void 0:n.content,locale:"en_US"})}var n,r,o;return n=e,(r=[{key:"createCardHolderInput",value:function(){var e=this.mollie.createComponent("cardHolder");e.mount("#card-holder");var t=document.getElementById("card-holder-error");return e.addEventListener("change",(function(e){e.error&&e.touched?t.textContent=e.error:t.textContent=""})),this}},{key:"createCardNumberInput",value:function(){var e=this.mollie.createComponent("cardNumber");e.mount("#card-number");var t=document.getElementById("card-number-error");return e.addEventListener("change",(function(e){e.error&&e.touched?t.textContent=e.error:t.textContent=""})),this}},{key:"createExpiryDateInput",value:function(){var e=this.mollie.createComponent("expiryDate");e.mount("#expiry-date");var t=document.getElementById("expiry-date-error");return e.addEventListener("change",(function(e){e.error&&e.touched?t.textContent=e.error:t.textContent=""})),this}},{key:"createCvvInput",value:function(){var e=this.mollie.createComponent("verificationCode");e.mount("#cvv");var t=document.getElementById("cvv-error");return e.addEventListener("change",(function(e){e.error&&e.touched?t.textContent=e.error:t.textContent=""})),this}},{key:"handlePayNowButton",value:function(){if(document.getElementById("pay-now").disabled=!0,""!==document.querySelector("input[name=token]").value)return document.querySelector("input[name=gateway_response]").value="",document.getElementById("server-response").submit();this.mollie.createToken().then((function(e){var t=e.token,n=e.error;if(n){document.getElementById("pay-now").disabled=!1;var r=document.getElementById("errors");return r.innerText=n.message,void(r.hidden=!1)}var o=document.querySelector('input[name="token-billing-checkbox"]:checked');o&&(document.querySelector('input[name="store_card"]').value=o.value),document.querySelector("input[name=gateway_response]").value=t,document.querySelector("input[name=token]").value="",document.getElementById("server-response").submit()}))}},{key:"handle",value:function(){var e=this;this.createCardHolderInput().createCardNumberInput().createExpiryDateInput().createCvvInput(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach((function(e){return e.addEventListener("click",(function(e){document.getElementById("mollie--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token}))})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",(function(e){document.getElementById("mollie--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""})),document.getElementById("pay-now").addEventListener("click",(function(){return e.handlePayNowButton()}))}}])&&t(n.prototype,r),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!*************************************************************!*\
!*** ./resources/js/clients/payments/mollie-credit-card.js ***!
\*************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var _Mollie = /*#__PURE__*/function () {
function _Mollie() {
var _document$querySelect, _document$querySelect2;
_classCallCheck(this, _Mollie);
this.mollie = Mollie((_document$querySelect = document.querySelector('meta[name=mollie-profileId]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content, {
testmode: (_document$querySelect2 = document.querySelector('meta[name=mollie-testmode]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content,
locale: 'en_US'
});
}
_createClass(_Mollie, [{
key: "createCardHolderInput",
value: function createCardHolderInput() {
var cardHolder = this.mollie.createComponent('cardHolder');
cardHolder.mount('#card-holder');
var cardHolderError = document.getElementById('card-holder-error');
cardHolder.addEventListener('change', function (event) {
if (event.error && event.touched) {
cardHolderError.textContent = event.error;
} else {
cardHolderError.textContent = '';
}
});
return this;
}
}, {
key: "createCardNumberInput",
value: function createCardNumberInput() {
var cardNumber = this.mollie.createComponent('cardNumber');
cardNumber.mount('#card-number');
var cardNumberError = document.getElementById('card-number-error');
cardNumber.addEventListener('change', function (event) {
if (event.error && event.touched) {
cardNumberError.textContent = event.error;
} else {
cardNumberError.textContent = '';
}
});
return this;
}
}, {
key: "createExpiryDateInput",
value: function createExpiryDateInput() {
var expiryDate = this.mollie.createComponent('expiryDate');
expiryDate.mount('#expiry-date');
var expiryDateError = document.getElementById('expiry-date-error');
expiryDate.addEventListener('change', function (event) {
if (event.error && event.touched) {
expiryDateError.textContent = event.error;
} else {
expiryDateError.textContent = '';
}
});
return this;
}
}, {
key: "createCvvInput",
value: function createCvvInput() {
var verificationCode = this.mollie.createComponent('verificationCode');
verificationCode.mount('#cvv');
var verificationCodeError = document.getElementById('cvv-error');
verificationCode.addEventListener('change', function (event) {
if (event.error && event.touched) {
verificationCodeError.textContent = event.error;
} else {
verificationCodeError.textContent = '';
}
});
return this;
}
}, {
key: "handlePayNowButton",
value: function handlePayNowButton() {
document.getElementById('pay-now').disabled = true;
if (document.querySelector('input[name=token]').value !== '') {
document.querySelector('input[name=gateway_response]').value = '';
return document.getElementById('server-response').submit();
}
this.mollie.createToken().then(function (result) {
var token = result.token;
var error = result.error;
if (error) {
document.getElementById('pay-now').disabled = false;
var errorsContainer = document.getElementById('errors');
errorsContainer.innerText = error.message;
errorsContainer.hidden = false;
return;
}
var tokenBillingCheckbox = document.querySelector('input[name="token-billing-checkbox"]:checked');
if (tokenBillingCheckbox) {
document.querySelector('input[name="store_card"]').value = tokenBillingCheckbox.value;
}
document.querySelector('input[name=gateway_response]').value = token;
document.querySelector('input[name=token]').value = '';
document.getElementById('server-response').submit();
});
}
}, {
key: "handle",
value: function handle() {
var _this = this;
this.createCardHolderInput().createCardNumberInput().createExpiryDateInput().createCvvInput();
Array.from(document.getElementsByClassName('toggle-payment-with-token')).forEach(function (element) {
return element.addEventListener('click', function (element) {
document.getElementById('mollie--payment-container').classList.add('hidden');
document.getElementById('save-card--container').style.display = 'none';
document.querySelector('input[name=token]').value = element.target.dataset.token;
});
});
document.getElementById('toggle-payment-with-credit-card').addEventListener('click', function (element) {
document.getElementById('mollie--payment-container').classList.remove('hidden');
document.getElementById('save-card--container').style.display = 'grid';
document.querySelector('input[name=token]').value = '';
});
document.getElementById('pay-now').addEventListener('click', function () {
return _this.handlePayNowButton();
});
}
}]);
return _Mollie;
}();
new _Mollie().handle();
/******/ })()
;

File diff suppressed because one or more lines are too long

View File

@ -1,35 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see razorpay-aio.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,n=JSON.parse(null===(e=document.querySelector("meta[name=razorpay-options]"))||void 0===e?void 0:e.content);n.handler=function(e){document.getElementById("razorpay_payment_id").value=e.razorpay_payment_id,document.getElementById("razorpay_signature").value=e.razorpay_signature,document.getElementById("server-response").submit()},n.modal={ondismiss:function(){o.disabled=!1}};var a=new Razorpay(n),o=document.getElementById("pay-now");o.onclick=function(e){o.disabled=!0,a.open()}})();
/*!*******************************************************!*\
!*** ./resources/js/clients/payments/razorpay-aio.js ***!
\*******************************************************/
var _document$querySelect;
/**
* 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
*/
var options = JSON.parse((_document$querySelect = document.querySelector('meta[name=razorpay-options]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content);
options.handler = function (response) {
document.getElementById('razorpay_payment_id').value = response.razorpay_payment_id;
document.getElementById('razorpay_signature').value = response.razorpay_signature;
document.getElementById('server-response').submit();
};
options.modal = {
ondismiss: function ondismiss() {
payNowButton.disabled = false;
}
};
var razorpay = new Razorpay(options);
var payNowButton = document.getElementById('pay-now');
payNowButton.onclick = function (event) {
payNowButton.disabled = true;
razorpay.open();
};
/******/ })()
;

File diff suppressed because one or more lines are too long

View File

@ -1,97 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-ach.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}function n(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===e(n)?n:String(n)}(new(function(){function e(){var t,r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n(this,"setupStripe",(function(){return r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key),r})),n(this,"getFormData",(function(){return{country:document.getElementById("country").value,currency:document.getElementById("currency").value,routing_number:document.getElementById("routing-number").value,account_number:document.getElementById("account-number").value,account_holder_name:document.getElementById("account-holder-name").value,account_holder_type:document.querySelector('input[name="account-holder-type"]:checked').value}})),n(this,"handleError",(function(e){document.getElementById("save-button").disabled=!1,document.querySelector("#save-button > svg").classList.add("hidden"),document.querySelector("#save-button > span").classList.remove("hidden"),r.errors.textContent="",r.errors.textContent=e,r.errors.hidden=!1})),n(this,"handleSuccess",(function(e){document.getElementById("gateway_response").value=JSON.stringify(e),document.getElementById("server_response").submit()})),n(this,"handleSubmit",(function(e){if(!document.getElementById("accept-terms").checked)return errors.textContent="You must accept the mandate terms prior to making payment.",void(errors.hidden=!1);document.getElementById("save-button").disabled=!0,document.querySelector("#save-button > svg").classList.remove("hidden"),document.querySelector("#save-button > span").classList.add("hidden"),e.preventDefault(),r.errors.textContent="",r.errors.hidden=!0,r.stripe.createToken("bank_account",r.getFormData()).then((function(e){return e.hasOwnProperty("error")?r.handleError(e.error.message):r.handleSuccess(e)}))})),this.errors=document.getElementById("errors"),this.key=document.querySelector('meta[name="stripe-publishable-key"]').content,this.stripe_connect=null===(t=document.querySelector('meta[name="stripe-account-id"]'))||void 0===t?void 0:t.content}var r,o,u;return r=e,(o=[{key:"handle",value:function(){var e=this;document.getElementById("save-button").addEventListener("click",(function(t){return e.handleSubmit(t)}))}}])&&t(r.prototype,o),u&&t(r,u),Object.defineProperty(r,"prototype",{writable:!1}),e}())).setupStripe().handle()})();
/*!*****************************************************!*\
!*** ./resources/js/clients/payments/stripe-ach.js ***!
\*****************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var AuthorizeACH = /*#__PURE__*/function () {
function AuthorizeACH() {
var _this = this,
_document$querySelect;
_classCallCheck(this, AuthorizeACH);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
return _this;
});
_defineProperty(this, "getFormData", function () {
return {
country: document.getElementById('country').value,
currency: document.getElementById('currency').value,
routing_number: document.getElementById('routing-number').value,
account_number: document.getElementById('account-number').value,
account_holder_name: document.getElementById('account-holder-name').value,
account_holder_type: document.querySelector('input[name="account-holder-type"]:checked').value
};
});
_defineProperty(this, "handleError", function (message) {
document.getElementById('save-button').disabled = false;
document.querySelector('#save-button > svg').classList.add('hidden');
document.querySelector('#save-button > span').classList.remove('hidden');
_this.errors.textContent = '';
_this.errors.textContent = message;
_this.errors.hidden = false;
});
_defineProperty(this, "handleSuccess", function (response) {
document.getElementById('gateway_response').value = JSON.stringify(response);
document.getElementById('server_response').submit();
});
_defineProperty(this, "handleSubmit", function (e) {
if (!document.getElementById('accept-terms').checked) {
errors.textContent = "You must accept the mandate terms prior to making payment.";
errors.hidden = false;
return;
}
document.getElementById('save-button').disabled = true;
document.querySelector('#save-button > svg').classList.remove('hidden');
document.querySelector('#save-button > span').classList.add('hidden');
e.preventDefault();
_this.errors.textContent = '';
_this.errors.hidden = true;
_this.stripe.createToken('bank_account', _this.getFormData()).then(function (result) {
if (result.hasOwnProperty('error')) {
return _this.handleError(result.error.message);
}
return _this.handleSuccess(result);
});
});
this.errors = document.getElementById('errors');
this.key = document.querySelector('meta[name="stripe-publishable-key"]').content;
this.stripe_connect = (_document$querySelect = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content;
}
_createClass(AuthorizeACH, [{
key: "handle",
value: function handle() {
var _this2 = this;
document.getElementById('save-button').addEventListener('click', function (e) {
return _this2.handleSubmit(e);
});
}
}]);
return AuthorizeACH;
}();
new AuthorizeACH().setupStripe().handle();
/******/ })()
;

View File

@ -1,100 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-acss.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function a(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}var c=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,"setupStripe",(function(){return r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key),r})),a(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");return""===document.getElementById("acss-name").value?(document.getElementById("acss-name").focus(),t.textContent=document.querySelector("meta[name=translation-name-required]").content,void(t.hidden=!1)):""===document.getElementById("acss-email-address").value?(document.getElementById("acss-email-address").focus(),t.textContent=document.querySelector("meta[name=translation-email-required]").content,void(t.hidden=!1)):(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),void r.stripe.confirmAcssDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("acss-name").value,email:document.getElementById("acss-email-address").value}}}).then((function(e){return e.error?r.handleFailure(e.error.message):r.handleSuccess(e)})))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}var t,n,r;return t=e,(n=[{key:"handleSuccess",value:function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent),document.getElementById("server-response").submit()}},{key:"handleFailure",value:function(e){var t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}])&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();new c(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!******************************************************!*\
!*** ./resources/js/clients/payments/stripe-acss.js ***!
\******************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessACSS = /*#__PURE__*/function () {
function ProcessACSS(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessACSS);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
return _this;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
var errors = document.getElementById('errors');
if (document.getElementById('acss-name').value === "") {
document.getElementById('acss-name').focus();
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
errors.hidden = false;
return;
}
if (document.getElementById('acss-email-address').value === "") {
document.getElementById('acss-email-address').focus();
errors.textContent = document.querySelector('meta[name=translation-email-required]').content;
errors.hidden = false;
return;
}
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmAcssDebitPayment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
billing_details: {
name: document.getElementById("acss-name").value,
email: document.getElementById("acss-email-address").value
}
}
}).then(function (result) {
if (result.error) {
return _this.handleFailure(result.error.message);
}
return _this.handleSuccess(result);
});
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
}
_createClass(ProcessACSS, [{
key: "handleSuccess",
value: function handleSuccess(result) {
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(result.paymentIntent);
document.getElementById('server-response').submit();
}
}, {
key: "handleFailure",
value: function handleFailure(message) {
var errors = document.getElementById('errors');
errors.textContent = '';
errors.textContent = message;
errors.hidden = false;
document.getElementById('pay-now').disabled = false;
document.querySelector('#pay-now > svg').classList.add('hidden');
document.querySelector('#pay-now > span').classList.remove('hidden');
}
}]);
return ProcessACSS;
}();
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessACSS(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

File diff suppressed because one or more lines are too long

View File

@ -1,81 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-bacs.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,o,r,i;function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,d(o.key),o)}}function c(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=function(e,t){if("object"!==a(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==a(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===a(t)?t:String(t)}var s=c((function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"setupStripe",(function(){return o.stripeConnect?o.stripe=Stripe(o.key,{stripeAccount:o.stripeConnect}):o.stripe=Stripe(o.key),o})),l(this,"payment_data",void 0),l(this,"handle",(function(){o.onlyAuthorization?document.getElementById("authorize-bacs").addEventListener("click",(function(e){document.getElementById("authorize-bacs").disabled=!0,document.querySelector("#authorize-bacs > svg").classList.remove("hidden"),document.querySelector("#authorize-bacs > span").classList.add("hidden"),location.href=document.querySelector("meta[name=stripe-redirect-url]").content})):(o.payNowButton=document.getElementById("pay-now"),document.getElementById("pay-now").addEventListener("click",(function(e){o.payNowButton.disabled=!0,o.payNowButton.querySelector("svg").classList.remove("hidden"),o.payNowButton.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()})),o.payment_data=Array.from(document.getElementsByClassName("toggle-payment-with-token")),o.payment_data.length>0?o.payment_data.forEach((function(e){return e.addEventListener("click",(function(e){document.querySelector("input[name=token]").value=e.target.dataset.token}))})):(o.errors.textContent=document.querySelector("meta[name=translation-payment-method-required]").content,o.errors.hidden=!1,o.payNowButton.disabled=!0,o.payNowButton.querySelector("span").classList.remove("hidden"),o.payNowButton.querySelector("svg").classList.add("hidden")))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n,this.onlyAuthorization=p})),y=null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",m=null!==(n=null===(o=document.querySelector('meta[name="stripe-account-id"]'))||void 0===o?void 0:o.content)&&void 0!==n?n:"",p=null!==(r=null===(i=document.querySelector('meta[name="only-authorization"]'))||void 0===i?void 0:i.content)&&void 0!==r?r:"";new s(y,m).setupStripe().handle()})();
/*!******************************************************!*\
!*** ./resources/js/clients/payments/stripe-bacs.js ***!
\******************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4, _document$querySelect5, _document$querySelect6;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessBACS = /*#__PURE__*/_createClass(function ProcessBACS(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessBACS);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
return _this;
});
_defineProperty(this, "payment_data", void 0);
_defineProperty(this, "handle", function () {
if (_this.onlyAuthorization) {
document.getElementById('authorize-bacs').addEventListener('click', function (e) {
document.getElementById('authorize-bacs').disabled = true;
document.querySelector('#authorize-bacs > svg').classList.remove('hidden');
document.querySelector('#authorize-bacs > span').classList.add('hidden');
location.href = document.querySelector('meta[name=stripe-redirect-url]').content;
});
} else {
_this.payNowButton = document.getElementById('pay-now');
document.getElementById('pay-now').addEventListener('click', function (e) {
_this.payNowButton.disabled = true;
_this.payNowButton.querySelector('svg').classList.remove('hidden');
_this.payNowButton.querySelector('span').classList.add('hidden');
document.getElementById('server-response').submit();
});
_this.payment_data = Array.from(document.getElementsByClassName('toggle-payment-with-token'));
if (_this.payment_data.length > 0) {
_this.payment_data.forEach(function (element) {
return element.addEventListener('click', function (element) {
document.querySelector('input[name=token]').value = element.target.dataset.token;
});
});
} else {
_this.errors.textContent = document.querySelector('meta[name=translation-payment-method-required]').content;
_this.errors.hidden = false;
_this.payNowButton.disabled = true;
_this.payNowButton.querySelector('span').classList.remove('hidden');
_this.payNowButton.querySelector('svg').classList.add('hidden');
}
}
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
this.onlyAuthorization = onlyAuthorization;
});
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
var onlyAuthorization = (_document$querySelect5 = (_document$querySelect6 = document.querySelector('meta[name="only-authorization"]')) === null || _document$querySelect6 === void 0 ? void 0 : _document$querySelect6.content) !== null && _document$querySelect5 !== void 0 ? _document$querySelect5 : '';
new ProcessBACS(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

View File

@ -1,68 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-bancontact.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}var l=u((function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"setupStripe",(function(){return r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key),r})),c(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");if(!document.getElementById("bancontact-name").value)return t.textContent=document.querySelector("meta[name=translation-name-required]").content,t.hidden=!1,void console.log("name");document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmBancontactPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("bancontact-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}));new l(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!************************************************************!*\
!*** ./resources/js/clients/payments/stripe-bancontact.js ***!
\************************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessBANCONTACTPay = /*#__PURE__*/_createClass(function ProcessBANCONTACTPay(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessBANCONTACTPay);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
return _this;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
var errors = document.getElementById('errors');
if (!document.getElementById('bancontact-name').value) {
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
errors.hidden = false;
console.log("name");
return;
}
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmBancontactPayment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
billing_details: {
name: document.getElementById("bancontact-name").value
}
},
return_url: document.querySelector('meta[name="return-url"]').content
});
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
});
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessBANCONTACTPay(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

View File

@ -1,137 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-becs.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,o;function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}function c(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}var u=function(){function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"setupStripe",(function(){o.stripeConnect?o.stripe=Stripe(o.key,{stripeAccount:o.stripeConnect}):o.stripe=Stripe(o.key);var e=o.stripe.elements(),t={style:{base:{color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"},":-webkit-autofill":{color:"#32325d"}},invalid:{color:"#fa755a",iconColor:"#fa755a",":-webkit-autofill":{color:"#fa755a"}}},disabled:!1,hideIcon:!1,iconStyle:"default"};return o.auBankAccount=e.create("auBankAccount",t),o.auBankAccount.mount("#becs-iban"),o})),c(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");return""===document.getElementById("becs-name").value?(document.getElementById("becs-name").focus(),t.textContent=document.querySelector("meta[name=translation-name-required]").content,void(t.hidden=!1)):""===document.getElementById("becs-email-address").value?(document.getElementById("becs-email-address").focus(),t.textContent=document.querySelector("meta[name=translation-email-required]").content,void(t.hidden=!1)):document.getElementById("becs-mandate-acceptance").checked?(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),void o.stripe.confirmAuBecsDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{au_becs_debit:o.auBankAccount,billing_details:{name:document.getElementById("becs-name").value,email:document.getElementById("becs-email-address").value}}}).then((function(e){return e.error?o.handleFailure(e.error.message):o.handleSuccess(e)}))):(document.getElementById("becs-mandate-acceptance").focus(),t.textContent=document.querySelector("meta[name=translation-terms-required]").content,t.hidden=!1,void console.log("Terms"))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}var t,n,o;return t=e,(n=[{key:"handleSuccess",value:function(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent),document.getElementById("server-response").submit()}},{key:"handleFailure",value:function(e){var t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}])&&a(t.prototype,n),o&&a(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();new u(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(o=document.querySelector('meta[name="stripe-account-id"]'))||void 0===o?void 0:o.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!******************************************************!*\
!*** ./resources/js/clients/payments/stripe-becs.js ***!
\******************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessBECS = /*#__PURE__*/function () {
function ProcessBECS(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessBECS);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
var elements = _this.stripe.elements();
var style = {
base: {
color: '#32325d',
fontSize: '16px',
'::placeholder': {
color: '#aab7c4'
},
':-webkit-autofill': {
color: '#32325d'
}
},
invalid: {
color: '#fa755a',
iconColor: '#fa755a',
':-webkit-autofill': {
color: '#fa755a'
}
}
};
var options = {
style: style,
disabled: false,
hideIcon: false,
iconStyle: "default" // or "solid"
};
_this.auBankAccount = elements.create("auBankAccount", options);
_this.auBankAccount.mount("#becs-iban");
return _this;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
var errors = document.getElementById('errors');
if (document.getElementById('becs-name').value === "") {
document.getElementById('becs-name').focus();
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
errors.hidden = false;
return;
}
if (document.getElementById('becs-email-address').value === "") {
document.getElementById('becs-email-address').focus();
errors.textContent = document.querySelector('meta[name=translation-email-required]').content;
errors.hidden = false;
return;
}
if (!document.getElementById('becs-mandate-acceptance').checked) {
document.getElementById('becs-mandate-acceptance').focus();
errors.textContent = document.querySelector('meta[name=translation-terms-required]').content;
errors.hidden = false;
console.log("Terms");
return;
}
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmAuBecsDebitPayment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
au_becs_debit: _this.auBankAccount,
billing_details: {
name: document.getElementById("becs-name").value,
email: document.getElementById("becs-email-address").value
}
}
}).then(function (result) {
if (result.error) {
return _this.handleFailure(result.error.message);
}
return _this.handleSuccess(result);
});
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
}
_createClass(ProcessBECS, [{
key: "handleSuccess",
value: function handleSuccess(result) {
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(result.paymentIntent);
document.getElementById('server-response').submit();
}
}, {
key: "handleFailure",
value: function handleFailure(message) {
var errors = document.getElementById('errors');
errors.textContent = '';
errors.textContent = message;
errors.hidden = false;
document.getElementById('pay-now').disabled = false;
document.querySelector('#pay-now > svg').classList.add('hidden');
document.querySelector('#pay-now > span').classList.remove('hidden');
}
}]);
return ProcessBECS;
}();
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessBECS(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

View File

@ -1,109 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-browserpay.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.key,u=void 0,u=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(u)?u:String(u)),o)}var i,u}(new(function(){function e(){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.clientSecret=null===(t=document.querySelector("meta[name=stripe-pi-client-secret]"))||void 0===t?void 0:t.content}var n,r,o;return n=e,(r=[{key:"init",value:function(){var e,t,n={};return document.querySelector("meta[name=stripe-account-id]")&&(n.apiVersion="2020-08-27",n.stripeAccount=null===(t=document.querySelector("meta[name=stripe-account-id]"))||void 0===t?void 0:t.content),this.stripe=Stripe(null===(e=document.querySelector("meta[name=stripe-publishable-key]"))||void 0===e?void 0:e.content,n),this.elements=this.stripe.elements(),this}},{key:"createPaymentRequest",value:function(){return this.paymentRequest=this.stripe.paymentRequest(JSON.parse(document.querySelector("meta[name=payment-request-data").content)),this}},{key:"createPaymentRequestButton",value:function(){this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest})}},{key:"handlePaymentRequestEvents",value:function(e,t){document.querySelector("#errors").hidden=!0,this.paymentRequest.on("paymentmethod",(function(n){e.confirmCardPayment(t,{payment_method:n.paymentMethod.id},{handleActions:!1}).then((function(r){r.error?(document.querySelector("#errors").innerText=r.error.message,document.querySelector("#errors").hidden=!1,n.complete("fail")):(n.complete("success"),"requires_action"===r.paymentIntent.status?e.confirmCardPayment(t).then((function(e){e.error?(n.complete("fail"),document.querySelector("#errors").innerText=e.error.message,document.querySelector("#errors").hidden=!1):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent),document.getElementById("server-response").submit())})):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(r.paymentIntent),document.getElementById("server-response").submit()))}))}))}},{key:"handle",value:function(){var e=this;this.init().createPaymentRequest().createPaymentRequestButton(),this.paymentRequest.canMakePayment().then((function(t){var n;if(t)return e.paymentRequestButton.mount("#payment-request-button");document.querySelector("#errors").innerHTML=JSON.parse(null===(n=document.querySelector("meta[name=no-available-methods]"))||void 0===n?void 0:n.content),document.querySelector("#errors").hidden=!1})),this.handlePaymentRequestEvents(this.stripe,this.clientSecret)}}])&&t(n.prototype,r),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!************************************************************!*\
!*** ./resources/js/clients/payments/stripe-browserpay.js ***!
\************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var StripeBrowserPay = /*#__PURE__*/function () {
function StripeBrowserPay() {
var _document$querySelect;
_classCallCheck(this, StripeBrowserPay);
this.clientSecret = (_document$querySelect = document.querySelector('meta[name=stripe-pi-client-secret]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content;
}
_createClass(StripeBrowserPay, [{
key: "init",
value: function init() {
var _document$querySelect3;
var config = {};
if (document.querySelector('meta[name=stripe-account-id]')) {
var _document$querySelect2;
config.apiVersion = '2020-08-27';
config.stripeAccount = (_document$querySelect2 = document.querySelector('meta[name=stripe-account-id]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content;
}
this.stripe = Stripe((_document$querySelect3 = document.querySelector('meta[name=stripe-publishable-key]')) === null || _document$querySelect3 === void 0 ? void 0 : _document$querySelect3.content, config);
this.elements = this.stripe.elements();
return this;
}
}, {
key: "createPaymentRequest",
value: function createPaymentRequest() {
this.paymentRequest = this.stripe.paymentRequest(JSON.parse(document.querySelector('meta[name=payment-request-data').content));
return this;
}
}, {
key: "createPaymentRequestButton",
value: function createPaymentRequestButton() {
this.paymentRequestButton = this.elements.create('paymentRequestButton', {
paymentRequest: this.paymentRequest
});
}
}, {
key: "handlePaymentRequestEvents",
value: function handlePaymentRequestEvents(stripe, clientSecret) {
document.querySelector('#errors').hidden = true;
this.paymentRequest.on('paymentmethod', function (ev) {
stripe.confirmCardPayment(clientSecret, {
payment_method: ev.paymentMethod.id
}, {
handleActions: false
}).then(function (confirmResult) {
if (confirmResult.error) {
document.querySelector('#errors').innerText = confirmResult.error.message;
document.querySelector('#errors').hidden = false;
ev.complete('fail');
} else {
ev.complete('success');
if (confirmResult.paymentIntent.status === 'requires_action') {
stripe.confirmCardPayment(clientSecret).then(function (result) {
if (result.error) {
ev.complete('fail');
document.querySelector('#errors').innerText = result.error.message;
document.querySelector('#errors').hidden = false;
} else {
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(result.paymentIntent);
document.getElementById('server-response').submit();
}
});
} else {
document.querySelector('input[name="gateway_response"]').value = JSON.stringify(confirmResult.paymentIntent);
document.getElementById('server-response').submit();
}
}
});
});
}
}, {
key: "handle",
value: function handle() {
var _this = this;
this.init().createPaymentRequest().createPaymentRequestButton();
this.paymentRequest.canMakePayment().then(function (result) {
var _document$querySelect4;
if (result) {
return _this.paymentRequestButton.mount('#payment-request-button');
}
document.querySelector('#errors').innerHTML = JSON.parse((_document$querySelect4 = document.querySelector('meta[name=no-available-methods]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content);
document.querySelector('#errors').hidden = false;
});
this.handlePaymentRequestEvents(this.stripe, this.clientSecret);
}
}]);
return StripeBrowserPay;
}();
new StripeBrowserPay().handle();
/******/ })()
;

File diff suppressed because one or more lines are too long

View File

@ -1,83 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-eps.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}var c=u((function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,"setupStripe",(function(){r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key);var e=r.stripe.elements();return r.eps=e.create("epsBank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}}),r.eps.mount("#eps-bank-element"),r})),a(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");if(!document.getElementById("eps-name").value)return t.textContent=document.querySelector("meta[name=translation-name-required]").content,void(t.hidden=!1);document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmEpsPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{eps:r.eps,billing_details:{name:document.getElementById("eps-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}));new c(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!*****************************************************!*\
!*** ./resources/js/clients/payments/stripe-eps.js ***!
\*****************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessEPSPay = /*#__PURE__*/_createClass(function ProcessEPSPay(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessEPSPay);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
var elements = _this.stripe.elements();
var options = {
style: {
base: {
padding: '10px 12px',
color: '#32325d',
fontSize: '16px',
'::placeholder': {
color: '#aab7c4'
}
}
}
};
_this.eps = elements.create('epsBank', options);
_this.eps.mount("#eps-bank-element");
return _this;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
var errors = document.getElementById('errors');
if (!document.getElementById('eps-name').value) {
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
errors.hidden = false;
return;
}
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmEpsPayment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
eps: _this.eps,
billing_details: {
name: document.getElementById("eps-name").value
}
},
return_url: document.querySelector('meta[name="return-url"]').content
});
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
});
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessEPSPay(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

View File

@ -1,93 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-fpx.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}var c=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),u(this,"setupStripe",(function(){r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key);var e=r.stripe.elements();return r.fpx=e.create("fpxBank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px"}},accountHolderType:"individual"}),r.fpx.mount("#fpx-bank-element"),r})),u(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmFpxPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{fpx:r.fpx},return_url:document.querySelector('meta[name="return-url"]').content}).then((function(e){e.error&&r.handleFailure(e.error.message)}))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}var t,n,r;return t=e,(n=[{key:"handleFailure",value:function(e){var t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}])&&i(t.prototype,n),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();new c(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!*****************************************************!*\
!*** ./resources/js/clients/payments/stripe-fpx.js ***!
\*****************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessFPXPay = /*#__PURE__*/function () {
function ProcessFPXPay(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessFPXPay);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
var elements = _this.stripe.elements();
var style = {
base: {
// Add your base input styles here. For example:
padding: '10px 12px',
color: '#32325d',
fontSize: '16px'
}
};
_this.fpx = elements.create('fpxBank', {
style: style,
accountHolderType: 'individual'
});
_this.fpx.mount("#fpx-bank-element");
return _this;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmFpxPayment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
fpx: _this.fpx
},
return_url: document.querySelector('meta[name="return-url"]').content
}).then(function (result) {
if (result.error) {
_this.handleFailure(result.error.message);
}
});
;
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
}
_createClass(ProcessFPXPay, [{
key: "handleFailure",
value: function handleFailure(message) {
var errors = document.getElementById('errors');
errors.textContent = '';
errors.textContent = message;
errors.hidden = false;
document.getElementById('pay-now').disabled = false;
document.querySelector('#pay-now > svg').classList.add('hidden');
document.querySelector('#pay-now > span').classList.remove('hidden');
}
}]);
return ProcessFPXPay;
}();
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessFPXPay(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

View File

@ -1,68 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-giropay.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return(t=a(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}var l=u((function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"setupStripe",(function(){return r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key),r})),c(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");if(!document.getElementById("giropay-mandate-acceptance").checked)return t.textContent=document.querySelector("meta[name=translation-terms-required]").content,t.hidden=!1,void console.log("Terms");document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmGiropayPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("giropay-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}));new l(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!*********************************************************!*\
!*** ./resources/js/clients/payments/stripe-giropay.js ***!
\*********************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessGiroPay = /*#__PURE__*/_createClass(function ProcessGiroPay(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessGiroPay);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
return _this;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
var errors = document.getElementById('errors');
if (!document.getElementById('giropay-mandate-acceptance').checked) {
errors.textContent = document.querySelector('meta[name=translation-terms-required]').content;
errors.hidden = false;
console.log("Terms");
return;
}
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmGiropayPayment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
billing_details: {
name: document.getElementById("giropay-name").value
}
},
return_url: document.querySelector('meta[name="return-url"]').content
});
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
});
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessGiroPay(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

View File

@ -1,84 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-ideal.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}var c=a((function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"setupStripe",(function(){r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key);var e=r.stripe.elements();return r.ideal=e.create("idealBank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}}),r.ideal.mount("#ideal-bank-element"),r})),l(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");if(!document.getElementById("ideal-name").value)return t.textContent=document.querySelector("meta[name=translation-name-required]").content,t.hidden=!1,void console.log("name");document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmIdealPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{ideal:r.ideal,billing_details:{name:document.getElementById("ideal-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}));new c(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!*******************************************************!*\
!*** ./resources/js/clients/payments/stripe-ideal.js ***!
\*******************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessIDEALPay = /*#__PURE__*/_createClass(function ProcessIDEALPay(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessIDEALPay);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
var elements = _this.stripe.elements();
var options = {
style: {
base: {
padding: '10px 12px',
color: '#32325d',
fontSize: '16px',
'::placeholder': {
color: '#aab7c4'
}
}
}
};
_this.ideal = elements.create('idealBank', options);
_this.ideal.mount("#ideal-bank-element");
return _this;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
var errors = document.getElementById('errors');
if (!document.getElementById('ideal-name').value) {
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
errors.hidden = false;
console.log("name");
return;
}
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmIdealPayment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
ideal: _this.ideal,
billing_details: {
name: document.getElementById("ideal-name").value
}
},
return_url: document.querySelector('meta[name="return-url"]').content
});
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
});
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessIDEALPay(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

View File

@ -1,92 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-klarna.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,u(r.key),r)}}function c(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t,n){return(t=u(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}var l=c((function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"setupStripe",(function(){return r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key),r})),i(this,"handleError",(function(e){document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),r.errors.textContent="",r.errors.textContent=e,r.errors.hidden=!1})),i(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors"),n=document.getElementById("klarna-name").value;/^[A-Za-z\s]*$/.test(n)?(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmKlarnaPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:n,email:document.querySelector("meta[name=email]").content,address:{line1:document.querySelector("meta[name=address-1]").content,line2:document.querySelector("meta[name=address-2]").content,city:document.querySelector("meta[name=city]").content,postal_code:document.querySelector("meta[name=postal_code]").content,state:document.querySelector("meta[name=state]").content,country:document.querySelector("meta[name=country]").content}}},return_url:document.querySelector('meta[name="return-url"]').content}).then((function(e){if(e.hasOwnProperty("error"))return r.handleError(e.error.message)}))):(document.getElementById("klarna-name-correction").hidden=!1,document.getElementById("klarna-name").textContent=n.replace(/^[A-Za-z\s]*$/,""),document.getElementById("klarna-name").focus(),t.textContent=document.querySelector("meta[name=translation-name-without-special-characters]").content,t.hidden=!1)}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}));new l(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!********************************************************!*\
!*** ./resources/js/clients/payments/stripe-klarna.js ***!
\********************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessKlarna = /*#__PURE__*/_createClass(function ProcessKlarna(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessKlarna);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
return _this;
});
_defineProperty(this, "handleError", function (message) {
document.getElementById('pay-now').disabled = false;
document.querySelector('#pay-now > svg').classList.add('hidden');
document.querySelector('#pay-now > span').classList.remove('hidden');
_this.errors.textContent = '';
_this.errors.textContent = message;
_this.errors.hidden = false;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
var errors = document.getElementById('errors');
var name = document.getElementById("klarna-name").value;
if (!/^[A-Za-z\s]*$/.test(name)) {
document.getElementById('klarna-name-correction').hidden = false;
document.getElementById('klarna-name').textContent = name.replace(/^[A-Za-z\s]*$/, "");
document.getElementById('klarna-name').focus();
errors.textContent = document.querySelector('meta[name=translation-name-without-special-characters]').content;
errors.hidden = false;
} else {
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmKlarnaPayment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
billing_details: {
name: name,
email: document.querySelector('meta[name=email]').content,
address: {
line1: document.querySelector('meta[name=address-1]').content,
line2: document.querySelector('meta[name=address-2]').content,
city: document.querySelector('meta[name=city]').content,
postal_code: document.querySelector('meta[name=postal_code]').content,
state: document.querySelector('meta[name=state]').content,
country: document.querySelector('meta[name=country]').content
}
}
},
return_url: document.querySelector('meta[name="return-url"]').content
}).then(function (result) {
if (result.hasOwnProperty('error')) {
return _this.handleError(result.error.message);
}
});
}
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
});
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessKlarna(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

View File

@ -1,117 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-przelewy24.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,o;function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,d(o.key),o)}}function c(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!==r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}var u=c((function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"setupStripe",(function(){o.stripeConnect?o.stripe=Stripe(o.key,{stripeAccount:o.stripeConnect}):o.stripe=Stripe(o.key);var e=o.stripe.elements();return o.p24bank=e.create("p24Bank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}}),o.p24bank.mount("#p24-bank-element"),o})),i(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){var t=document.getElementById("errors");return""===document.getElementById("p24-name").value?(document.getElementById("p24-name").focus(),t.textContent=document.querySelector("meta[name=translation-name-required]").content,void(t.hidden=!1)):""===document.getElementById("p24-email-address").value?(document.getElementById("p24-email-address").focus(),t.textContent=document.querySelector("meta[name=translation-email-required]").content,void(t.hidden=!1)):document.getElementById("p24-mandate-acceptance").checked?(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),void o.stripe.confirmP24Payment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{p24:o.p24bank,billing_details:{name:document.getElementById("p24-name").value,email:document.getElementById("p24-email-address").value}},payment_method_options:{p24:{tos_shown_and_accepted:document.getElementById("p24-mandate-acceptance").checked}},return_url:document.querySelector('meta[name="return-url"]').content}).then((function(e){e.error?(t.textContent=e.error.message,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")):"succeeded"===e.paymentIntent.status&&(window.location=document.querySelector('meta[name="return-url"]').content)}))):(document.getElementById("p24-mandate-acceptance").focus(),t.textContent=document.querySelector("meta[name=translation-terms-required]").content,void(t.hidden=!1))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}));new u(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(o=document.querySelector('meta[name="stripe-account-id"]'))||void 0===o?void 0:o.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!************************************************************!*\
!*** ./resources/js/clients/payments/stripe-przelewy24.js ***!
\************************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessPRZELEWY24 = /*#__PURE__*/_createClass(function ProcessPRZELEWY24(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessPRZELEWY24);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
var elements = _this.stripe.elements();
var options = {
// Custom styling can be passed to options when creating an Element
style: {
base: {
padding: '10px 12px',
color: '#32325d',
fontSize: '16px',
'::placeholder': {
color: '#aab7c4'
}
}
}
};
_this.p24bank = elements.create('p24Bank', options);
_this.p24bank.mount('#p24-bank-element');
return _this;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
var errors = document.getElementById('errors');
if (document.getElementById('p24-name').value === "") {
document.getElementById('p24-name').focus();
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
errors.hidden = false;
return;
}
if (document.getElementById('p24-email-address').value === "") {
document.getElementById('p24-email-address').focus();
errors.textContent = document.querySelector('meta[name=translation-email-required]').content;
errors.hidden = false;
return;
}
if (!document.getElementById('p24-mandate-acceptance').checked) {
document.getElementById('p24-mandate-acceptance').focus();
errors.textContent = document.querySelector('meta[name=translation-terms-required]').content;
errors.hidden = false;
return;
}
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmP24Payment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
p24: _this.p24bank,
billing_details: {
name: document.getElementById('p24-name').value,
email: document.getElementById('p24-email-address').value
}
},
payment_method_options: {
p24: {
tos_shown_and_accepted: document.getElementById('p24-mandate-acceptance').checked
}
},
return_url: document.querySelector('meta[name="return-url"]').content
}).then(function (result) {
if (result.error) {
// Show error to your customer
errors.textContent = result.error.message;
errors.hidden = false;
document.getElementById('pay-now').disabled = false;
document.querySelector('#pay-now > svg').classList.add('hidden');
document.querySelector('#pay-now > span').classList.remove('hidden');
} else {
// The payment has been processed!
if (result.paymentIntent.status === 'succeeded') {
window.location = document.querySelector('meta[name="return-url"]').content;
}
}
});
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
});
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessPRZELEWY24(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

File diff suppressed because one or more lines are too long

View File

@ -1,61 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see stripe-sofort.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{var e,t,n,r;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,l(r.key),r)}}function u(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===o(t)?t:String(t)}var a=u((function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"setupStripe",(function(){return r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key),r})),c(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmSofortPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{sofort:{country:document.querySelector('meta[name="country"]').content}},return_url:document.querySelector('meta[name="return-url"]').content})}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}));new a(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
/*!********************************************************!*\
!*** ./resources/js/clients/payments/stripe-sofort.js ***!
\********************************************************/
var _document$querySelect, _document$querySelect2, _document$querySelect3, _document$querySelect4;
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ProcessSOFORT = /*#__PURE__*/_createClass(function ProcessSOFORT(key, stripeConnect) {
var _this = this;
_classCallCheck(this, ProcessSOFORT);
_defineProperty(this, "setupStripe", function () {
if (_this.stripeConnect) {
// this.stripe.stripeAccount = this.stripeConnect;
_this.stripe = Stripe(_this.key, {
stripeAccount: _this.stripeConnect
});
} else {
_this.stripe = Stripe(_this.key);
}
return _this;
});
_defineProperty(this, "handle", function () {
document.getElementById('pay-now').addEventListener('click', function (e) {
document.getElementById('pay-now').disabled = true;
document.querySelector('#pay-now > svg').classList.remove('hidden');
document.querySelector('#pay-now > span').classList.add('hidden');
_this.stripe.confirmSofortPayment(document.querySelector('meta[name=pi-client-secret').content, {
payment_method: {
sofort: {
country: document.querySelector('meta[name="country"]').content
}
},
return_url: document.querySelector('meta[name="return-url"]').content
});
});
});
this.key = key;
this.errors = document.getElementById('errors');
this.stripeConnect = stripeConnect;
});
var publishableKey = (_document$querySelect = (_document$querySelect2 = document.querySelector('meta[name="stripe-publishable-key"]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content) !== null && _document$querySelect !== void 0 ? _document$querySelect : '';
var stripeConnect = (_document$querySelect3 = (_document$querySelect4 = document.querySelector('meta[name="stripe-account-id"]')) === null || _document$querySelect4 === void 0 ? void 0 : _document$querySelect4.content) !== null && _document$querySelect3 !== void 0 ? _document$querySelect3 : '';
new ProcessSOFORT(publishableKey, stripeConnect).setupStripe().handle();
/******/ })()
;

File diff suppressed because one or more lines are too long

View File

@ -1,95 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see accept.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.key,u=void 0,u=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(u)?u:String(u)),o)}var i,u}var n=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shouldDisplaySignature=t,this.shouldDisplayTerms=n,this.termsAccepted=!1}var n,r,o;return n=e,(r=[{key:"submitForm",value:function(){document.getElementById("approve-form").submit()}},{key:"displaySignature",value:function(){document.getElementById("displaySignatureModal").removeAttribute("style");var e=new SignaturePad(document.getElementById("signature-pad"),{penColor:"rgb(0, 0, 0)"});e.onEnd=function(){document.getElementById("signature-next-step").disabled=!1},this.signaturePad=e}},{key:"displayTerms",value:function(){document.getElementById("displayTermsModal").removeAttribute("style")}},{key:"handle",value:function(){var e=this;document.getElementById("signature-next-step").disabled=!0,document.getElementById("approve-button").addEventListener("click",(function(){e.shouldDisplaySignature&&e.shouldDisplayTerms&&(e.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){e.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=e.signaturePad.toDataURL(),e.termsAccepted=!0,e.submitForm()}))}))),e.shouldDisplaySignature&&!e.shouldDisplayTerms&&(e.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=e.signaturePad.toDataURL(),e.submitForm()}))),!e.shouldDisplaySignature&&e.shouldDisplayTerms&&(e.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){e.termsAccepted=!0,e.submitForm()}))),e.shouldDisplaySignature||e.shouldDisplayTerms||e.submitForm()}))}}])&&t(n.prototype,r),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}(),r=document.querySelector('meta[name="require-purchase_order-signature"]').content,o=document.querySelector('meta[name="show-purchase_order-terms"]').content;new n(Boolean(+r),Boolean(+o)).handle()})();
/*!********************************************************!*\
!*** ./resources/js/clients/purchase_orders/accept.js ***!
\********************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var Accept = /*#__PURE__*/function () {
function Accept(displaySignature, displayTerms) {
_classCallCheck(this, Accept);
this.shouldDisplaySignature = displaySignature;
this.shouldDisplayTerms = displayTerms;
this.termsAccepted = false;
}
_createClass(Accept, [{
key: "submitForm",
value: function submitForm() {
document.getElementById('approve-form').submit();
}
}, {
key: "displaySignature",
value: function displaySignature() {
var displaySignatureModal = document.getElementById('displaySignatureModal');
displaySignatureModal.removeAttribute('style');
var signaturePad = new SignaturePad(document.getElementById('signature-pad'), {
penColor: 'rgb(0, 0, 0)'
});
signaturePad.onEnd = function () {
document.getElementById("signature-next-step").disabled = false;
};
this.signaturePad = signaturePad;
}
}, {
key: "displayTerms",
value: function displayTerms() {
var displayTermsModal = document.getElementById("displayTermsModal");
displayTermsModal.removeAttribute("style");
}
}, {
key: "handle",
value: function handle() {
var _this = this;
document.getElementById("signature-next-step").disabled = true;
document.getElementById('approve-button').addEventListener('click', function () {
if (_this.shouldDisplaySignature && _this.shouldDisplayTerms) {
_this.displaySignature();
document.getElementById('signature-next-step').addEventListener('click', function () {
_this.displayTerms();
document.getElementById('accept-terms-button').addEventListener('click', function () {
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
_this.termsAccepted = true;
_this.submitForm();
});
});
}
if (_this.shouldDisplaySignature && !_this.shouldDisplayTerms) {
_this.displaySignature();
document.getElementById('signature-next-step').addEventListener('click', function () {
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
_this.submitForm();
});
}
if (!_this.shouldDisplaySignature && _this.shouldDisplayTerms) {
_this.displayTerms();
document.getElementById('accept-terms-button').addEventListener('click', function () {
_this.termsAccepted = true;
_this.submitForm();
});
}
if (!_this.shouldDisplaySignature && !_this.shouldDisplayTerms) {
_this.submitForm();
}
});
}
}]);
return Accept;
}();
var signature = document.querySelector('meta[name="require-purchase_order-signature"]').content;
var terms = document.querySelector('meta[name="show-purchase_order-terms"]').content;
new Accept(Boolean(+signature), Boolean(+terms)).handle();
/******/ })()
;

View File

@ -1,112 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see action-selectors.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,u=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){l=!0,c=e},f:function(){try{u||null==r.return||r.return()}finally{if(l)throw c}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.key,c=void 0,c=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(c)?c:String(c)),o)}var i,c}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var n,o,i;return n=e,o=[{key:"watchCheckboxes",value:function(e){var t=this;document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),document.querySelectorAll(".form-check-child").forEach((function(n){e.checked?(n.checked=e.checked,t.processChildItem(n,document.getElementById("bulkActions"))):(n.checked=!1,document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})))}))}},{key:"processChildItem",value:function(e,n){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),!1!==e.checked){var r=document.createElement("INPUT");r.setAttribute("name","purchase_orders[]"),r.setAttribute("value",e.dataset.value),r.setAttribute("class","child-hidden-input"),r.hidden=!0,n.append(r)}else{var o,i=t(document.querySelectorAll("input.child-hidden-input"));try{for(i.s();!(o=i.n()).done;){var c=o.value;c.value==e.dataset.value&&c.remove()}}catch(e){i.e(e)}finally{i.f()}}}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var n,r=t(document.querySelectorAll(".form-check-child"));try{var o=function(){var t=n.value;t.addEventListener("click",(function(){e.processChildItem(t,e.parentForm)}))};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}}}],o&&r(n.prototype,o),i&&r(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!******************************************************************!*\
!*** ./resources/js/clients/purchase_orders/action-selectors.js ***!
\******************************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ActionSelectors = /*#__PURE__*/function () {
function ActionSelectors() {
_classCallCheck(this, ActionSelectors);
this.parentElement = document.querySelector('.form-check-parent');
this.parentForm = document.getElementById('bulkActions');
}
_createClass(ActionSelectors, [{
key: "watchCheckboxes",
value: function watchCheckboxes(parentElement) {
var _this = this;
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
return element.remove();
});
document.querySelectorAll('.form-check-child').forEach(function (child) {
if (parentElement.checked) {
child.checked = parentElement.checked;
_this.processChildItem(child, document.getElementById('bulkActions'));
} else {
child.checked = false;
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
return element.remove();
});
}
});
}
}, {
key: "processChildItem",
value: function processChildItem(element, parent) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (options.hasOwnProperty('single')) {
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
return element.remove();
});
}
if (element.checked === false) {
var inputs = document.querySelectorAll('input.child-hidden-input');
var _iterator = _createForOfIteratorHelper(inputs),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var i = _step.value;
if (i.value == element.dataset.value) i.remove();
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return;
}
var _temp = document.createElement('INPUT');
_temp.setAttribute('name', 'purchase_orders[]');
_temp.setAttribute('value', element.dataset.value);
_temp.setAttribute('class', 'child-hidden-input');
_temp.hidden = true;
parent.append(_temp);
}
}, {
key: "handle",
value: function handle() {
var _this2 = this;
this.parentElement.addEventListener('click', function () {
_this2.watchCheckboxes(_this2.parentElement);
});
var _iterator2 = _createForOfIteratorHelper(document.querySelectorAll('.form-check-child')),
_step2;
try {
var _loop = function _loop() {
var child = _step2.value;
child.addEventListener('click', function () {
_this2.processChildItem(child, _this2.parentForm);
});
};
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
_loop();
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
}]);
return ActionSelectors;
}();
/** @handle **/
new ActionSelectors().handle();
/******/ })()
;

View File

@ -1,112 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see action-selectors.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,u=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){l=!0,c=e},f:function(){try{u||null==r.return||r.return()}finally{if(l)throw c}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.key,c=void 0,c=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i,"string"),"symbol"===e(c)?c:String(c)),o)}var i,c}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentElement=document.querySelector(".form-check-parent"),this.parentForm=document.getElementById("bulkActions")}var n,o,i;return n=e,o=[{key:"watchCheckboxes",value:function(e){var t=this;document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),document.querySelectorAll(".form-check-child").forEach((function(n){e.checked?(n.checked=e.checked,t.processChildItem(n,document.getElementById("bulkActions"))):(n.checked=!1,document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})))}))}},{key:"processChildItem",value:function(e,n){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).hasOwnProperty("single")&&document.querySelectorAll(".child-hidden-input").forEach((function(e){return e.remove()})),!1!==e.checked){var r=document.createElement("INPUT");r.setAttribute("name","quotes[]"),r.setAttribute("value",e.dataset.value),r.setAttribute("class","child-hidden-input"),r.hidden=!0,n.append(r)}else{var o,i=t(document.querySelectorAll("input.child-hidden-input"));try{for(i.s();!(o=i.n()).done;){var c=o.value;c.value==e.dataset.value&&c.remove()}}catch(e){i.e(e)}finally{i.f()}}}},{key:"handle",value:function(){var e=this;this.parentElement.addEventListener("click",(function(){e.watchCheckboxes(e.parentElement)}));var n,r=t(document.querySelectorAll(".form-check-child"));try{var o=function(){var t=n.value;t.addEventListener("click",(function(){e.processChildItem(t,e.parentForm)}))};for(r.s();!(n=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}}}],o&&r(n.prototype,o),i&&r(n,i),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!*********************************************************!*\
!*** ./resources/js/clients/quotes/action-selectors.js ***!
\*********************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var ActionSelectors = /*#__PURE__*/function () {
function ActionSelectors() {
_classCallCheck(this, ActionSelectors);
this.parentElement = document.querySelector('.form-check-parent');
this.parentForm = document.getElementById('bulkActions');
}
_createClass(ActionSelectors, [{
key: "watchCheckboxes",
value: function watchCheckboxes(parentElement) {
var _this = this;
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
return element.remove();
});
document.querySelectorAll('.form-check-child').forEach(function (child) {
if (parentElement.checked) {
child.checked = parentElement.checked;
_this.processChildItem(child, document.getElementById('bulkActions'));
} else {
child.checked = false;
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
return element.remove();
});
}
});
}
}, {
key: "processChildItem",
value: function processChildItem(element, parent) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
if (options.hasOwnProperty('single')) {
document.querySelectorAll('.child-hidden-input').forEach(function (element) {
return element.remove();
});
}
if (element.checked === false) {
var inputs = document.querySelectorAll('input.child-hidden-input');
var _iterator = _createForOfIteratorHelper(inputs),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var i = _step.value;
if (i.value == element.dataset.value) i.remove();
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return;
}
var _temp = document.createElement('INPUT');
_temp.setAttribute('name', 'quotes[]');
_temp.setAttribute('value', element.dataset.value);
_temp.setAttribute('class', 'child-hidden-input');
_temp.hidden = true;
parent.append(_temp);
}
}, {
key: "handle",
value: function handle() {
var _this2 = this;
this.parentElement.addEventListener('click', function () {
_this2.watchCheckboxes(_this2.parentElement);
});
var _iterator2 = _createForOfIteratorHelper(document.querySelectorAll('.form-check-child')),
_step2;
try {
var _loop = function _loop() {
var child = _step2.value;
child.addEventListener('click', function () {
_this2.processChildItem(child, _this2.parentForm);
});
};
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
_loop();
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
}]);
return ActionSelectors;
}();
/** @handle **/
new ActionSelectors().handle();
/******/ })()
;

View File

@ -1,122 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see approve.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var u=0;u<n.length;u++){var o=n[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(r=o.key,i=void 0,i=function(t,n){if("object"!==e(t)||null===t)return t;var u=t[Symbol.toPrimitive];if(void 0!==u){var o=u.call(t,n||"default");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(r,"string"),"symbol"===e(i)?i:String(i)),o)}var r,i}var n=function(){function e(t,n,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.shouldDisplaySignature=t,this.shouldDisplayTerms=n,this.shouldDisplayUserInput=u,this.termsAccepted=!1}var n,u,o;return n=e,(u=[{key:"submitForm",value:function(){document.getElementById("approve-form").submit()}},{key:"displaySignature",value:function(){document.getElementById("displaySignatureModal").removeAttribute("style");var e=new SignaturePad(document.getElementById("signature-pad"),{penColor:"rgb(0, 0, 0)"});e.onEnd=function(){document.getElementById("signature-next-step").disabled=!1},this.signaturePad=e}},{key:"displayTerms",value:function(){document.getElementById("displayTermsModal").removeAttribute("style")}},{key:"displayInput",value:function(){document.getElementById("displayInputModal").removeAttribute("style")}},{key:"handle",value:function(){var e=this;document.getElementById("signature-next-step").disabled=!0,document.getElementById("close_button").addEventListener("click",(function(){var e=document.getElementById("approve-button");e&&(e.disabled=!1)})),document.getElementById("hide_close").addEventListener("click",(function(){var e=document.getElementById("approve-button");e&&(e.disabled=!1)})),document.getElementById("approve-button").addEventListener("click",(function(){e.shouldDisplaySignature||e.shouldDisplayTerms||!e.shouldDisplayUserInput||(e.displayInput(),document.getElementById("input-next-step").addEventListener("click",(function(){document.querySelector('input[name="user_input"').value=document.getElementById("user_input").value,e.termsAccepted=!0,e.submitForm()}))),e.shouldDisplayUserInput&&e.displayInput(),e.shouldDisplaySignature&&e.shouldDisplayTerms&&(e.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){e.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=e.signaturePad.toDataURL(),document.querySelector('input[name="user_input"').value=document.getElementById("user_input").value,e.termsAccepted=!0,e.submitForm()}))}))),e.shouldDisplaySignature&&!e.shouldDisplayTerms&&(e.displaySignature(),document.getElementById("signature-next-step").addEventListener("click",(function(){document.querySelector('input[name="signature"').value=e.signaturePad.toDataURL(),document.querySelector('input[name="user_input"').value=document.getElementById("user_input").value,e.submitForm()}))),!e.shouldDisplaySignature&&e.shouldDisplayTerms&&(e.displayTerms(),document.getElementById("accept-terms-button").addEventListener("click",(function(){e.termsAccepted=!0,e.submitForm()}))),e.shouldDisplaySignature||e.shouldDisplayTerms||e.shouldDisplayUserInput||e.submitForm()}))}}])&&t(n.prototype,u),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}(),u=document.querySelector('meta[name="require-quote-signature"]').content,o=document.querySelector('meta[name="show-quote-terms"]').content,r=document.querySelector('meta[name="accept-user-input"]').content;new n(Boolean(+u),Boolean(+o),Boolean(+r)).handle()})();
/*!************************************************!*\
!*** ./resources/js/clients/quotes/approve.js ***!
\************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var Approve = /*#__PURE__*/function () {
function Approve(displaySignature, displayTerms, userInput) {
_classCallCheck(this, Approve);
this.shouldDisplaySignature = displaySignature;
this.shouldDisplayTerms = displayTerms;
this.shouldDisplayUserInput = userInput;
this.termsAccepted = false;
}
_createClass(Approve, [{
key: "submitForm",
value: function submitForm() {
document.getElementById('approve-form').submit();
}
}, {
key: "displaySignature",
value: function displaySignature() {
var displaySignatureModal = document.getElementById('displaySignatureModal');
displaySignatureModal.removeAttribute('style');
var signaturePad = new SignaturePad(document.getElementById('signature-pad'), {
penColor: 'rgb(0, 0, 0)'
});
signaturePad.onEnd = function () {
document.getElementById("signature-next-step").disabled = false;
};
this.signaturePad = signaturePad;
}
}, {
key: "displayTerms",
value: function displayTerms() {
var displayTermsModal = document.getElementById("displayTermsModal");
displayTermsModal.removeAttribute("style");
}
}, {
key: "displayInput",
value: function displayInput() {
var displayInputModal = document.getElementById("displayInputModal");
displayInputModal.removeAttribute("style");
}
}, {
key: "handle",
value: function handle() {
var _this = this;
document.getElementById("signature-next-step").disabled = true;
document.getElementById("close_button").addEventListener('click', function () {
var approveButton = document.getElementById("approve-button");
if (approveButton) approveButton.disabled = false;
});
document.getElementById("hide_close").addEventListener('click', function () {
var approveButton = document.getElementById("approve-button");
if (approveButton) approveButton.disabled = false;
});
document.getElementById('approve-button').addEventListener('click', function () {
if (!_this.shouldDisplaySignature && !_this.shouldDisplayTerms && _this.shouldDisplayUserInput) {
_this.displayInput();
document.getElementById('input-next-step').addEventListener('click', function () {
document.querySelector('input[name="user_input"').value = document.getElementById('user_input').value;
_this.termsAccepted = true;
_this.submitForm();
});
}
if (_this.shouldDisplayUserInput) _this.displayInput();
if (_this.shouldDisplaySignature && _this.shouldDisplayTerms) {
_this.displaySignature();
document.getElementById('signature-next-step').addEventListener('click', function () {
_this.displayTerms();
document.getElementById('accept-terms-button').addEventListener('click', function () {
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
document.querySelector('input[name="user_input"').value = document.getElementById('user_input').value;
_this.termsAccepted = true;
_this.submitForm();
});
});
}
if (_this.shouldDisplaySignature && !_this.shouldDisplayTerms) {
_this.displaySignature();
document.getElementById('signature-next-step').addEventListener('click', function () {
document.querySelector('input[name="signature"').value = _this.signaturePad.toDataURL();
document.querySelector('input[name="user_input"').value = document.getElementById('user_input').value;
_this.submitForm();
});
}
if (!_this.shouldDisplaySignature && _this.shouldDisplayTerms) {
_this.displayTerms();
document.getElementById('accept-terms-button').addEventListener('click', function () {
_this.termsAccepted = true;
_this.submitForm();
});
}
if (!_this.shouldDisplaySignature && !_this.shouldDisplayTerms && !_this.shouldDisplayUserInput) {
_this.submitForm();
}
});
}
}]);
return Approve;
}();
var signature = document.querySelector('meta[name="require-quote-signature"]').content;
var terms = document.querySelector('meta[name="show-quote-terms"]').content;
var user_input = document.querySelector('meta[name="accept-user-input"]').content;
new Approve(Boolean(+signature), Boolean(+terms), Boolean(+user_input)).handle();
/******/ })()
;

View File

@ -1,30 +1 @@
/******/ (() => { // webpackBootstrap window.appendToElement=function(e,t){var n=document.getElementById(e),a=n.querySelector('input[value="'.concat(t,'"]'));if(a)return a.remove();var r=document.createElement("INPUT");r.setAttribute("name","file_hash[]"),r.setAttribute("value",t),r.hidden=!0,n.append(r)};
var __webpack_exports__ = {};
/*!***********************************************************!*\
!*** ./resources/js/clients/shared/multiple-downloads.js ***!
\***********************************************************/
/**
* 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
*/
var appendToElement = function appendToElement(parent, value) {
var _parent = document.getElementById(parent);
var _possibleElement = _parent.querySelector("input[value=\"".concat(value, "\"]"));
if (_possibleElement) {
return _possibleElement.remove();
}
var _temp = document.createElement('INPUT');
_temp.setAttribute('name', 'file_hash[]');
_temp.setAttribute('value', value);
_temp.hidden = true;
_parent.append(_temp);
};
window.appendToElement = appendToElement;
/******/ })()
;

File diff suppressed because one or more lines are too long

View File

@ -1,92 +1,2 @@
/******/ (() => { // webpackBootstrap /*! For license information please see view.js.LICENSE.txt */
var __webpack_exports__ = {}; (()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var a=0;a<n.length;a++){var r=n[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(o=r.key,i=void 0,i=function(t,n){if("object"!==e(t)||null===t)return t;var a=t[Symbol.toPrimitive];if(void 0!==a){var r=a.call(t,n||"default");if("object"!==e(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(o,"string"),"symbol"===e(i)?i:String(i)),r)}var o,i}(new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=new URL(document.querySelector("meta[name=pdf-url]").content),this.startDate="",this.endDate="",this.showPaymentsTable=!1,this.showAgingTable=!1,this.status=""}var n,a,r;return n=e,(a=[{key:"bindEventListeners",value:function(){var e=this;["#date-from","#date-to","#show-payments-table","#show-aging-table","#status"].forEach((function(t){document.querySelector(t).addEventListener("change",(function(t){return e.handleValueChange(t)}))}))}},{key:"handleValueChange",value:function(e){"checkbox"===e.target.type?this[e.target.dataset.field]=e.target.checked:this[e.target.dataset.field]=e.target.value,this.updatePdf()}},{key:"composedUrl",get:function(){return this.url.search="",this.startDate.length>0&&this.url.searchParams.append("start_date",this.startDate),this.endDate.length>0&&this.url.searchParams.append("end_date",this.endDate),this.url.searchParams.append("status",document.getElementById("status").value),this.url.searchParams.append("show_payments_table",+this.showPaymentsTable),this.url.searchParams.append("show_aging_table",+this.showAgingTable),this.url.href}},{key:"updatePdf",value:function(){document.querySelector("meta[name=pdf-url]").content=this.composedUrl;var e=document.querySelector("#pdf-iframe");e&&(e.src=this.composedUrl),document.querySelector("meta[name=pdf-url]").dispatchEvent(new Event("change"))}},{key:"handle",value:function(){var e=this;this.bindEventListeners(),document.querySelector("#pdf-download").addEventListener("click",(function(){var t=new URL(e.composedUrl);t.searchParams.append("download",1),window.location.href=t.href}))}}])&&t(n.prototype,a),r&&t(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}())).handle()})();
/*!*************************************************!*\
!*** ./resources/js/clients/statements/view.js ***!
\*************************************************/
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**
* 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
*/
var Statement = /*#__PURE__*/function () {
function Statement() {
_classCallCheck(this, Statement);
this.url = new URL(document.querySelector('meta[name=pdf-url]').content);
this.startDate = '';
this.endDate = '';
this.showPaymentsTable = false;
this.showAgingTable = false;
this.status = '';
}
_createClass(Statement, [{
key: "bindEventListeners",
value: function bindEventListeners() {
var _this = this;
['#date-from', '#date-to', '#show-payments-table', '#show-aging-table', '#status'].forEach(function (selector) {
document.querySelector(selector).addEventListener('change', function (event) {
return _this.handleValueChange(event);
});
});
}
}, {
key: "handleValueChange",
value: function handleValueChange(event) {
if (event.target.type === 'checkbox') {
this[event.target.dataset.field] = event.target.checked;
} else {
this[event.target.dataset.field] = event.target.value;
}
this.updatePdf();
}
}, {
key: "composedUrl",
get: function get() {
this.url.search = '';
if (this.startDate.length > 0) {
this.url.searchParams.append('start_date', this.startDate);
}
if (this.endDate.length > 0) {
this.url.searchParams.append('end_date', this.endDate);
}
this.url.searchParams.append('status', document.getElementById("status").value);
this.url.searchParams.append('show_payments_table', +this.showPaymentsTable);
this.url.searchParams.append('show_aging_table', +this.showAgingTable);
return this.url.href;
}
}, {
key: "updatePdf",
value: function updatePdf() {
document.querySelector('meta[name=pdf-url]').content = this.composedUrl;
var iframe = document.querySelector('#pdf-iframe');
if (iframe) {
iframe.src = this.composedUrl;
}
document.querySelector('meta[name=pdf-url]').dispatchEvent(new Event('change'));
}
}, {
key: "handle",
value: function handle() {
var _this2 = this;
this.bindEventListeners();
document.querySelector('#pdf-download').addEventListener('click', function () {
var url = new URL(_this2.composedUrl);
url.searchParams.append('download', 1);
window.location.href = url.href;
});
}
}]);
return Statement;
}();
new Statement().handle();
/******/ })()
;

2581
public/js/setup/setup.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,50 +1,50 @@
{ {
"/js/app.js": "/js/app.js?id=9218850cdcc0d44aa4fd44902dddcbdd", "/js/app.js": "/js/app.js?id=5524b72f53decd8646cccb755463a439",
"/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=ea294eebff703ca14291cbeb12338049", "/js/clients/payment_methods/authorize-authorize-card.js": "/js/clients/payment_methods/authorize-authorize-card.js?id=de200526aa5e16f122b26dd11714391f",
"/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=53c6971a83c45633f4fbe9c0ed5bea69", "/js/clients/payments/authorize-credit-card-payment.js": "/js/clients/payments/authorize-credit-card-payment.js?id=28c6e2e3b8584209750ec797abd57b8a",
"/js/clients/payments/forte-credit-card-payment.js": "/js/clients/payments/forte-credit-card-payment.js?id=e0353a2f6f12f14c17281339a7c2f5d4", "/js/clients/payments/forte-credit-card-payment.js": "/js/clients/payments/forte-credit-card-payment.js?id=742fca4583f213392cb844711a49b2ce",
"/js/clients/payments/forte-ach-payment.js": "/js/clients/payments/forte-ach-payment.js?id=6117769573e1c2a2e9189caa1ff54f0f", "/js/clients/payments/forte-ach-payment.js": "/js/clients/payments/forte-ach-payment.js?id=62d113b98b07272f392b21e979e0d0ba",
"/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=32b5f29a6c9d02be4baa5c703114f06b", "/js/clients/payments/stripe-ach.js": "/js/clients/payments/stripe-ach.js?id=ad6d146046d6620ecd1b9099a3024c0e",
"/js/clients/payments/stripe-klarna.js": "/js/clients/payments/stripe-klarna.js?id=ff92c0544201d015e77ea693a38ed7bb", "/js/clients/payments/stripe-klarna.js": "/js/clients/payments/stripe-klarna.js?id=f862fba4c2ad388924f685b606a4aa73",
"/js/clients/payments/stripe-bacs.js": "/js/clients/payments/stripe-bacs.js?id=a82927936510bbecc60de3e9742f9739", "/js/clients/payments/stripe-bacs.js": "/js/clients/payments/stripe-bacs.js?id=bd1dfe80784c553e92b16469eae7900f",
"/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=b7601721afa9599518ba894a0f88f947", "/js/clients/invoices/action-selectors.js": "/js/clients/invoices/action-selectors.js?id=1e8e982cd4b1e0894ada9ddd81904b44",
"/js/clients/purchase_orders/action-selectors.js": "/js/clients/purchase_orders/action-selectors.js?id=b9c510dffa8420879983f04cd521564c", "/js/clients/purchase_orders/action-selectors.js": "/js/clients/purchase_orders/action-selectors.js?id=413b068356493f0a82297ef2917afa39",
"/js/clients/purchase_orders/accept.js": "/js/clients/purchase_orders/accept.js?id=d13b4a7934c9f7ddf2154f8f233843f7", "/js/clients/purchase_orders/accept.js": "/js/clients/purchase_orders/accept.js?id=68fbfc0f7860bac2d7d4d2d97ae474a9",
"/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=1bd5f983e7d9394fe9ac603dea94e901", "/js/clients/invoices/payment.js": "/js/clients/invoices/payment.js?id=1591a5f9c4ff43abd35c3c20356a63d5",
"/js/clients/payments/stripe-sofort.js": "/js/clients/payments/stripe-sofort.js?id=f0252b9b140b667794c252ae200cd844", "/js/clients/payments/stripe-sofort.js": "/js/clients/payments/stripe-sofort.js?id=7d8da38106d6118468cb0c54ff94d2ff",
"/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=360b39d82a1a7dd90a8351776fbd9edb", "/js/clients/payments/stripe-alipay.js": "/js/clients/payments/stripe-alipay.js?id=884043ff9b0470ffd3e0a178d1fb5ae6",
"/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=a2168c43060a7de40da20b5fc599bcab", "/js/clients/payments/checkout-credit-card.js": "/js/clients/payments/checkout-credit-card.js?id=fcec00da23f4c369e88ae11943f3e584",
"/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=4158693089b29ee8e13cb7d9ce4480a9", "/js/clients/quotes/action-selectors.js": "/js/clients/quotes/action-selectors.js?id=112daa8c26bead8ac750fad6657a98e3",
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=4e596cec23cdd6487534e6ed5499d791", "/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=673e0f7dba1f8c434ba4f4986dd7caab",
"/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=b483e14d15000c04edfe4c9c80fb97c9", "/js/clients/payments/stripe-credit-card.js": "/js/clients/payments/stripe-credit-card.js?id=312c2c2aa8ae271553bdc6cf78bcc240",
"/js/setup/setup.js": "/js/setup/setup.js?id=086b9e114b0b9ee01f909d686f489162", "/js/setup/setup.js": "/js/setup/setup.js?id=322b7094e15864ebfb279d081cca4cbb",
"/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=cf50b5ba1fcd1d184bf0c10d710672c8", "/js/clients/payments/card-js.min.js": "/js/clients/payments/card-js.min.js?id=8ce33c3deae058ad314fb8357e5be63b",
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=c9593b44d66f89874d13f99bc3e6ff33", "/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=c56abb7bbd2858e2c05ef233cf55b738",
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=bc6756a5ef373ffab30373a6b689d5d4", "/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=c2caa29f753ad1f3a12ca45acddacd72",
"/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=a9c53bbbced7b1f09cae117f667638cf", "/js/clients/linkify-urls.js": "/js/clients/linkify-urls.js?id=f7ed588c8fc0c0d0f797fceda02186b6",
"/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=e0020a4104a2d88c21e47ec6679de7ef", "/js/clients/payments/braintree-credit-card.js": "/js/clients/payments/braintree-credit-card.js?id=980e2160fb353255bdff7bb3b2cdccad",
"/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=881f15cb83dc9d0412625da80f094912", "/js/clients/payments/braintree-paypal.js": "/js/clients/payments/braintree-paypal.js?id=291022039fd61c69e1698f0ec90c03f2",
"/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=b8b588f18e7c692faa44b598f3f1bde0", "/js/clients/payments/wepay-credit-card.js": "/js/clients/payments/wepay-credit-card.js?id=e42d2b8bb79ffff0200be1642d50e0b9",
"/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=e984eca06a662d2e8a8e01cae085794c", "/js/clients/payment_methods/wepay-bank-account.js": "/js/clients/payment_methods/wepay-bank-account.js?id=e9a6676729e321462bb624c50c4a3a7b",
"/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=800e95b9c19d54e844338d619e87c9dc", "/js/clients/payments/paytrace-credit-card.js": "/js/clients/payments/paytrace-credit-card.js?id=22fb1f440cd3082d01accd67d4f0c7cc",
"/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=2f72b969507e6135b5c52a65522ab3ae", "/js/clients/payments/mollie-credit-card.js": "/js/clients/payments/mollie-credit-card.js?id=c3375527e885a7b024120c3967dd19cd",
"/js/clients/payments/eway-credit-card.js": "/js/clients/payments/eway-credit-card.js?id=0d1c8957b02c5601b7d57c39740bff75", "/js/clients/payments/eway-credit-card.js": "/js/clients/payments/eway-credit-card.js?id=8162b0469c5218d7fd301a4080249042",
"/js/clients/payment_methods/braintree-ach.js": "/js/clients/payment_methods/braintree-ach.js?id=2f8e5af9ba5ce266d2ee49b084fbe291", "/js/clients/payment_methods/braintree-ach.js": "/js/clients/payment_methods/braintree-ach.js?id=6d8c7fd66d911b20cdc4248e33db1b3a",
"/js/clients/payments/square-credit-card.js": "/js/clients/payments/square-credit-card.js?id=dbd7a15777def575562153c984dee08a", "/js/clients/payments/square-credit-card.js": "/js/clients/payments/square-credit-card.js?id=58aeca10f8f447661287728bf4e440fd",
"/js/clients/statements/view.js": "/js/clients/statements/view.js?id=bd92ab50acabf1cc5232912d53edc5e1", "/js/clients/statements/view.js": "/js/clients/statements/view.js?id=37a28ced2efd619daffa98d3b12c1f97",
"/js/clients/payments/razorpay-aio.js": "/js/clients/payments/razorpay-aio.js?id=46e14d31acaf3adf58444a5de4b4122c", "/js/clients/payments/razorpay-aio.js": "/js/clients/payments/razorpay-aio.js?id=c36ab5621413ef1de7c864bc8eb7439e",
"/js/clients/payments/stripe-sepa.js": "/js/clients/payments/stripe-sepa.js?id=ef15c0865a29c3c17f2ad185cad0d28e", "/js/clients/payments/stripe-sepa.js": "/js/clients/payments/stripe-sepa.js?id=65d8a745bc5736c656fac4c5dafe8717",
"/js/clients/payment_methods/authorize-checkout-card.js": "/js/clients/payment_methods/authorize-checkout-card.js?id=38def7b43d7695875353f09d3ba11be1", "/js/clients/payment_methods/authorize-checkout-card.js": "/js/clients/payment_methods/authorize-checkout-card.js?id=a26baff6b079f79d30b6350f4327783c",
"/js/clients/payments/stripe-giropay.js": "/js/clients/payments/stripe-giropay.js?id=31fae79367ff993d8c0b1918724bfbc4", "/js/clients/payments/stripe-giropay.js": "/js/clients/payments/stripe-giropay.js?id=8ec3ee20b3e09dcb1ffea041ae443562",
"/js/clients/payments/stripe-acss.js": "/js/clients/payments/stripe-acss.js?id=f49af556241905075ef430c627a95985", "/js/clients/payments/stripe-acss.js": "/js/clients/payments/stripe-acss.js?id=85cff56605a5728911e81a9532fd8359",
"/js/clients/payments/stripe-bancontact.js": "/js/clients/payments/stripe-bancontact.js?id=dc6b3505addd46df15140a3d82a4d29c", "/js/clients/payments/stripe-bancontact.js": "/js/clients/payments/stripe-bancontact.js?id=318579fedd1f1568fa8af567f780e617",
"/js/clients/payments/stripe-becs.js": "/js/clients/payments/stripe-becs.js?id=c8a98800b332dcf3d04e53d7861daf81", "/js/clients/payments/stripe-becs.js": "/js/clients/payments/stripe-becs.js?id=c171fd113b7c237b43e216baec8bd20f",
"/js/clients/payments/stripe-eps.js": "/js/clients/payments/stripe-eps.js?id=a9bd55d319d39df27b3060ba3c6b51c5", "/js/clients/payments/stripe-eps.js": "/js/clients/payments/stripe-eps.js?id=3039e7c1070d53b44add14d4113d405a",
"/js/clients/payments/stripe-ideal.js": "/js/clients/payments/stripe-ideal.js?id=f51becad6d18dcdbd0f6b9a89babaa63", "/js/clients/payments/stripe-ideal.js": "/js/clients/payments/stripe-ideal.js?id=0872ba4c3886d219715888baaa9bb9b9",
"/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=c1805d2540b702bdfb4f937a6fbacebc", "/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=7bbc988e7ab37f51271b7621ea5998d9",
"/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=a5661ec2569bdb34790e63eb5ef79183", "/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=8d34ee8a4e03dc963a76d9c7cee73ce5",
"/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=afee40cfa284ef0ff89dad3f355e105f", "/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=22fe819dc03e9d1cde1b77336a3394a3",
"/css/app.css": "/css/app.css?id=d4370807a966dea9ca16eb6b898999cd", "/css/app.css": "/css/app.css?id=5546215a0dbaa0a1b7c771f729201de4",
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ada60afcedcb7c", "/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ada60afcedcb7c",
"/vendor/clipboard.min.js": "/vendor/clipboard.min.js?id=15f52a1ee547f2bdd46e56747332ca2d" "/vendor/clipboard.min.js": "/vendor/clipboard.min.js?id=15f52a1ee547f2bdd46e56747332ca2d"
} }

View File

@ -23,7 +23,7 @@
} }
.badge-warning { .badge-warning {
@apply bg-yellow-100 text-yellow-600; @apply bg-blue-500 text-yellow-600;
} }
.badge-info { .badge-info {

View File

@ -388,10 +388,8 @@ $entity_images
]; ];
tables.forEach((tableIdentifier) => { tables.forEach((tableIdentifier) => {
console.log(document.getElementById(tableIdentifier)); document.getElementById(tableIdentifier).childElementCount === 0
? document.getElementById(tableIdentifier).style.display = 'none'
document.getElementById(tableIdentifier)?.childElementCount === 0
? document.getElementById(tableIdentifier).style.setProperty('display', 'none', 'important')
: ''; : '';
}); });
}); });

View File

@ -1458,7 +1458,8 @@ Ensure the default browser behavior of the `hidden` attribute.
id="name" id="name"
placeholder="{{ ctrans('texts.name') }}" placeholder="{{ ctrans('texts.name') }}"
name="name" name="name"
value="{{$client->present()->name()}}" value="{{$client->name}}"
required
/> />
</div> </div>
<div class="form-group mb-[10px]"> <div class="form-group mb-[10px]">
@ -1822,6 +1823,23 @@ var country_value = e.options[e.selectedIndex].value;
.getElementById('pay-now') .getElementById('pay-now')
.addEventListener('click', () => { .addEventListener('click', () => {
//make sure the user has entered their name
if (document.querySelector('input[name=name]').value == '') {
let errors = document.getElementById('errors');
let payNowButton = document.getElementById('pay-now');
errors.textContent = '';
errors.textContent = "{{ ctrans('texts.please_enter_a_name') }}";
errors.hidden = false;
payNowButton.disabled = false;
payNowButton.querySelector('svg').classList.add('hidden');
payNowButton.querySelector('span').classList.remove('hidden');
return;
}
let payNowButton = document.getElementById('pay-now'); let payNowButton = document.getElementById('pay-now');
payNowButton = payNowButton; payNowButton = payNowButton;
payNowButton.disabled = true; payNowButton.disabled = true;
@ -1832,6 +1850,7 @@ var country_value = e.options[e.selectedIndex].value;
payment_method_data: { payment_method_data: {
billing_details: { billing_details: {
name: document.querySelector('input[name=name]').content, name: document.querySelector('input[name=name]').content,
email: '{{ $client->present()->email() }}',
address: { address: {
line1: document.querySelector('input[name=address1]').content, line1: document.querySelector('input[name=address1]').content,
line2: document.querySelector('input[name=address2]').content, line2: document.querySelector('input[name=address2]').content,

View File

@ -89,7 +89,7 @@ class ReminderTest extends TestCase
$this->invoice = $this->invoice->fresh(); $this->invoice = $this->invoice->fresh();
$this->assertEquals(now()->addMonth()->format('Y-m-d'), Carbon::parse($this->invoice->next_send_date)->format('Y-m-d')); $this->assertEquals(now()->addMonthNoOverflow()->format('Y-m-d'), Carbon::parse($this->invoice->next_send_date)->format('Y-m-d'));
} }

View File

@ -184,6 +184,8 @@ trait MockAccountData
*/ */
public $scheduler; public $scheduler;
public $contact;
public function makeTestData() public function makeTestData()
{ {
config(['database.default' => config('ninja.db.default')]); config(['database.default' => config('ninja.db.default')]);
@ -326,6 +328,8 @@ trait MockAccountData
'send_email' => true, 'send_email' => true,
]); ]);
$this->contact = $contact;
$this->payment = Payment::factory()->create([ $this->payment = Payment::factory()->create([
'user_id' => $user_id, 'user_id' => $user_id,
'client_id' => $this->client->id, 'client_id' => $this->client->id,