mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 13:24:30 -04:00
Stripe: New payment flow (#67)
* stripe: ach * stripe: klarna * stripe: bank transfer * assets build * stripe: bacs * stripe: bancontact * stripe: becs * stripe: eps * stripe: fpx * stripe: giropay * stripe: ideal * stripe: przelewy24 * stripe: sepa * stripe: sofort * assets build * assets build * pass context payload into livewirePaymentView * update checkout.com * update livewire method interface * stripe: acss * align methods with interface (array $data)
This commit is contained in:
parent
1f7904e317
commit
0de492d96f
@ -54,17 +54,20 @@ class ProcessPayment extends Component
|
||||
|
||||
$company_gateway = CompanyGateway::find($this->getContext()['company_gateway_id']);
|
||||
|
||||
if(!$responder_data['success']) {
|
||||
if (!$responder_data['success']) {
|
||||
throw new PaymentFailed($responder_data['error'], 400);
|
||||
}
|
||||
|
||||
$driver = $company_gateway
|
||||
->driver($invitation->contact->client)
|
||||
->setPaymentMethod($data['payment_method_id'])
|
||||
->setPaymentHash($responder_data['payload']['ph']);
|
||||
->driver($invitation->contact->client)
|
||||
->setPaymentMethod($data['payment_method_id'])
|
||||
->setPaymentHash($responder_data['payload']['ph']);
|
||||
|
||||
$this->payment_view = $driver->livewirePaymentView();
|
||||
$this->payment_data_payload = $driver->processPaymentViewData($responder_data['payload']);
|
||||
|
||||
$this->payment_view = $driver->livewirePaymentView(
|
||||
$this->payment_data_payload,
|
||||
);
|
||||
|
||||
$this->isLoading = false;
|
||||
|
||||
|
@ -165,7 +165,7 @@ class CreditCard implements MethodInterface, LivewireMethodInterface
|
||||
return render('gateways.checkout.credit_card.pay', $data);
|
||||
}
|
||||
|
||||
public function livewirePaymentView(): string
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.checkout.credit_card.livewire_pay';
|
||||
}
|
||||
|
@ -630,8 +630,8 @@ class CheckoutComPaymentDriver extends BaseDriver implements LivewireMethodInter
|
||||
});
|
||||
}
|
||||
|
||||
public function livewirePaymentView(): string
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return $this->payment_method->livewirePaymentView();
|
||||
return $this->payment_method->livewirePaymentView($data);
|
||||
}
|
||||
}
|
||||
|
@ -18,5 +18,5 @@ interface LivewireMethodInterface
|
||||
*
|
||||
* @param array $data
|
||||
*/
|
||||
public function livewirePaymentView(): string;
|
||||
public function livewirePaymentView(array $data): string;
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ use App\Models\Payment;
|
||||
use App\Models\PaymentHash;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Exception;
|
||||
@ -35,7 +36,7 @@ use Stripe\Exception\InvalidRequestException;
|
||||
use Stripe\Exception\RateLimitException;
|
||||
use Stripe\PaymentIntent;
|
||||
|
||||
class ACH
|
||||
class ACH implements LivewireMethodInterface
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
@ -199,47 +200,7 @@ class ACH
|
||||
*/
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['currency'] = $this->stripe->client->getCurrencyCode();
|
||||
$data['payment_method_id'] = GatewayType::BANK_TRANSFER;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer();
|
||||
$data['amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
|
||||
$description = $this->stripe->getDescription(false);
|
||||
|
||||
$intent = false;
|
||||
|
||||
if (count($data['tokens']) == 1) {
|
||||
|
||||
$token = $data['tokens'][0];
|
||||
|
||||
$meta = $token->meta;
|
||||
|
||||
if(isset($meta->state) && $meta->state == 'unauthorized') {
|
||||
return redirect()->route('client.payment_methods.show', $token->hashed_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($data['tokens']) == 0) {
|
||||
$intent =
|
||||
$this->stripe->createPaymentIntent(
|
||||
[
|
||||
'amount' => $data['amount'],
|
||||
'currency' => $data['currency'],
|
||||
'setup_future_usage' => 'off_session',
|
||||
'customer' => $data['customer']->id,
|
||||
'payment_method_types' => ['us_bank_account'],
|
||||
'description' => $description,
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::BANK_TRANSFER,
|
||||
],
|
||||
'statement_descriptor' => $this->stripe->getStatementDescriptor(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$data['client_secret'] = $intent ? $intent->client_secret : false;
|
||||
$this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.ach.pay', $data);
|
||||
}
|
||||
@ -628,4 +589,56 @@ class ACH
|
||||
return $this->stripe->processInternallyFailedPayment($this->stripe, $e);
|
||||
}
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.ach.pay_livewire';
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['currency'] = $this->stripe->client->getCurrencyCode();
|
||||
$data['payment_method_id'] = GatewayType::BANK_TRANSFER;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer();
|
||||
$data['amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
|
||||
$description = $this->stripe->getDescription(false);
|
||||
|
||||
$intent = false;
|
||||
|
||||
if (count($data['tokens']) == 1) {
|
||||
|
||||
$token = $data['tokens'][0];
|
||||
|
||||
$meta = $token->meta;
|
||||
|
||||
if(isset($meta->state) && $meta->state == 'unauthorized') {
|
||||
return redirect()->route('client.payment_methods.show', $token->hashed_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($data['tokens']) == 0) {
|
||||
$intent =
|
||||
$this->stripe->createPaymentIntent(
|
||||
[
|
||||
'amount' => $data['amount'],
|
||||
'currency' => $data['currency'],
|
||||
'setup_future_usage' => 'off_session',
|
||||
'customer' => $data['customer']->id,
|
||||
'payment_method_types' => ['us_bank_account'],
|
||||
'description' => $description,
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::BANK_TRANSFER,
|
||||
],
|
||||
'statement_descriptor' => $this->stripe->getStatementDescriptor(),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
$data['client_secret'] = $intent ? $intent->client_secret : false;
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ use App\Models\SystemLog;
|
||||
use App\Models\GatewayType;
|
||||
use App\Models\PaymentHash;
|
||||
use App\Models\PaymentType;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Http\Requests\Request;
|
||||
use App\Jobs\Util\SystemLogger;
|
||||
@ -29,7 +30,7 @@ use App\PaymentDrivers\StripePaymentDriver;
|
||||
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
|
||||
use Stripe\PaymentIntent;
|
||||
|
||||
class ACSS
|
||||
class ACSS implements LivewireMethodInterface
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
@ -127,7 +128,7 @@ class ACSS
|
||||
$this->stripe->setClient($hash->fee_invoice->client);
|
||||
$this->stripe->setPaymentMethod(GatewayType::ACSS);
|
||||
|
||||
return $this->continuePayment($data);
|
||||
return $this->paymentView($data);
|
||||
}
|
||||
|
||||
return redirect()->route('client.payment_methods.show', $client_gateway_token->hashed_id);
|
||||
@ -161,73 +162,43 @@ class ACSS
|
||||
return $intent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment view for ACSS
|
||||
*
|
||||
* Determines if any payment tokens are available and if not, generates a mandate
|
||||
*
|
||||
* @param array $data
|
||||
|
||||
*/
|
||||
public function paymentView(array $data)
|
||||
public function paymentData(array $data)
|
||||
{
|
||||
|
||||
if(count($data['tokens']) == 0) {
|
||||
$hash = Str::random(32);
|
||||
|
||||
Cache::put($hash, $data, 3600);
|
||||
|
||||
$data['post_auth_response'] = $hash;
|
||||
$data['needs_mandate_generate'] = true;
|
||||
|
||||
return $this->generateMandate($data);
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['company_gateway'] = $this->stripe->company_gateway;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\SetupIntent::create([
|
||||
'usage' => 'off_session',
|
||||
'payment_method_types' => ['acss_debit'],
|
||||
'customer' => $data['customer'],
|
||||
'payment_method_options' => [
|
||||
'acss_debit' => [
|
||||
'currency' => 'cad',
|
||||
'mandate_options' => [
|
||||
'payment_schedule' => 'combined',
|
||||
'interval_description' => 'On any invoice due date',
|
||||
'transaction_type' => 'personal',
|
||||
],
|
||||
'verification_method' => 'instant',
|
||||
],
|
||||
],
|
||||
], $this->stripe->stripe_connect_auth);
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
return $this->continuePayment($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a payment Mandate for ACSS
|
||||
*
|
||||
* @param array $data
|
||||
|
||||
*/
|
||||
private function generateMandate(array $data)
|
||||
{
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['company_gateway'] = $this->stripe->company_gateway;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\SetupIntent::create([
|
||||
'usage' => 'off_session',
|
||||
'payment_method_types' => ['acss_debit'],
|
||||
'customer' => $data['customer'],
|
||||
'payment_method_options' => [
|
||||
'acss_debit' => [
|
||||
'currency' => 'cad',
|
||||
'mandate_options' => [
|
||||
'payment_schedule' => 'combined',
|
||||
'interval_description' => 'On any invoice due date',
|
||||
'transaction_type' => 'personal',
|
||||
],
|
||||
'verification_method' => 'instant',
|
||||
],
|
||||
],
|
||||
], $this->stripe->stripe_connect_auth);
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
return render('gateways.stripe.acss.authorize', array_merge($data));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Continues the payment flow after a Mandate has been successfully generated
|
||||
*
|
||||
* @param array $data
|
||||
*/
|
||||
private function continuePayment(array $data)
|
||||
{
|
||||
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
@ -240,6 +211,25 @@ class ACSS
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment view for ACSS
|
||||
*
|
||||
* Determines if any payment tokens are available and if not, generates a mandate
|
||||
*
|
||||
* @param array $data
|
||||
|
||||
*/
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
if (array_key_exists('needs_mandate_generate', $data)) {
|
||||
return render('gateways.stripe.acss.authorize', array_merge($data));
|
||||
}
|
||||
|
||||
return render('gateways.stripe.acss.pay', $data);
|
||||
}
|
||||
|
||||
@ -399,4 +389,13 @@ class ACSS
|
||||
return $this->stripe->processInternallyFailedPayment($this->stripe, $e);
|
||||
}
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
if (array_key_exists('needs_mandate_generate', $data)) {
|
||||
return 'gateways.stripe.acss.authorize_livewire';
|
||||
}
|
||||
|
||||
return 'gateways.stripe.acss.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -20,12 +20,13 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\Stripe\Jobs\UpdateCustomer;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
use App\Utils\Number;
|
||||
use Stripe\Checkout\Session;
|
||||
|
||||
class BACS
|
||||
class BACS implements LivewireMethodInterface
|
||||
{
|
||||
public $stripe;
|
||||
|
||||
@ -69,9 +70,7 @@ class BACS
|
||||
}
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['amount'] = $data['total']['amount_with_fee'];
|
||||
$data['payment_hash'] = $this->stripe->payment_hash->hash;
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.bacs.pay', $data);
|
||||
}
|
||||
@ -187,4 +186,18 @@ class BACS
|
||||
return $this->stripe->processInternallyFailedPayment($this->stripe, $e);
|
||||
}
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['amount'] = $data['total']['amount_with_fee'];
|
||||
$data['payment_hash'] = $this->stripe->payment_hash->hash;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.bacs.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class BECS
|
||||
class BECS implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -39,33 +40,7 @@ class BECS
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['payment_method_id'] = GatewayType::BECS;
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
$data['payment_hash'] = $this->stripe->payment_hash->hash;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => $this->stripe->client->currency()->code,
|
||||
'payment_method_types' => ['au_becs_debit'],
|
||||
'setup_future_usage' => 'off_session',
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::BECS,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.becs.pay', $data);
|
||||
}
|
||||
@ -161,4 +136,42 @@ class BECS
|
||||
return $this->stripe->processInternallyFailedPayment($this->stripe, $e);
|
||||
}
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['payment_method_id'] = GatewayType::BECS;
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
$data['payment_hash'] = $this->stripe->payment_hash->hash;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => $this->stripe->client->currency()->code,
|
||||
'payment_method_types' => ['au_becs_debit'],
|
||||
'setup_future_usage' => 'off_session',
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::BECS,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.becs.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class Bancontact
|
||||
class Bancontact implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -37,32 +38,7 @@ class Bancontact
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['bancontact'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::BANCONTACT,
|
||||
],
|
||||
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.bancontact.pay', $data);
|
||||
}
|
||||
@ -143,4 +119,41 @@ class Bancontact
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['bancontact'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::BANCONTACT,
|
||||
],
|
||||
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.bancontact.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,13 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
use App\Utils\Number;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Stripe\PaymentIntent;
|
||||
|
||||
class BankTransfer
|
||||
class BankTransfer implements LivewireMethodInterface
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
@ -38,37 +39,7 @@ class BankTransfer
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
|
||||
'currency' => $this->stripe->client->currency()->code,
|
||||
'customer' => $this->stripe->findOrCreateCustomer()->id,
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'payment_method_types' => ['customer_balance'],
|
||||
'payment_method_data' => [
|
||||
'type' => 'customer_balance',
|
||||
],
|
||||
'payment_method_options' => [
|
||||
'customer_balance' => [
|
||||
'funding_type' => 'bank_transfer',
|
||||
'bank_transfer' => $this->resolveBankType()
|
||||
],
|
||||
],
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::DIRECT_DEBIT,
|
||||
],
|
||||
], $this->stripe->stripe_connect_auth);
|
||||
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency())]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
$data = [];
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['client_secret'] = $intent ? $intent->client_secret : false;
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.bank_transfer.pay', $data);
|
||||
}
|
||||
@ -317,4 +288,46 @@ class BankTransfer
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
|
||||
'currency' => $this->stripe->client->currency()->code,
|
||||
'customer' => $this->stripe->findOrCreateCustomer()->id,
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'payment_method_types' => ['customer_balance'],
|
||||
'payment_method_data' => [
|
||||
'type' => 'customer_balance',
|
||||
],
|
||||
'payment_method_options' => [
|
||||
'customer_balance' => [
|
||||
'funding_type' => 'bank_transfer',
|
||||
'bank_transfer' => $this->resolveBankType()
|
||||
],
|
||||
],
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::DIRECT_DEBIT,
|
||||
],
|
||||
], $this->stripe->stripe_connect_auth);
|
||||
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency())]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
$data = [];
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['client_secret'] = $intent ? $intent->client_secret : false;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.bank_transfer.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -240,10 +240,8 @@ class BrowserPay implements MethodInterface, LivewireMethodInterface
|
||||
|
||||
return str_replace(['https://', '/public'], '', $domain);
|
||||
}
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function livewirePaymentView(): string
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.browser_pay.pay_livewire';
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ class CreditCard implements LivewireMethodInterface
|
||||
return render('gateways.stripe.credit_card.pay', $data);
|
||||
}
|
||||
|
||||
public function livewirePaymentView(): string
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.credit_card.pay_livewire';
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class EPS
|
||||
class EPS implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -37,31 +38,7 @@ class EPS
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['eps'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::EPS,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.eps.pay', $data);
|
||||
}
|
||||
@ -142,4 +119,40 @@ class EPS
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['eps'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::EPS,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.eps.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class FPX
|
||||
class FPX implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -38,31 +39,7 @@ class FPX
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => $this->stripe->client->getCurrencyCode(),
|
||||
'payment_method_types' => ['fpx'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::FPX,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.fpx.pay', $data);
|
||||
}
|
||||
@ -143,4 +120,40 @@ class FPX
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 400);
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => $this->stripe->client->getCurrencyCode(),
|
||||
'payment_method_types' => ['fpx'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::FPX,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.fpx.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class GIROPAY
|
||||
class GIROPAY implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -37,31 +38,7 @@ class GIROPAY
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['giropay'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::GIROPAY,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.giropay.pay', $data);
|
||||
}
|
||||
@ -142,4 +119,40 @@ class GIROPAY
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['giropay'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::GIROPAY,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.giropay.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class Klarna
|
||||
class Klarna implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -37,33 +38,7 @@ class Klarna
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$description = $this->stripe->getDescription(false);
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => $this->stripe->client->getCurrencyCode(),
|
||||
'payment_method_types' => ['klarna'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $description,
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::KLARNA,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.klarna.pay', $data);
|
||||
}
|
||||
@ -142,4 +117,42 @@ class Klarna
|
||||
|
||||
throw new PaymentFailed(ctrans('texts.gateway_error'), 500);
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$description = $this->stripe->getDescription(false);
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => $this->stripe->client->getCurrencyCode(),
|
||||
'payment_method_types' => ['klarna'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $description,
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::KLARNA,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.klarna.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class PRZELEWY24
|
||||
class PRZELEWY24 implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -37,31 +38,7 @@ class PRZELEWY24
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['p24'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::PRZELEWY24,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.przelewy24.pay', $data);
|
||||
}
|
||||
@ -142,4 +119,40 @@ class PRZELEWY24
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['p24'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::PRZELEWY24,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.przelewy24.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class SEPA
|
||||
class SEPA implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -47,33 +48,7 @@ class SEPA
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['payment_method_id'] = GatewayType::SEPA;
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
$data['payment_hash'] = $this->stripe->payment_hash->hash;
|
||||
|
||||
$intent_data = [
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['sepa_debit'],
|
||||
'setup_future_usage' => 'off_session',
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::SEPA,
|
||||
],
|
||||
];
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create($intent_data, array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.sepa.pay', $data);
|
||||
}
|
||||
@ -176,4 +151,42 @@ class SEPA
|
||||
return $this->stripe->processInternallyFailedPayment($this->stripe, $e);
|
||||
}
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['payment_method_id'] = GatewayType::SEPA;
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
$data['payment_hash'] = $this->stripe->payment_hash->hash;
|
||||
|
||||
$intent_data = [
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['sepa_debit'],
|
||||
'setup_future_usage' => 'off_session',
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::SEPA,
|
||||
],
|
||||
];
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create($intent_data, array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.sepa.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class SOFORT
|
||||
class SOFORT implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -37,31 +38,7 @@ class SOFORT
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['sofort'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::SOFORT,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.sofort.pay', $data);
|
||||
}
|
||||
@ -137,4 +114,40 @@ class SOFORT
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['sofort'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::SOFORT,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.sofort.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -18,9 +18,10 @@ use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\Common\LivewireMethodInterface;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
|
||||
class iDeal
|
||||
class iDeal implements LivewireMethodInterface
|
||||
{
|
||||
/** @var StripePaymentDriver */
|
||||
public StripePaymentDriver $stripe;
|
||||
@ -37,31 +38,7 @@ class iDeal
|
||||
|
||||
public function paymentView(array $data)
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['ideal'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::IDEAL,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
$data = $this->paymentData($data);
|
||||
|
||||
return render('gateways.stripe.ideal.pay', $data);
|
||||
}
|
||||
@ -142,4 +119,40 @@ class iDeal
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
}
|
||||
|
||||
public function paymentData(array $data): array
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
|
||||
$data['client'] = $this->stripe->client;
|
||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||
|
||||
$intent = \Stripe\PaymentIntent::create([
|
||||
'amount' => $data['stripe_amount'],
|
||||
'currency' => 'eur',
|
||||
'payment_method_types' => ['ideal'],
|
||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||
'description' => $this->stripe->getDescription(false),
|
||||
'metadata' => [
|
||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||
'gateway_type_id' => GatewayType::IDEAL,
|
||||
],
|
||||
], array_merge($this->stripe->stripe_connect_auth, ['idempotency_key' => uniqid("st", true)]));
|
||||
|
||||
$data['pi_client_secret'] = $intent->client_secret;
|
||||
|
||||
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);
|
||||
$this->stripe->payment_hash->save();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return 'gateways.stripe.ideal.pay_livewire';
|
||||
}
|
||||
}
|
||||
|
@ -1042,8 +1042,8 @@ class StripePaymentDriver extends BaseDriver implements LivewireMethodInterface
|
||||
|
||||
}
|
||||
|
||||
public function livewirePaymentView(): string
|
||||
public function livewirePaymentView(array $data): string
|
||||
{
|
||||
return $this->payment_method->livewirePaymentView();
|
||||
return $this->payment_method->livewirePaymentView($data);
|
||||
}
|
||||
}
|
||||
|
9
public/build/assets/authorize-stripe-acss-f6bd46c1.js
vendored
Normal file
9
public/build/assets/authorize-stripe-acss-f6bd46c1.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import{w as y}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/y("#stripe-acss-authorize").then(()=>f());function f(){var i,l,o;let n;const a=(i=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:i.content,r=(l=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:l.content;a&&a.length>0?n=Stripe(r,{stripeAccount:a}):n=Stripe(r);const c=document.getElementById("acss-name"),s=document.getElementById("acss-email-address"),t=document.getElementById("authorize-acss"),d=(o=document.querySelector('meta[name="stripe-pi-client-secret"]'))==null?void 0:o.content,e=document.getElementById("errors");t.addEventListener("click",async u=>{u.preventDefault(),e.hidden=!0,t.disabled=!0;const m=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;if(s.value.length<3||!s.value.match(m)){e.textContent="Please enter a valid email address.",e.hidden=!1,t.disabled=!1;return}if(c.value.length<3){e.textContent="Please enter a name for the account holder.",e.hidden=!1,t.disabled=!1;return}const{setupIntent:p,error:h}=await n.confirmAcssDebitSetup(d,{payment_method:{billing_details:{name:c.value,email:s.value}}});document.getElementById("gateway_response").value=JSON.stringify(p??h),document.getElementById("server_response").submit()})}
|
@ -1,4 +1,4 @@
|
||||
import{w as o}from"./wait-d71d9fed.js";/**
|
||||
import{w as o}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
9
public/build/assets/stripe-ach-pay-22d14901.js
vendored
Normal file
9
public/build/assets/stripe-ach-pay-22d14901.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import{w as g}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/g("#stripe-ach-payment").then(()=>f());function f(){let d=document.getElementById("pay-now");d&&(Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",n=>{document.querySelector("input[name=source]").value=n.target.dataset.token})),d.addEventListener("click",function(){let e=document.getElementById("pay-now");e.disabled=!0,e.querySelector("svg").classList.remove("hidden"),e.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()})),document.getElementById("new-bank").addEventListener("click",e=>{var m,y;if(!document.getElementById("accept-terms").checked){errors.textContent="You must accept the mandate terms prior to making payment.",errors.hidden=!1;return}errors.hidden=!0;let n,t=document.querySelector('meta[name="stripe-publishable-key"]').content,o=(m=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:m.content;o?n=Stripe(t,{stripeAccount:o}):n=Stripe(t);let s=document.getElementById("new-bank");s.disabled=!0,s.querySelector("svg").classList.remove("hidden"),s.querySelector("span").classList.add("hidden"),e.preventDefault();const c=document.getElementById("account-holder-name-field"),r=document.getElementById("email-field"),u=(y=document.querySelector('meta[name="client_secret"]'))==null?void 0:y.content;n.collectBankAccountForPayment({clientSecret:u,params:{payment_method_type:"us_bank_account",payment_method_data:{billing_details:{name:c.value,email:r.value}}},expand:["payment_method"]}).then(({paymentIntent:i,error:l})=>{if(l)console.error(l.message),errors.textContent=l.message,errors.hidden=!1,a();else if(i.status==="requires_payment_method"){errors.textContent="We were unable to process the payment with this account, please try another one.",errors.hidden=!1,a();return}else if(i.status==="requires_confirmation"){let h=document.getElementById("bank_account_response");h.value=JSON.stringify(i),p(n,u)}a()})});function p(e,n){e.confirmUsBankAccountPayment(n).then(({paymentIntent:t,error:o})=>{var s,c;if(console.log(t),o)console.error(o.message);else if(t.status==="requires_payment_method")errors.textContent="We were unable to process the payment with this account, please try another one.",errors.hidden=!1,a();else if(t.status==="processing"){let r=document.getElementById("gateway_response");r.value=JSON.stringify(t),document.getElementById("server-response").submit()}else if(((s=t.next_action)==null?void 0:s.type)==="verify_with_microdeposits"||((c=t.next_action)==null?void 0:c.type)==="requires_source_action"){errors.textContent="You will receive an email with details on how to verify your bank account and process payment.",errors.hidden=!1,document.getElementById("new-bank").style.visibility="hidden";let r=document.getElementById("gateway_response");r.value=JSON.stringify(t),document.getElementById("server-response").submit()}})}function a(){let e=document.getElementById("new-bank");e.disabled=!1,e.querySelector("svg").classList.add("hidden"),e.querySelector("span").classList.remove("hidden")}}
|
@ -1,4 +1,4 @@
|
||||
var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);/**
|
||||
var d=Object.defineProperty;var c=(o,e,t)=>e in o?d(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var a=(o,e,t)=>(c(o,typeof e!="symbol"?e+"":e,t),t);import{i,w as l}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
@ -6,4 +6,4 @@ var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configura
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class l{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",t=>{document.querySelector("input[name=token]").value=t.target.dataset.token,console.log(t.target.dataset.token)})),document.getElementById("toggle-payment-with-new-account")&&document.getElementById("toggle-payment-with-new-account").addEventListener("click",e=>{document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),document.getElementById("pay-now-with-token")?document.getElementById("pay-now-with-token").addEventListener("click",e=>{document.querySelector("input[name=token]").value,document.getElementById("pay-now-with-token").disabled=!0,document.querySelector("#pay-now-with-token > svg").classList.remove("hidden"),document.querySelector("#pay-now-with-token > span").classList.add("hidden"),document.getElementById("server-response").submit()}):document.getElementById("pay-now").addEventListener("click",e=>{let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value);let o=document.getElementById("errors");if(o.textContent="",o.hidden=!0,document.getElementById("acss-name").value===""){document.getElementById("acss-name").focus(),o.textContent=document.querySelector("meta[name=translation-name-required]").content,o.hidden=!1;return}if(document.getElementById("acss-email-address").value===""){document.getElementById("acss-email-address").focus(),o.textContent=document.querySelector("meta[name=translation-email-required]").content,o.hidden=!1;return}document.getElementById("pay-now").disabled=!0,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(s=>s.error?this.handleFailure(s.error.message):this.handleSuccess(s))})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent),document.getElementById("server-response").submit()}handleFailure(e){let 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")}}var a;const m=((a=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:a.content)??"";var d;const u=((d=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:d.content)??"";new l(m,u).setupStripe().handle();
|
||||
*/class m{constructor(e,t){a(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));a(this,"handle",()=>{Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",t=>{document.querySelector("input[name=token]").value=t.target.dataset.token,console.log(t.target.dataset.token)})),document.getElementById("toggle-payment-with-new-account")&&document.getElementById("toggle-payment-with-new-account").addEventListener("click",e=>{document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),document.getElementById("pay-now-with-token")?document.getElementById("pay-now-with-token").addEventListener("click",e=>{document.querySelector("input[name=token]").value,document.getElementById("pay-now-with-token").disabled=!0,document.querySelector("#pay-now-with-token > svg").classList.remove("hidden"),document.querySelector("#pay-now-with-token > span").classList.add("hidden"),document.getElementById("server-response").submit()}):document.getElementById("pay-now").addEventListener("click",e=>{let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value);let n=document.getElementById("errors");if(n.textContent="",n.hidden=!0,document.getElementById("acss-name").value===""){document.getElementById("acss-name").focus(),n.textContent=document.querySelector("meta[name=translation-name-required]").content,n.hidden=!1;return}if(document.getElementById("acss-email-address").value===""){document.getElementById("acss-email-address").focus(),n.textContent=document.querySelector("meta[name=translation-email-required]").content,n.hidden=!1;return}document.getElementById("pay-now").disabled=!0,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(s=>s.error?this.handleFailure(s.error.message):this.handleSuccess(s))})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent),document.getElementById("server-response").submit()}handleFailure(e){let 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")}}function r(){var t,n;const o=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((n=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:n.content)??"";new m(o,e).setupStripe().handle()}i()?r():l("#stripe-acss-payment").then(()=>r());
|
@ -1,4 +1,4 @@
|
||||
var a=Object.defineProperty;var c=(n,e,t)=>e in n?a(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);/**
|
||||
var i=Object.defineProperty;var a=(n,e,t)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>(a(n,typeof e!="symbol"?e+"":e,t),t);import{w as c}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
@ -6,4 +6,4 @@ var a=Object.defineProperty;var c=(n,e,t)=>e in n?a(n,e,{enumerable:!0,configura
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class d{constructor(e,t){s(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));s(this,"payment_data");s(this,"handle",()=>{this.onlyAuthorization?document.getElementById("authorize-bacs").addEventListener("click",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}):(this.payNowButton=document.getElementById("pay-now"),document.getElementById("pay-now").addEventListener("click",e=>{this.payNowButton.disabled=!0,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")),this.payment_data.length>0?this.payment_data.forEach(e=>e.addEventListener("click",t=>{document.querySelector("input[name=token]").value=t.target.dataset.token})):(this.errors.textContent=document.querySelector("meta[name=translation-payment-method-required]").content,this.errors.hidden=!1,this.payNowButton.disabled=!0,this.payNowButton.querySelector("span").classList.remove("hidden"),this.payNowButton.querySelector("svg").classList.add("hidden")))});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t,this.onlyAuthorization=h}}var o;const u=((o=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:o.content)??"";var r;const l=((r=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:r.content)??"";var i;const h=((i=document.querySelector('meta[name="only-authorization"]'))==null?void 0:i.content)??"";new d(u,l).setupStripe().handle();
|
||||
*/class d{constructor(e,t){s(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));s(this,"payment_data");s(this,"handle",()=>{this.onlyAuthorization?document.getElementById("authorize-bacs").addEventListener("click",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}):(this.payNowButton=document.getElementById("pay-now"),document.getElementById("pay-now").addEventListener("click",e=>{this.payNowButton.disabled=!0,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")),this.payment_data.length>0?this.payment_data.forEach(e=>e.addEventListener("click",t=>{document.querySelector("input[name=token]").value=t.target.dataset.token})):(this.errors.textContent=document.querySelector("meta[name=translation-payment-method-required]").content,this.errors.hidden=!1,this.payNowButton.disabled=!0,this.payNowButton.querySelector("span").classList.remove("hidden"),this.payNowButton.querySelector("svg").classList.add("hidden")))});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t,this.onlyAuthorization=onlyAuthorization}}c("#stripe-bacs-payment").then(()=>{var t,o,r;const n=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";(r=document.querySelector('meta[name="only-authorization"]'))==null||r.content,new d(n,e).setupStripe().handle()});
|
9
public/build/assets/stripe-bancontact-743204e1.js
vendored
Normal file
9
public/build/assets/stripe-bancontact-743204e1.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
var c=Object.defineProperty;var s=(n,t,e)=>t in n?c(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(s(n,typeof t!="symbol"?t+"":t,e),e);import{w as a}from"./wait-8f4ae121.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
|
||||
*/class i{constructor(t,e){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("bancontact-name").value){e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1,console.log("name");return}document.getElementById("pay-now").disabled=!0,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=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}a("#stripe-bancontact-payment").then(()=>{var e,o;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new i(n,t).setupStripe().handle()});
|
@ -1,9 +0,0 @@
|
||||
var s=Object.defineProperty;var a=(n,e,t)=>e in n?s(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(a(n,typeof e!="symbol"?e+"":e,t),t);/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class i{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{let t=document.getElementById("errors");if(!document.getElementById("bancontact-name").value){t.textContent=document.querySelector("meta[name=translation-name-required]").content,t.hidden=!1,console.log("name");return}document.getElementById("pay-now").disabled=!0,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=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}var o;const m=((o=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:o.content)??"";var c;const l=((c=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:c.content)??"";new i(m,l).setupStripe().handle();
|
9
public/build/assets/stripe-bank-transfer-801a4de6.js
vendored
Normal file
9
public/build/assets/stripe-bank-transfer-801a4de6.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import{w as u}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/u("#stripe-bank-transfer-payment").then(()=>p());function p(){var r,o,s;const c=(r=document.querySelector('meta[name="stripe-client-secret"]'))==null?void 0:r.content,m=(o=document.querySelector('meta[name="stripe-return-url"]'))==null?void 0:o.content,i={clientSecret:c,appearance:{theme:"stripe",variables:{colorPrimary:"#0570de",colorBackground:"#ffffff",colorText:"#30313d",colorDanger:"#df1b41",fontFamily:"Ideal Sans, system-ui, sans-serif",spacingUnit:"2px",borderRadius:"4px"}}},e=Stripe(document.querySelector('meta[name="stripe-publishable-key"]').getAttribute("content")),t=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";t&&(e.stripeAccount=t);const n=e.elements(i);n.create("payment").mount("#payment-element"),document.getElementById("payment-form").addEventListener("submit",async d=>{d.preventDefault(),document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden");const{error:a}=await e.confirmPayment({elements:n,confirmParams:{return_url:m}});if(a){document.getElementById("pay-now").disabled=!1,document.querySelector("svg").classList.remove("hidden"),document.querySelector("span").classList.add("hidden");const l=document.querySelector("#errors");l.textContent=a.message}})}
|
@ -1,4 +1,4 @@
|
||||
var r=Object.defineProperty;var d=(n,t,e)=>t in n?r(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(d(n,typeof t!="symbol"?t+"":t,e),e);/**
|
||||
var a=Object.defineProperty;var c=(n,t,e)=>t in n?a(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(c(n,typeof t!="symbol"?t+"":t,e),e);import{w as r}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
@ -6,4 +6,4 @@ var r=Object.defineProperty;var d=(n,t,e)=>t in n?r(n,t,{enumerable:!0,configura
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class i{constructor(t,e){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);const t=this.stripe.elements(),s={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 this.auBankAccount=t.create("auBankAccount",s),this.auBankAccount.mount("#becs-iban"),this});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(document.getElementById("becs-name").value===""){document.getElementById("becs-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("becs-email-address").value===""){document.getElementById("becs-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("becs-mandate-acceptance").checked){document.getElementById("becs-mandate-acceptance").focus(),e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1,console.log("Terms");return}document.getElementById("pay-now").disabled=!0,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(s=>s.error?this.handleFailure(s.error.message):this.handleSuccess(s))})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}handleSuccess(t){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(t.paymentIntent),document.getElementById("server-response").submit()}handleFailure(t){let e=document.getElementById("errors");e.textContent="",e.textContent=t,e.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}var a;const l=((a=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:a.content)??"";var c;const m=((c=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:c.content)??"";new i(l,m).setupStripe().handle();
|
||||
*/class d{constructor(t,e){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);const t=this.stripe.elements(),s={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 this.auBankAccount=t.create("auBankAccount",s),this.auBankAccount.mount("#becs-iban"),this});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(document.getElementById("becs-name").value===""){document.getElementById("becs-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("becs-email-address").value===""){document.getElementById("becs-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("becs-mandate-acceptance").checked){document.getElementById("becs-mandate-acceptance").focus(),e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1,console.log("Terms");return}document.getElementById("pay-now").disabled=!0,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(s=>s.error?this.handleFailure(s.error.message):this.handleSuccess(s))})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}handleSuccess(t){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(t.paymentIntent),document.getElementById("server-response").submit()}handleFailure(t){let e=document.getElementById("errors");e.textContent="",e.textContent=t,e.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}r("#stripe-becs-payment").then(()=>{var e,s;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new d(n,t).setupStripe().handle()});
|
@ -1,4 +1,4 @@
|
||||
/**
|
||||
import{w as a}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
@ -6,4 +6,4 @@
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class a{constructor(){var e;this.clientSecret=(e=document.querySelector("meta[name=stripe-pi-client-secret]"))==null?void 0:e.content}init(){var t,n;let e={};return document.querySelector("meta[name=stripe-account-id]")&&(e.apiVersion="2020-08-27",e.stripeAccount=(t=document.querySelector("meta[name=stripe-account-id]"))==null?void 0:t.content),this.stripe=Stripe((n=document.querySelector("meta[name=stripe-publishable-key]"))==null?void 0:n.content,e),this.elements=this.stripe.elements(),this}createPaymentRequest(){return this.paymentRequest=this.stripe.paymentRequest(JSON.parse(document.querySelector("meta[name=payment-request-data").content)),this}createPaymentRequestButton(){this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest})}handlePaymentRequestEvents(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"),r.paymentIntent.status==="requires_action"?e.confirmCardPayment(t).then(function(s){s.error?(n.complete("fail"),document.querySelector("#errors").innerText=s.error.message,document.querySelector("#errors").hidden=!1):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(s.paymentIntent),document.getElementById("server-response").submit())}):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(r.paymentIntent),document.getElementById("server-response").submit()))})})}handle(){this.init().createPaymentRequest().createPaymentRequestButton(),this.paymentRequest.canMakePayment().then(e=>{var t;if(e)return this.paymentRequestButton.mount("#payment-request-button");document.querySelector("#errors").innerHTML=JSON.parse((t=document.querySelector("meta[name=no-available-methods]"))==null?void 0:t.content),document.querySelector("#errors").hidden=!1}),this.handlePaymentRequestEvents(this.stripe,this.clientSecret)}}new a().handle();
|
||||
*/class o{constructor(){var e;this.clientSecret=(e=document.querySelector("meta[name=stripe-pi-client-secret]"))==null?void 0:e.content}init(){var t,n;let e={};return document.querySelector("meta[name=stripe-account-id]")&&(e.apiVersion="2020-08-27",e.stripeAccount=(t=document.querySelector("meta[name=stripe-account-id]"))==null?void 0:t.content),this.stripe=Stripe((n=document.querySelector("meta[name=stripe-publishable-key]"))==null?void 0:n.content,e),this.elements=this.stripe.elements(),this}createPaymentRequest(){return this.paymentRequest=this.stripe.paymentRequest(JSON.parse(document.querySelector("meta[name=payment-request-data").content)),this}createPaymentRequestButton(){this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest})}handlePaymentRequestEvents(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"),r.paymentIntent.status==="requires_action"?e.confirmCardPayment(t).then(function(s){s.error?(n.complete("fail"),document.querySelector("#errors").innerText=s.error.message,document.querySelector("#errors").hidden=!1):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(s.paymentIntent),document.getElementById("server-response").submit())}):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(r.paymentIntent),document.getElementById("server-response").submit()))})})}handle(){this.init().createPaymentRequest().createPaymentRequestButton(),this.paymentRequest.canMakePayment().then(e=>{var t;if(e)return this.paymentRequestButton.mount("#payment-request-button");document.querySelector("#errors").innerHTML=JSON.parse((t=document.querySelector("meta[name=no-available-methods]"))==null?void 0:t.content),document.querySelector("#errors").hidden=!1}),this.handlePaymentRequestEvents(this.stripe,this.clientSecret)}}a("#stripe-browserpay-payment").then(()=>new o().handle());
|
@ -1,4 +1,4 @@
|
||||
import{w as l}from"./wait-d71d9fed.js";/**
|
||||
import{w as l}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
9
public/build/assets/stripe-eps-6ebc87cd.js
vendored
9
public/build/assets/stripe-eps-6ebc87cd.js
vendored
@ -1,9 +0,0 @@
|
||||
var i=Object.defineProperty;var c=(n,e,t)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class a{constructor(e,t){s(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let e=this.stripe.elements();var t={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.eps=e.create("epsBank",t),this.eps.mount("#eps-bank-element"),this});s(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{let t=document.getElementById("errors");if(!document.getElementById("eps-name").value){t.textContent=document.querySelector("meta[name=translation-name-required]").content,t.hidden=!1;return}document.getElementById("pay-now").disabled=!0,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=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}var r;const l=((r=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:r.content)??"";var o;const m=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new a(l,m).setupStripe().handle();
|
9
public/build/assets/stripe-eps-735c10bd.js
vendored
Normal file
9
public/build/assets/stripe-eps-735c10bd.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
var o=Object.defineProperty;var i=(n,t,e)=>t in n?o(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>(i(n,typeof t!="symbol"?t+"":t,e),e);import{w as a}from"./wait-8f4ae121.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
|
||||
*/class c{constructor(t,e){s(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.eps=t.create("epsBank",e),this.eps.mount("#eps-bank-element"),this});s(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("eps-name").value){e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,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=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}a("#stripe-eps-payment").then(()=>{var e,r;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((r=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:r.content)??"";new c(n,t).setupStripe().handle()});
|
@ -1,4 +1,4 @@
|
||||
var i=Object.defineProperty;var c=(n,t,e)=>t in n?i(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>(c(n,typeof t!="symbol"?t+"":t,e),e);/**
|
||||
var o=Object.defineProperty;var i=(n,t,e)=>t in n?o(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(i(n,typeof t!="symbol"?t+"":t,e),e);import{w as a}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
@ -6,4 +6,4 @@ var i=Object.defineProperty;var c=(n,t,e)=>t in n?i(n,t,{enumerable:!0,configura
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class d{constructor(t,e){s(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements(),e={base:{padding:"10px 12px",color:"#32325d",fontSize:"16px"}};return this.fpx=t.create("fpxBank",{style:e,accountHolderType:"individual"}),this.fpx.mount("#fpx-bank-element"),this});s(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{document.getElementById("pay-now").disabled=!0,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(e=>{e.error&&this.handleFailure(e.error.message)})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}handleFailure(t){let e=document.getElementById("errors");e.textContent="",e.textContent=t,e.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}var r;const a=((r=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:r.content)??"";var o;const l=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new d(a,l).setupStripe().handle();
|
||||
*/class c{constructor(t,e){r(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements(),e={base:{padding:"10px 12px",color:"#32325d",fontSize:"16px"}};return this.fpx=t.create("fpxBank",{style:e,accountHolderType:"individual"}),this.fpx.mount("#fpx-bank-element"),this});r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{document.getElementById("pay-now").disabled=!0,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(e=>{e.error&&this.handleFailure(e.error.message)})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}handleFailure(t){let e=document.getElementById("errors");e.textContent="",e.textContent=t,e.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("#stripe-fpx-payment").then(()=>{var e,s;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new c(n,t).setupStripe().handle()});
|
@ -1,9 +0,0 @@
|
||||
var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class a{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{let t=document.getElementById("errors");if(!document.getElementById("giropay-mandate-acceptance").checked){t.textContent=document.querySelector("meta[name=translation-terms-required]").content,t.hidden=!1,console.log("Terms");return}document.getElementById("pay-now").disabled=!0,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=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}var o;const d=((o=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:o.content)??"";var s;const m=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new a(d,m).setupStripe().handle();
|
9
public/build/assets/stripe-giropay-bff9b7b5.js
vendored
Normal file
9
public/build/assets/stripe-giropay-bff9b7b5.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
var s=Object.defineProperty;var i=(n,t,e)=>t in n?s(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(i(n,typeof t!="symbol"?t+"":t,e),e);import{w as c}from"./wait-8f4ae121.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
|
||||
*/class a{constructor(t,e){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("giropay-mandate-acceptance").checked){e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1,console.log("Terms");return}document.getElementById("pay-now").disabled=!0,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=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}c("#stripe-giropay-payment").then(()=>{var e,o;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new a(n,t).setupStripe().handle()});
|
9
public/build/assets/stripe-ideal-22b9f5cf.js
vendored
Normal file
9
public/build/assets/stripe-ideal-22b9f5cf.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
var s=Object.defineProperty;var o=(n,t,e)=>t in n?s(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(o(n,typeof t!="symbol"?t+"":t,e),e);import{w as a}from"./wait-8f4ae121.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
|
||||
*/class l{constructor(t,e){r(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.ideal=t.create("idealBank",e),this.ideal.mount("#ideal-bank-element"),this});r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("ideal-name").value){e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1,console.log("name");return}document.getElementById("pay-now").disabled=!0,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=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}a("#stripe-ideal-payment").then(()=>{var e,i;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((i=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:i.content)??"";new l(n,t).setupStripe().handle()});
|
9
public/build/assets/stripe-ideal-efa175e9.js
vendored
9
public/build/assets/stripe-ideal-efa175e9.js
vendored
@ -1,9 +0,0 @@
|
||||
var o=Object.defineProperty;var a=(n,e,t)=>e in n?o(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(a(n,typeof e!="symbol"?e+"":e,t),t);/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class l{constructor(e,t){r(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let e=this.stripe.elements();var t={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.ideal=e.create("idealBank",t),this.ideal.mount("#ideal-bank-element"),this});r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{let t=document.getElementById("errors");if(!document.getElementById("ideal-name").value){t.textContent=document.querySelector("meta[name=translation-name-required]").content,t.hidden=!1,console.log("name");return}document.getElementById("pay-now").disabled=!0,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=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}var i;const c=((i=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:i.content)??"";var s;const d=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new l(c,d).setupStripe().handle();
|
@ -1,4 +1,4 @@
|
||||
var m=Object.defineProperty;var d=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(d(n,typeof e!="symbol"?e+"":e,t),t);/**
|
||||
var s=Object.defineProperty;var c=(n,e,t)=>e in n?s(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);import{w as m}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
@ -6,4 +6,4 @@ var m=Object.defineProperty;var d=(n,e,t)=>e in n?m(n,e,{enumerable:!0,configura
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class l{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handleError",e=>{document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),this.errors.textContent="",this.errors.textContent=e,this.errors.hidden=!1});r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{let t=document.getElementById("errors"),o=document.getElementById("klarna-name").value;/^[A-Za-z\s]*$/.test(o)?(document.getElementById("pay-now").disabled=!0,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:o,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(a=>{if(a.hasOwnProperty("error"))return this.handleError(a.error.message)})):(document.getElementById("klarna-name-correction").hidden=!1,document.getElementById("klarna-name").textContent=o.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=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}var c;const i=((c=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:c.content)??"";var s;const u=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new l(i,u).setupStripe().handle();
|
||||
*/class d{constructor(e,t){o(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));o(this,"handleError",e=>{document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),this.errors.textContent="",this.errors.textContent=e,this.errors.hidden=!1});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{let t=document.getElementById("errors"),r=document.getElementById("klarna-name").value;/^[A-Za-z\s]*$/.test(r)?(document.getElementById("pay-now").disabled=!0,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:r,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(a=>{if(a.hasOwnProperty("error"))return this.handleError(a.error.message)})):(document.getElementById("klarna-name-correction").hidden=!1,document.getElementById("klarna-name").textContent=r.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=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}m("#stripe-klarna-payment").then(()=>{var t,r;const n=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((r=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:r.content)??"";new d(n,e).setupStripe().handle()});
|
@ -1,4 +1,4 @@
|
||||
var d=Object.defineProperty;var s=(n,t,e)=>t in n?d(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(s(n,typeof t!="symbol"?t+"":t,e),e);/**
|
||||
var r=Object.defineProperty;var c=(n,t,e)=>t in n?r(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(c(n,typeof t!="symbol"?t+"":t,e),e);import{w as d}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
@ -6,4 +6,4 @@ var d=Object.defineProperty;var s=(n,t,e)=>t in n?d(n,t,{enumerable:!0,configura
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class m{constructor(t,e){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.p24bank=t.create("p24Bank",e),this.p24bank.mount("#p24-bank-element"),this});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(document.getElementById("p24-name").value===""){document.getElementById("p24-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("p24-email-address").value===""){document.getElementById("p24-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("p24-mandate-acceptance").checked){document.getElementById("p24-mandate-acceptance").focus(),e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,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(a){a.error?(e.textContent=a.error.message,e.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.paymentIntent.status==="succeeded"&&(window.location=document.querySelector('meta[name="return-url"]').content)})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}var r;const i=((r=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:r.content)??"";var c;const l=((c=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:c.content)??"";new m(i,l).setupStripe().handle();
|
||||
*/class s{constructor(t,e){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.p24bank=t.create("p24Bank",e),this.p24bank.mount("#p24-bank-element"),this});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(document.getElementById("p24-name").value===""){document.getElementById("p24-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("p24-email-address").value===""){document.getElementById("p24-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("p24-mandate-acceptance").checked){document.getElementById("p24-mandate-acceptance").focus(),e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,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(a){a.error?(e.textContent=a.error.message,e.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.paymentIntent.status==="succeeded"&&(window.location=document.querySelector('meta[name="return-url"]').content)})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}d("#stripe-przelewy24-payment").then(()=>{var e,a;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((a=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:a.content)??"";new s(n,t).setupStripe().handle()});
|
@ -1,4 +1,4 @@
|
||||
var s=Object.defineProperty;var l=(a,e,t)=>e in a?s(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var o=(a,e,t)=>(l(a,typeof e!="symbol"?e+"":e,t),t);/**
|
||||
var r=Object.defineProperty;var c=(a,e,t)=>e in a?r(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var o=(a,e,t)=>(c(a,typeof e!="symbol"?e+"":e,t),t);import{w as s}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
@ -6,4 +6,4 @@ var s=Object.defineProperty;var l=(a,e,t)=>e in a?s(a,e,{enumerable:!0,configura
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class i{constructor(e,t){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);const e=this.stripe.elements();var t={base:{color:"#32325d",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"},":-webkit-autofill":{color:"#32325d"}},invalid:{color:"#fa755a",iconColor:"#fa755a",":-webkit-autofill":{color:"#fa755a"}}},n={style:t,supportedCountries:["SEPA"],placeholderCountry:document.querySelector('meta[name="country"]').content};return this.iban=e.create("iban",n),this.iban.mount("#sepa-iban"),document.getElementById("sepa-name").value=document.querySelector("meta[name=client_name]").content,document.getElementById("sepa-email-address").value=document.querySelector("meta[name=client_email]").content,this});o(this,"handle",()=>{let e=document.getElementById("errors");Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(t=>t.addEventListener("click",n=>{document.getElementById("stripe--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=n.target.dataset.token})),document.getElementById("toggle-payment-with-new-bank-account").addEventListener("click",t=>{document.getElementById("stripe--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",t=>{if(document.querySelector("input[name=token]").value.length!==0)document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSepaDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:document.querySelector("input[name=token]").value}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n));else{if(document.getElementById("sepa-name").value===""){document.getElementById("sepa-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("sepa-email-address").value===""){document.getElementById("sepa-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("sepa-mandate-acceptance").checked){e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSepaDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{sepa_debit:this.iban,billing_details:{name:document.getElementById("sepa-name").value,email:document.getElementById("sepa-email-address").value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.querySelector("input[name=token]").value.length>2&&(document.querySelector('input[name="store_card"]').value=!1),document.getElementById("server-response").submit()}handleFailure(e){let 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")}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}}var r;const d=((r=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:r.content)??"";var c;const m=((c=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:c.content)??"";new i(d,m).setupStripe().handle();
|
||||
*/class i{constructor(e,t){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);const e=this.stripe.elements();var t={base:{color:"#32325d",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"},":-webkit-autofill":{color:"#32325d"}},invalid:{color:"#fa755a",iconColor:"#fa755a",":-webkit-autofill":{color:"#fa755a"}}},n={style:t,supportedCountries:["SEPA"],placeholderCountry:document.querySelector('meta[name="country"]').content};return this.iban=e.create("iban",n),this.iban.mount("#sepa-iban"),document.getElementById("sepa-name").value=document.querySelector("meta[name=client_name]").content,document.getElementById("sepa-email-address").value=document.querySelector("meta[name=client_email]").content,this});o(this,"handle",()=>{let e=document.getElementById("errors");Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(t=>t.addEventListener("click",n=>{document.getElementById("stripe--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=n.target.dataset.token})),document.getElementById("toggle-payment-with-new-bank-account").addEventListener("click",t=>{document.getElementById("stripe--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",t=>{if(document.querySelector("input[name=token]").value.length!==0)document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSepaDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:document.querySelector("input[name=token]").value}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n));else{if(document.getElementById("sepa-name").value===""){document.getElementById("sepa-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("sepa-email-address").value===""){document.getElementById("sepa-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("sepa-mandate-acceptance").checked){e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSepaDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{sepa_debit:this.iban,billing_details:{name:document.getElementById("sepa-name").value,email:document.getElementById("sepa-email-address").value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.querySelector("input[name=token]").value.length>2&&(document.querySelector('input[name="store_card"]').value=!1),document.getElementById("server-response").submit()}handleFailure(e){let 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")}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}}s("#stripe-sepa-payment").then(()=>{var t,n;const a=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((n=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:n.content)??"";new i(a,e).setupStripe().handle()});
|
@ -1,4 +1,4 @@
|
||||
var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(i(n,typeof e!="symbol"?e+"":e,t),t);/**
|
||||
var s=Object.defineProperty;var c=(n,e,t)=>e in n?s(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);import{w as i}from"./wait-8f4ae121.js";/**
|
||||
* Invoice Ninja (https://invoiceninja.com)
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
@ -6,4 +6,4 @@ var c=Object.defineProperty;var i=(n,e,t)=>e in n?c(n,e,{enumerable:!0,configura
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/class u{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{document.getElementById("pay-now").disabled=!0,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=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}var o;const a=((o=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:o.content)??"";var s;const m=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new u(a,m).setupStripe().handle();
|
||||
*/class u{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{document.getElementById("pay-now").disabled=!0,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=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}i("#stripe-sofort-payment").then(()=>{var t,o;const n=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new u(n,e).setupStripe().handle()});
|
9
public/build/assets/wait-8f4ae121.js
vendored
Normal file
9
public/build/assets/wait-8f4ae121.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/function i(...e){return new Promise(n=>{if(!e.length){n([]);return}const r=e.map(t=>document.querySelector(t)).filter(Boolean);if(r.length===e.length){n(r);return}const o=new MutationObserver(()=>{const t=e.map(u=>document.querySelector(u)).filter(Boolean);t.length===e.length&&(o.disconnect(),n(t))});o.observe(document.body,{childList:!0,subtree:!0})})}function a(){const e=document.querySelector('meta[name="instant-payment"]');return!!(e&&e instanceof HTMLMetaElement&&e.content==="yes")}export{a as i,i as w};
|
9
public/build/assets/wait-d71d9fed.js
vendored
9
public/build/assets/wait-d71d9fed.js
vendored
@ -1,9 +0,0 @@
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/function i(...e){return new Promise(t=>{if(!e.length){t([]);return}const r=e.map(n=>document.querySelector(n)).filter(Boolean);if(r.length===e.length){t(r);return}const o=new MutationObserver(()=>{const n=e.map(u=>document.querySelector(u)).filter(Boolean);n.length===e.length&&(o.disconnect(),t(n))});o.observe(document.body,{childList:!0,subtree:!0})})}export{i as w};
|
@ -8,8 +8,8 @@
|
||||
"__commonjsHelpers-725317a4.js"
|
||||
]
|
||||
},
|
||||
"_wait-d71d9fed.js": {
|
||||
"file": "assets/wait-d71d9fed.js"
|
||||
"_wait-8f4ae121.js": {
|
||||
"file": "assets/wait-8f4ae121.js"
|
||||
},
|
||||
"resources/js/app.js": {
|
||||
"file": "assets/app-234e3402.js",
|
||||
@ -48,6 +48,14 @@
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payment_methods/authorize-checkout-card.js"
|
||||
},
|
||||
"resources/js/clients/payment_methods/authorize-stripe-acss.js": {
|
||||
"file": "assets/authorize-stripe-acss-f6bd46c1.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payment_methods/authorize-stripe-acss.js"
|
||||
},
|
||||
"resources/js/clients/payment_methods/braintree-ach.js": {
|
||||
"file": "assets/braintree-ach-b29d040e.js",
|
||||
"isEntry": true,
|
||||
@ -74,9 +82,9 @@
|
||||
"src": "resources/js/clients/payments/braintree-paypal.js"
|
||||
},
|
||||
"resources/js/clients/payments/checkout-credit-card.js": {
|
||||
"file": "assets/checkout-credit-card-ba005c24.js",
|
||||
"file": "assets/checkout-credit-card-eba516f2.js",
|
||||
"imports": [
|
||||
"_wait-d71d9fed.js"
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/checkout-credit-card.js"
|
||||
@ -116,13 +124,24 @@
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/square-credit-card.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-ach-pay.js": {
|
||||
"file": "assets/stripe-ach-pay-22d14901.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-ach-pay.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-ach.js": {
|
||||
"file": "assets/stripe-ach-fe366ca7.js",
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-ach.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-acss.js": {
|
||||
"file": "assets/stripe-acss-946fe54a.js",
|
||||
"file": "assets/stripe-acss-1184fda8.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-acss.js"
|
||||
},
|
||||
@ -132,70 +151,114 @@
|
||||
"src": "resources/js/clients/payments/stripe-alipay.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-bacs.js": {
|
||||
"file": "assets/stripe-bacs-38c8b975.js",
|
||||
"file": "assets/stripe-bacs-e1cfee99.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-bacs.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-bancontact.js": {
|
||||
"file": "assets/stripe-bancontact-cb004d43.js",
|
||||
"file": "assets/stripe-bancontact-743204e1.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-bancontact.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-bank-transfer.js": {
|
||||
"file": "assets/stripe-bank-transfer-801a4de6.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-bank-transfer.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-becs.js": {
|
||||
"file": "assets/stripe-becs-4d1494ed.js",
|
||||
"file": "assets/stripe-becs-ce05fb09.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-becs.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-browserpay.js": {
|
||||
"file": "assets/stripe-browserpay-ac78fb26.js",
|
||||
"file": "assets/stripe-browserpay-813e625e.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-browserpay.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-credit-card.js": {
|
||||
"file": "assets/stripe-credit-card-ce33996a.js",
|
||||
"file": "assets/stripe-credit-card-f3658509.js",
|
||||
"imports": [
|
||||
"_wait-d71d9fed.js"
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-credit-card.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-eps.js": {
|
||||
"file": "assets/stripe-eps-6ebc87cd.js",
|
||||
"file": "assets/stripe-eps-735c10bd.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-eps.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-fpx.js": {
|
||||
"file": "assets/stripe-fpx-240a05e2.js",
|
||||
"file": "assets/stripe-fpx-d93f7d79.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-fpx.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-giropay.js": {
|
||||
"file": "assets/stripe-giropay-9d3bfbab.js",
|
||||
"file": "assets/stripe-giropay-bff9b7b5.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-giropay.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-ideal.js": {
|
||||
"file": "assets/stripe-ideal-efa175e9.js",
|
||||
"file": "assets/stripe-ideal-22b9f5cf.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-ideal.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-klarna.js": {
|
||||
"file": "assets/stripe-klarna-e45c946d.js",
|
||||
"file": "assets/stripe-klarna-9ee067e7.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-klarna.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-przelewy24.js": {
|
||||
"file": "assets/stripe-przelewy24-f9154acf.js",
|
||||
"file": "assets/stripe-przelewy24-7f03b69e.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-przelewy24.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-sepa.js": {
|
||||
"file": "assets/stripe-sepa-6dd487fc.js",
|
||||
"file": "assets/stripe-sepa-554f6dfd.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-sepa.js"
|
||||
},
|
||||
"resources/js/clients/payments/stripe-sofort.js": {
|
||||
"file": "assets/stripe-sofort-18aeca06.js",
|
||||
"file": "assets/stripe-sofort-6e4e7148.js",
|
||||
"imports": [
|
||||
"_wait-8f4ae121.js"
|
||||
],
|
||||
"isEntry": true,
|
||||
"src": "resources/js/clients/payments/stripe-sofort.js"
|
||||
},
|
||||
|
80
resources/js/clients/payment_methods/authorize-stripe-acss.js
vendored
Normal file
80
resources/js/clients/payment_methods/authorize-stripe-acss.js
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
wait('#stripe-acss-authorize').then(() => authorize());
|
||||
|
||||
function authorize() {
|
||||
let stripe;
|
||||
|
||||
const account_id = document.querySelector(
|
||||
'meta[name="stripe-account-id"]'
|
||||
)?.content;
|
||||
|
||||
const publishable_key = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content;
|
||||
|
||||
if (account_id && account_id.length > 0) {
|
||||
stripe = Stripe(publishable_key, {
|
||||
stripeAccount: account_id,
|
||||
});
|
||||
} else {
|
||||
stripe = Stripe(publishable_key);
|
||||
}
|
||||
|
||||
const accountholderName = document.getElementById('acss-name');
|
||||
const email = document.getElementById('acss-email-address');
|
||||
const submitButton = document.getElementById('authorize-acss');
|
||||
const clientSecret = document.querySelector('meta[name="stripe-pi-client-secret"]')?.content;
|
||||
const errors = document.getElementById('errors');
|
||||
|
||||
submitButton.addEventListener('click', async (event) => {
|
||||
event.preventDefault();
|
||||
errors.hidden = true;
|
||||
submitButton.disabled = true;
|
||||
|
||||
const validEmailRegex =
|
||||
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
|
||||
|
||||
if (email.value.length < 3 || !email.value.match(validEmailRegex)) {
|
||||
errors.textContent = 'Please enter a valid email address.';
|
||||
errors.hidden = false;
|
||||
submitButton.disabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (accountholderName.value.length < 3) {
|
||||
errors.textContent = 'Please enter a name for the account holder.';
|
||||
errors.hidden = false;
|
||||
submitButton.disabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const { setupIntent, error } = await stripe.confirmAcssDebitSetup(
|
||||
clientSecret,
|
||||
{
|
||||
payment_method: {
|
||||
billing_details: {
|
||||
name: accountholderName.value,
|
||||
email: email.value,
|
||||
},
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
// Handle next step based on SetupIntent's status.
|
||||
document.getElementById('gateway_response').value = JSON.stringify(
|
||||
setupIntent ?? error
|
||||
);
|
||||
document.getElementById('server_response').submit();
|
||||
});
|
||||
}
|
168
resources/js/clients/payments/stripe-ach-pay.js
vendored
Normal file
168
resources/js/clients/payments/stripe-ach-pay.js
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
wait('#stripe-ach-payment').then(() => ach());
|
||||
|
||||
function ach() {
|
||||
let payNow = document.getElementById('pay-now');
|
||||
|
||||
if (payNow) {
|
||||
Array.from(
|
||||
document.getElementsByClassName('toggle-payment-with-token')
|
||||
).forEach((element) =>
|
||||
element.addEventListener('click', (element) => {
|
||||
document.querySelector('input[name=source]').value =
|
||||
element.target.dataset.token;
|
||||
})
|
||||
);
|
||||
payNow.addEventListener('click', function () {
|
||||
let payNowButton = document.getElementById('pay-now');
|
||||
payNowButton.disabled = true;
|
||||
payNowButton.querySelector('svg').classList.remove('hidden');
|
||||
payNowButton.querySelector('span').classList.add('hidden');
|
||||
document.getElementById('server-response').submit();
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('new-bank').addEventListener('click', (ev) => {
|
||||
if (!document.getElementById('accept-terms').checked) {
|
||||
errors.textContent =
|
||||
'You must accept the mandate terms prior to making payment.';
|
||||
errors.hidden = false;
|
||||
return;
|
||||
}
|
||||
|
||||
errors.hidden = true;
|
||||
|
||||
let stripe;
|
||||
|
||||
let publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
).content;
|
||||
|
||||
let stripeConnect = document.querySelector(
|
||||
'meta[name="stripe-account-id"]'
|
||||
)?.content;
|
||||
|
||||
if (stripeConnect) {
|
||||
stripe = Stripe(publishableKey, { stripeAccount: stripeConnect });
|
||||
} else {
|
||||
stripe = Stripe(publishableKey);
|
||||
}
|
||||
|
||||
let newBankButton = document.getElementById('new-bank');
|
||||
newBankButton.disabled = true;
|
||||
newBankButton.querySelector('svg').classList.remove('hidden');
|
||||
newBankButton.querySelector('span').classList.add('hidden');
|
||||
|
||||
ev.preventDefault();
|
||||
const accountHolderNameField = document.getElementById(
|
||||
'account-holder-name-field'
|
||||
);
|
||||
const emailField = document.getElementById('email-field');
|
||||
const clientSecret = document.querySelector(
|
||||
'meta[name="client_secret"]'
|
||||
)?.content;
|
||||
// Calling this method will open the instant verification dialog.
|
||||
stripe
|
||||
.collectBankAccountForPayment({
|
||||
clientSecret: clientSecret,
|
||||
params: {
|
||||
payment_method_type: 'us_bank_account',
|
||||
payment_method_data: {
|
||||
billing_details: {
|
||||
name: accountHolderNameField.value,
|
||||
email: emailField.value,
|
||||
},
|
||||
},
|
||||
},
|
||||
expand: ['payment_method'],
|
||||
})
|
||||
.then(({ paymentIntent, error }) => {
|
||||
if (error) {
|
||||
console.error(error.message);
|
||||
errors.textContent = error.message;
|
||||
errors.hidden = false;
|
||||
resetButtons();
|
||||
|
||||
// PaymentMethod collection failed for some reason.
|
||||
} else if (paymentIntent.status === 'requires_payment_method') {
|
||||
// Customer canceled the hosted verification modal. Present them with other
|
||||
// payment method type options.
|
||||
|
||||
errors.textContent =
|
||||
'We were unable to process the payment with this account, please try another one.';
|
||||
errors.hidden = false;
|
||||
resetButtons();
|
||||
return;
|
||||
} else if (paymentIntent.status === 'requires_confirmation') {
|
||||
let bank_account_response = document.getElementById(
|
||||
'bank_account_response'
|
||||
);
|
||||
bank_account_response.value = JSON.stringify(paymentIntent);
|
||||
|
||||
confirmPayment(stripe, clientSecret);
|
||||
}
|
||||
|
||||
resetButtons();
|
||||
return;
|
||||
});
|
||||
});
|
||||
|
||||
function confirmPayment(stripe, clientSecret) {
|
||||
stripe
|
||||
.confirmUsBankAccountPayment(clientSecret)
|
||||
.then(({ paymentIntent, error }) => {
|
||||
console.log(paymentIntent);
|
||||
if (error) {
|
||||
console.error(error.message);
|
||||
// The payment failed for some reason.
|
||||
} else if (paymentIntent.status === 'requires_payment_method') {
|
||||
// Confirmation failed. Attempt again with a different payment method.
|
||||
|
||||
errors.textContent =
|
||||
'We were unable to process the payment with this account, please try another one.';
|
||||
errors.hidden = false;
|
||||
resetButtons();
|
||||
} else if (paymentIntent.status === 'processing') {
|
||||
// Confirmation succeeded! The account will be debited.
|
||||
|
||||
let gateway_response =
|
||||
document.getElementById('gateway_response');
|
||||
gateway_response.value = JSON.stringify(paymentIntent);
|
||||
document.getElementById('server-response').submit();
|
||||
} else if (
|
||||
paymentIntent.next_action?.type ===
|
||||
'verify_with_microdeposits' ||
|
||||
paymentIntent.next_action?.type === 'requires_source_action'
|
||||
) {
|
||||
errors.textContent =
|
||||
'You will receive an email with details on how to verify your bank account and process payment.';
|
||||
errors.hidden = false;
|
||||
document.getElementById('new-bank').style.visibility =
|
||||
'hidden';
|
||||
|
||||
let gateway_response =
|
||||
document.getElementById('gateway_response');
|
||||
gateway_response.value = JSON.stringify(paymentIntent);
|
||||
document.getElementById('server-response').submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function resetButtons() {
|
||||
let newBankButton = document.getElementById('new-bank');
|
||||
newBankButton.disabled = false;
|
||||
newBankButton.querySelector('svg').classList.add('hidden');
|
||||
newBankButton.querySelector('span').classList.remove('hidden');
|
||||
}
|
||||
}
|
19
resources/js/clients/payments/stripe-acss.js
vendored
19
resources/js/clients/payments/stripe-acss.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { instant, wait } from '../wait';
|
||||
|
||||
class ProcessACSS {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -145,11 +147,16 @@ class ProcessACSS {
|
||||
}
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
function boot() {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessACSS(publishableKey, stripeConnect).setupStripe().handle();
|
||||
}
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
instant() ? boot() : wait('#stripe-acss-payment').then(() => boot());
|
||||
|
||||
new ProcessACSS(publishableKey, stripeConnect).setupStripe().handle();
|
||||
|
24
resources/js/clients/payments/stripe-bacs.js
vendored
24
resources/js/clients/payments/stripe-bacs.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessBACS {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -75,13 +77,15 @@ class ProcessBACS {
|
||||
}
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
const onlyAuthorization =
|
||||
document.querySelector('meta[name="only-authorization"]')?.content ?? '';
|
||||
|
||||
new ProcessBACS(publishableKey, stripeConnect).setupStripe().handle();
|
||||
wait('#stripe-bacs-payment').then(() => {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
const onlyAuthorization =
|
||||
document.querySelector('meta[name="only-authorization"]')?.content ?? '';
|
||||
|
||||
new ProcessBACS(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessBANCONTACTPay {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -63,11 +65,14 @@ class ProcessBANCONTACTPay {
|
||||
};
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
wait('#stripe-bancontact-payment').then(() => {
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessBANCONTACTPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessBANCONTACTPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
76
resources/js/clients/payments/stripe-bank-transfer.js
vendored
Normal file
76
resources/js/clients/payments/stripe-bank-transfer.js
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
wait('#stripe-bank-transfer-payment').then(() => bankTransfer());
|
||||
|
||||
function bankTransfer() {
|
||||
const secret = document.querySelector('meta[name="stripe-client-secret"]')?.content;
|
||||
const return_url = document.querySelector('meta[name="stripe-return-url"]')?.content;
|
||||
|
||||
const options = {
|
||||
clientSecret: secret,
|
||||
appearance: {
|
||||
theme: 'stripe',
|
||||
variables: {
|
||||
colorPrimary: '#0570de',
|
||||
colorBackground: '#ffffff',
|
||||
colorText: '#30313d',
|
||||
colorDanger: '#df1b41',
|
||||
fontFamily: 'Ideal Sans, system-ui, sans-serif',
|
||||
spacingUnit: '2px',
|
||||
borderRadius: '4px',
|
||||
// See all possible variables below
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const stripe = Stripe(
|
||||
document
|
||||
.querySelector('meta[name="stripe-publishable-key"]')
|
||||
.getAttribute('content')
|
||||
);
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
if (stripeConnect) stripe.stripeAccount = stripeConnect;
|
||||
|
||||
// Set up Stripe.js and Elements to use in checkout form, passing the client secret obtained in step 3
|
||||
const elements = stripe.elements(options);
|
||||
// Create and mount the Payment Element
|
||||
const paymentElement = elements.create('payment');
|
||||
paymentElement.mount('#payment-element');
|
||||
|
||||
const form = document.getElementById('payment-form');
|
||||
|
||||
form.addEventListener('submit', async (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
document.getElementById('pay-now').disabled = true;
|
||||
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||
|
||||
const { error } = await stripe.confirmPayment({
|
||||
elements,
|
||||
confirmParams: {
|
||||
return_url,
|
||||
},
|
||||
});
|
||||
|
||||
if (error) {
|
||||
document.getElementById('pay-now').disabled = false;
|
||||
document.querySelector('svg').classList.remove('hidden');
|
||||
document.querySelector('span').classList.add('hidden');
|
||||
const messageContainer = document.querySelector('#errors');
|
||||
messageContainer.textContent = error.message;
|
||||
}
|
||||
});
|
||||
}
|
20
resources/js/clients/payments/stripe-becs.js
vendored
20
resources/js/clients/payments/stripe-becs.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessBECS {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -135,11 +137,13 @@ class ProcessBECS {
|
||||
}
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessBECS(publishableKey, stripeConnect).setupStripe().handle();
|
||||
wait('#stripe-becs-payment').then(() => {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessBECS(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
20
resources/js/clients/payments/stripe-eps.js
vendored
20
resources/js/clients/payments/stripe-eps.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessEPSPay {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -80,11 +82,13 @@ class ProcessEPSPay {
|
||||
};
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessEPSPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
wait('#stripe-eps-payment').then(() => {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessEPSPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
22
resources/js/clients/payments/stripe-fpx.js
vendored
22
resources/js/clients/payments/stripe-fpx.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessFPXPay {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -81,13 +83,13 @@ class ProcessFPXPay {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessFPXPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
wait('#stripe-fpx-payment').then(() => {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessFPXPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
20
resources/js/clients/payments/stripe-giropay.js
vendored
20
resources/js/clients/payments/stripe-giropay.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessGiroPay {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -64,11 +66,13 @@ class ProcessGiroPay {
|
||||
};
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessGiroPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
wait('#stripe-giropay-payment').then(() => {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessGiroPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
20
resources/js/clients/payments/stripe-ideal.js
vendored
20
resources/js/clients/payments/stripe-ideal.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessIDEALPay {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -81,11 +83,13 @@ class ProcessIDEALPay {
|
||||
};
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessIDEALPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
wait('#stripe-ideal-payment').then(() => {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessIDEALPay(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
20
resources/js/clients/payments/stripe-klarna.js
vendored
20
resources/js/clients/payments/stripe-klarna.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessKlarna {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -91,11 +93,13 @@ class ProcessKlarna {
|
||||
};
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessKlarna(publishableKey, stripeConnect).setupStripe().handle();
|
||||
wait('#stripe-klarna-payment').then(() => {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessKlarna(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessPRZELEWY24 {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -113,11 +115,13 @@ class ProcessPRZELEWY24 {
|
||||
};
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessPRZELEWY24(publishableKey, stripeConnect).setupStripe().handle();
|
||||
wait('#stripe-przelewy24-payment').then(() => {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessPRZELEWY24(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
14
resources/js/clients/payments/stripe-sepa.js
vendored
14
resources/js/clients/payments/stripe-sepa.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessSEPA {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -233,11 +235,13 @@ class ProcessSEPA {
|
||||
}
|
||||
}
|
||||
|
||||
const publishableKey =
|
||||
document.querySelector('meta[name="stripe-publishable-key"]')?.content ??
|
||||
wait('#stripe-sepa-payment').then(() => {
|
||||
const publishableKey =
|
||||
document.querySelector('meta[name="stripe-publishable-key"]')?.content ??
|
||||
'';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessSEPA(publishableKey, stripeConnect).setupStripe().handle();
|
||||
new ProcessSEPA(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
20
resources/js/clients/payments/stripe-sofort.js
vendored
20
resources/js/clients/payments/stripe-sofort.js
vendored
@ -8,6 +8,8 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
import { wait } from '../wait';
|
||||
|
||||
class ProcessSOFORT {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
@ -58,11 +60,13 @@ class ProcessSOFORT {
|
||||
};
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessSOFORT(publishableKey, stripeConnect).setupStripe().handle();
|
||||
wait('#stripe-sofort-payment').then(() => {
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessSOFORT(publishableKey, stripeConnect).setupStripe().handle();
|
||||
});
|
||||
|
14
resources/js/clients/wait.js
vendored
14
resources/js/clients/wait.js
vendored
@ -41,3 +41,17 @@ export function wait(...selectors) {
|
||||
observer.observe(document.body, { childList: true, subtree: true });
|
||||
});
|
||||
}
|
||||
|
||||
export function instant() {
|
||||
const instant = document.querySelector('meta[name="instant-payment"]');
|
||||
|
||||
if (
|
||||
instant &&
|
||||
instant instanceof HTMLMetaElement &&
|
||||
instant.content === 'yes'
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -0,0 +1,92 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-ach-payment">
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
<meta name="client_secret" content="{{ $client_secret }}">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1" />
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
|
||||
@csrf
|
||||
<input type="hidden" name="company_gateway_id" value="{{ $gateway->getCompanyGatewayId() }}">
|
||||
<input type="hidden" name="payment_method_id" value="{{ $payment_method_id }}">
|
||||
<input type="hidden" name="source" value="">
|
||||
<input type="hidden" name="amount" value="{{ $amount }}">
|
||||
<input type="hidden" name="currency" value="{{ $currency }}">
|
||||
<input type="hidden" name="customer" value="{{ $customer->id }}">
|
||||
<input type="hidden" name="payment_hash" value="{{ $payment_hash }}">
|
||||
<input type="hidden" name="client_secret" value="{{ $client_secret }}">
|
||||
<input type="hidden" name="gateway_response" id="gateway_response" value="">
|
||||
<input type="hidden" name="bank_account_response" id="bank_account_response" value="">
|
||||
</form>
|
||||
|
||||
@if(count($tokens) > 0)
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.pay_with')])
|
||||
@if(count($tokens) > 0)
|
||||
<ul class="list-none hover:list-disc">
|
||||
@foreach($tokens as $token)
|
||||
<li class="py-1 hover:text-blue hover:bg-blue-600">
|
||||
<label class="mr-4">
|
||||
<input type="radio" data-token="{{ $token->hashed_id }}" name="payment-type"
|
||||
class="form-check-input text-indigo-600 rounded-full cursor-pointer toggle-payment-with-token" />
|
||||
<span class="ml-1 cursor-pointer">{{ ctrans('texts.bank_transfer') }}
|
||||
(*{{ $token->meta->last4 }})</span>
|
||||
</label>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
@endcomponent
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
|
||||
@else
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element-single')
|
||||
<input type="checkbox" class="form-checkbox mr-1" id="accept-terms" required>
|
||||
<label for="accept-terms"
|
||||
class="cursor-pointer">{{ ctrans('texts.ach_authorization', ['company' => auth()->guard('contact')->user()->company->present()->name, 'email' => auth()->guard('contact')->user()->client->company->settings->email]) }}</label>
|
||||
@endcomponent
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.account_holder_name')])
|
||||
<input class="input w-full" id="account-holder-name-field" type="text" placeholder="{{ ctrans('texts.name') }}"
|
||||
value="{{ $gateway->client->present()->first_name() }} {{ $gateway->client->present()->last_name() }}" required>
|
||||
@endcomponent
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.email')])
|
||||
<input class="input w-full" id="email-field" type="text" placeholder="{{ ctrans('texts.email') }}"
|
||||
value="{{ $gateway->client->present()->email() }}" required>
|
||||
@endcomponent
|
||||
|
||||
<div class="px-4 py-5 sm:px-6 lg:grid lg:grid-cols-3 lg:gap-4 lg:flex lg:items-center">
|
||||
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
|
||||
Connect a bank account
|
||||
</dt>
|
||||
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
<button type="button" class="button button-primary bg-primary" id="new-bank" type="button">
|
||||
<svg class="animate-spin h-5 w-5 text-white hidden" xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 24 24">
|
||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||
<path class="opacity-75" fill="currentColor"
|
||||
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
|
||||
</path>
|
||||
</svg>
|
||||
<span>{{ $slot ?? ctrans('texts.new_bank_account') }}</span>
|
||||
</button>
|
||||
</dd>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-ach-pay.js')
|
||||
@endassets
|
@ -0,0 +1,70 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-acss-authorize">
|
||||
|
||||
@if($company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
<meta name="stripe-pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
<meta name="only-authorization" content="true">
|
||||
|
||||
<form action="{{ route('client.payment_methods.store', ['method' => App\Models\GatewayType::ACSS]) }}" method="post"
|
||||
id="server_response">
|
||||
@csrf
|
||||
<input type="hidden" name="company_gateway_id" value="{{ $company_gateway->gateway_id }}">
|
||||
<input type="hidden" name="payment_method_id" value="1">
|
||||
<input type="hidden" name="gateway_response" id="gateway_response">
|
||||
<input type="hidden" name="is_default" id="is_default">
|
||||
<input type="hidden" name="post_auth_response" value="{{ $post_auth_response }}">
|
||||
</form>
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
@component('portal.ninja2020.components.general.card-element-single', ['title' => 'SEPA', 'show_title' => false])
|
||||
<p>By clicking submit, you accept this Agreement and authorize {{ $company->present()->name() }} to debit the
|
||||
specified bank account for any amount owed for charges arising from the use of services and/or purchase of
|
||||
products.</p>
|
||||
<br>
|
||||
<p>Payments will be debited from the specified account when an invoice becomes due.</p>
|
||||
<br>
|
||||
<p>Where a scheduled debit date is not a business day, {{ $company->present()->name() }} will debit on the next
|
||||
business day.</p>
|
||||
<br>
|
||||
<p>You agree that any payments due will be debited from your account immediately upon acceptance of this Agreement
|
||||
and that confirmation of this Agreement may be sent within 5 (five) days of acceptance of this Agreement. You
|
||||
further agree to be notified of upcoming debits up to 1 (one) day before payments are collected.</p>
|
||||
<br>
|
||||
<p>You have certain recourse rights if any debit does not comply with this agreement. For example, you have the
|
||||
right to receive reimbursement for any debit that is not authorized or is not consistent with this PAD
|
||||
Agreement. To obtain more information on your recourse rights, contact your financial institution.</p>
|
||||
<br>
|
||||
<p>You may amend or cancel this authorization at any time by providing the merchant with thirty (30) days notice at
|
||||
{{ $company->owner()->email }}. To obtain a sample cancellation form, or further information on cancelling a PAD
|
||||
agreement, please contact your financial institution.</p>
|
||||
<br>
|
||||
<p>{{ $company->present()->name() }} partners with Stripe to provide payment processing.</p>
|
||||
|
||||
|
||||
<div>
|
||||
<label for="acss-name">
|
||||
<input class="input w-full" id="acss-name" type="text"
|
||||
placeholder="{{ ctrans('texts.bank_account_holder') }}" value="{{ $client->present()->name() }}">
|
||||
</label>
|
||||
<label for="acss-email">
|
||||
<input class="input w-full" id="acss-email-address" type="email" placeholder="{{ ctrans('texts.email') }}"
|
||||
value="{{ $client->present()->email() }}">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
@endcomponent
|
||||
@component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'authorize-acss'])
|
||||
{{ ctrans('texts.add_payment_method') }}
|
||||
@endcomponent
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payment_methods/authorize-stripe-acss.js')
|
||||
@endassets
|
@ -8,7 +8,7 @@
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
<meta name="instant-payment" content="yes" />
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
@ -60,5 +60,4 @@
|
||||
@push('footer')
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-acss.js')
|
||||
|
||||
@endpush
|
||||
|
@ -0,0 +1,56 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-acss-payment">
|
||||
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="translation-name-required" content="{{ ctrans('texts.missing_account_holder_name') }}">
|
||||
<meta name="translation-email-required" content="{{ ctrans('texts.provide_email') }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.pay_with')])
|
||||
{{ ctrans('texts.acss') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
|
||||
@csrf
|
||||
<input type="hidden" name="gateway_response">
|
||||
<input type="hidden" name="company_gateway_id" value="{{ $gateway->getCompanyGatewayId() }}">
|
||||
<input type="hidden" name="payment_method_id" value="{{ $payment_method_id }}">
|
||||
<input type="hidden" name="payment_hash" value="{{ $payment_hash }}">
|
||||
<input type="hidden" name="token" value="">
|
||||
<input type="hidden" name="store_card">
|
||||
</form>
|
||||
|
||||
<ul class="list-none hover:list-disc mt-5">
|
||||
|
||||
@foreach($tokens as $token)
|
||||
<li class="py-2 hover:text-blue hover:bg-blue-600">
|
||||
|
||||
<label class="mr-4">
|
||||
<input type="radio" data-token="{{ $token->hashed_id }}" name="payment-type"
|
||||
class="form-radio cursor-pointer toggle-payment-with-token" />
|
||||
<span class="ml-1 cursor-pointer">{{ $token->meta?->brand }} (*{{ $token->meta?->last4 }})</span>
|
||||
</label>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@include('portal.ninja2020.gateways.includes.pay_now', ['id' => 'pay-now-with-token'])
|
||||
|
||||
@endcomponent
|
||||
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-acss.js')
|
||||
@endassets
|
@ -0,0 +1,47 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-bacs-payment">
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
<meta name="only-authorization" content="">
|
||||
<meta name="translation-payment-method-required" content="{{ ctrans('texts.missing_payment_method') }}">
|
||||
|
||||
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
|
||||
@csrf
|
||||
<input type="hidden" name="company_gateway_id" value="{{ $gateway->getCompanyGatewayId() }}">
|
||||
<input type="hidden" name="payment_method_id" value="{{ $payment_method_id }}">
|
||||
<input type="hidden" name="token">
|
||||
<input type="hidden" name="payment_hash" value="{{ $payment_hash }}">
|
||||
<input type="hidden" name="amount" value={{ $amount }}>
|
||||
</form>
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.bacs') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.pay_with')])
|
||||
@if (count($tokens) > 0)
|
||||
@foreach ($tokens as $token)
|
||||
<label class="mr-4">
|
||||
<input type="radio" data-token="{{ $token->token }}" name="payment-type"
|
||||
class="form-radio cursor-pointer toggle-payment-with-token" />
|
||||
<span class="ml-1 cursor-pointer">**** {{ $token->meta?->last4 }}</span>
|
||||
</label>
|
||||
@endforeach
|
||||
@endisset
|
||||
|
||||
@endcomponent
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-bacs.js')
|
||||
@endassets
|
@ -0,0 +1,33 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-bancontact-payment">
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
|
||||
<meta name="translation-name-required" content="{{ ctrans('texts.missing_account_holder_name') }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.bancontact') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
@include('portal.ninja2020.gateways.stripe.bancontact.bancontact')
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-bancontact.js')
|
||||
@endassets
|
@ -0,0 +1,43 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-bank-transfer-payment">
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
<meta name="stripe-client-secret" content="{{ $client_secret }}" />
|
||||
<meta name="stripe-return-url" content="{{ $return_url }}" />
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1" />
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
<form action="{{ route('client.payments.response') }}" method="post" id="payment-form">
|
||||
@csrf
|
||||
|
||||
<div id="payment-element" style="padding:40px;">
|
||||
<!-- Elements will create form elements here -->
|
||||
</div>
|
||||
|
||||
<div class="bg-white px-4 py-5 flex justify-end">
|
||||
<button @isset($form) form="{{ $form }}" @endisset type="submit" id="{{ $id ?? 'pay-now' }}" @isset($data)
|
||||
@foreach($data as $prop => $value) data-{{ $prop }}="{{ $value }}" @endforeach @endisset
|
||||
class="button button-primary bg-primary {{ $class ?? '' }}" {{ isset($disabled) && $disabled === true ? 'disabled' : '' }}>
|
||||
<svg class="animate-spin h-5 w-5 text-white hidden" xmlns="http://www.w3.org/2000/svg" fill="none"
|
||||
viewBox="0 0 24 24">
|
||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||
<path class="opacity-75" fill="currentColor"
|
||||
d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">
|
||||
</path>
|
||||
</svg>
|
||||
<span>{{ $slot ?? ctrans('texts.pay_now') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-bank-transfer.js')
|
||||
@endassets
|
@ -0,0 +1,36 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-becs-payment">
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
|
||||
<meta name="translation-name-required" content="{{ ctrans('texts.missing_account_holder_name') }}">
|
||||
<meta name="translation-email-required" content="{{ ctrans('texts.provide_email') }}">
|
||||
<meta name="translation-terms-required"
|
||||
content="{{ ctrans('texts.you_need_to_accept_the_terms_before_proceeding') }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.becs') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
|
||||
@include('portal.ninja2020.gateways.stripe.becs.becs_debit')
|
||||
@include('portal.ninja2020.gateways.includes.save_card')
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
<script src="{{ asset('js/clients/payments/stripe-becs.js') }}"></script>
|
||||
@endassets
|
@ -0,0 +1,33 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-eps-payment">
|
||||
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
|
||||
<meta name="translation-name-required" content="{{ ctrans('texts.missing_account_holder_name') }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.eps') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
@include('portal.ninja2020.gateways.stripe.eps.eps')
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-eps.js')
|
||||
@endassets
|
@ -0,0 +1,31 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-fpx-payment">
|
||||
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.fpx') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
@include('portal.ninja2020.gateways.stripe.fpx.fpx')
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-fpx.js')
|
||||
@endassets
|
@ -0,0 +1,32 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-giropay-payment">
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
|
||||
<meta name="translation-terms-required"
|
||||
content="{{ ctrans('texts.you_need_to_accept_the_terms_before_proceeding') }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.giropay') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
@include('portal.ninja2020.gateways.stripe.giropay.giropay')
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-giropay.js')
|
||||
@endassets
|
@ -0,0 +1,32 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-ideal-payment">
|
||||
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
|
||||
<meta name="translation-name-required" content="{{ ctrans('texts.missing_account_holder_name') }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.ideal') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
@include('portal.ninja2020.gateways.stripe.ideal.ideal')
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-ideal.js')
|
||||
@endassets
|
@ -0,0 +1,37 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-klarna-payment">
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="email" content="{{ $gateway->client->present()->email() }}">
|
||||
<meta name="address-2" content="{{ $gateway->client->address2 }}">
|
||||
<meta name="address-1" content="{{ $gateway->client->address1 }}">
|
||||
<meta name="city" content="{{ $gateway->client->city }}">
|
||||
<meta name="state" content="{{ $gateway->client->state }}">
|
||||
<meta name="postal_code" content="{{ $gateway->client->postal_code }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
<meta name="translation-name-without-special-characters"
|
||||
content="{{ ctrans('texts.name_without_special_characters') }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.klarna') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
@include('portal.ninja2020.gateways.stripe.klarna.klarna')
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-klarna.js')
|
||||
@endassets
|
@ -0,0 +1,35 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-przelewy24-payment">
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
|
||||
<meta name="translation-name-required" content="{{ ctrans('texts.missing_account_holder_name') }}">
|
||||
<meta name="translation-email-required" content="{{ ctrans('texts.provide_email') }}">
|
||||
<meta name="translation-terms-required" content="{{ ctrans('texts.you_need_to_accept_the_terms_before_proceeding') }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.przelewy24') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
|
||||
@include('portal.ninja2020.gateways.stripe.przelewy24.przelewy24')
|
||||
@include('portal.ninja2020.gateways.includes.save_card')
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-przelewy24.js')
|
||||
@endassets
|
@ -0,0 +1,89 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-sepa-payment">
|
||||
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->company_gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="client_name" content="{{ $client->present()->name() }}">
|
||||
<meta name="client_email" content="{{ $client->present()->email() }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
<meta name="si-client-secret" content="{{ $si_client_secret ?? '' }}">
|
||||
|
||||
<meta name="translation-name-required" content="{{ ctrans('texts.missing_account_holder_name') }}">
|
||||
<meta name="translation-email-required" content="{{ ctrans('texts.provide_email') }}">
|
||||
<meta name="translation-terms-required" content="{{ ctrans('texts.you_need_to_accept_the_terms_before_proceeding') }}">
|
||||
|
||||
<form action="{{ route('client.payments.response') }}" method="post" id="server-response">
|
||||
@csrf
|
||||
<input type="hidden" name="gateway_response">
|
||||
<input type="hidden" name="company_gateway_id" value="{{ $gateway->getCompanyGatewayId() }}">
|
||||
<input type="hidden" name="payment_method_id" value="{{ $payment_method_id }}">
|
||||
<input type="hidden" name="payment_hash" value="{{ $payment_hash }}">
|
||||
<input type="hidden" name="store_card">
|
||||
<input type="hidden" name="token">
|
||||
</form>
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.sepa') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.pay_with')])
|
||||
@if (count($tokens) > 0)
|
||||
@foreach ($tokens as $token)
|
||||
<label class="mr-4">
|
||||
<input type="radio" data-token="{{ $token->token }}" name="payment-type"
|
||||
class="form-radio cursor-pointer toggle-payment-with-token" />
|
||||
<span class="ml-1 cursor-pointer">**** {{ $token->meta?->last4 }}</span>
|
||||
</label>
|
||||
@endforeach
|
||||
@endisset
|
||||
|
||||
<label>
|
||||
<input type="radio" id="toggle-payment-with-new-bank-account" class="form-radio cursor-pointer" name="payment-type"
|
||||
checked />
|
||||
<span class="ml-1 cursor-pointer">{{ __('texts.new_bank_account') }}</span>
|
||||
</label>
|
||||
@endcomponent
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element-single')
|
||||
<div id="stripe--payment-container">
|
||||
<label for="sepa-name">
|
||||
<input class="input w-full" id="sepa-name" type="text"
|
||||
placeholder="{{ ctrans('texts.bank_account_holder') }}">
|
||||
</label>
|
||||
<label for="sepa-email" class="mt-4">
|
||||
<input class="input w-full" id="sepa-email-address" type="email"
|
||||
placeholder="{{ ctrans('texts.email') }}">
|
||||
</label>
|
||||
<label>
|
||||
<div class="border p-3 rounded mt-2">
|
||||
<div id="sepa-iban"></div>
|
||||
</div>
|
||||
</label>
|
||||
<div id="mandate-acceptance" class="mt-4">
|
||||
<input type="checkbox" id="sepa-mandate-acceptance" class="input mr-4">
|
||||
<label for="sepa-mandate-acceptance" class="cursor-pointer">
|
||||
{{ ctrans('texts.sepa_mandat', ['company' => $contact->company->present()->name()]) }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endcomponent
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.save_card')
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-sepa.js')
|
||||
@endassets
|
@ -0,0 +1,30 @@
|
||||
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden py-5 bg-white sm:gap-4"
|
||||
id="stripe-sofort-payment">
|
||||
@if($gateway->company_gateway->getConfigField('account_id'))
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="stripe-publishable-key" content="{{ config('ninja.ninja_stripe_publishable_key') }}">
|
||||
@else
|
||||
<meta name="stripe-publishable-key" content="{{ $gateway->getPublishableKey() }}">
|
||||
@endif
|
||||
|
||||
<meta name="stripe-account-id" content="{{ $gateway->company_gateway->getConfigField('account_id') }}">
|
||||
<meta name="return-url" content="{{ $return_url }}">
|
||||
<meta name="amount" content="{{ $stripe_amount }}">
|
||||
<meta name="country" content="{{ $country }}">
|
||||
<meta name="customer" content="{{ $customer }}">
|
||||
<meta name="pi-client-secret" content="{{ $pi_client_secret }}">
|
||||
|
||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||
|
||||
@include('portal.ninja2020.gateways.includes.payment_details')
|
||||
|
||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||
{{ ctrans('texts.sofort') }} ({{ ctrans('texts.bank_transfer') }})
|
||||
@endcomponent
|
||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||
</div>
|
||||
|
||||
@assets
|
||||
<script src="https://js.stripe.com/v3/"></script>
|
||||
@vite('resources/js/clients/payments/stripe-sofort.js')
|
||||
@endassets
|
@ -50,6 +50,9 @@ export default defineConfig({
|
||||
'resources/js/clients/payments/stripe-przelewy24.js',
|
||||
'resources/js/clients/payments/stripe-browserpay.js',
|
||||
'resources/js/clients/payments/stripe-fpx.js',
|
||||
'resources/js/clients/payments/stripe-ach-pay.js',
|
||||
'resources/js/clients/payments/stripe-bank-transfer.js',
|
||||
'resources/js/clients/payment_methods/authorize-stripe-acss.js'
|
||||
]),
|
||||
viteStaticCopy({
|
||||
targets: [
|
||||
|
Loading…
x
Reference in New Issue
Block a user