mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-30 23:54:33 -04:00
Fixes for EPS
This commit is contained in:
parent
976110e8f3
commit
6496b99379
@ -55,7 +55,7 @@ class BECS
|
|||||||
'payment_method_types' => ['au_becs_debit'],
|
'payment_method_types' => ['au_becs_debit'],
|
||||||
'setup_future_usage' => 'off_session',
|
'setup_future_usage' => 'off_session',
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::BECS,
|
'gateway_type_id' => GatewayType::BECS,
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
*
|
*
|
||||||
* @license https://www.elastic.co/licensing/elastic-license
|
* @license https://www.elastic.co/licensing/elastic-license
|
||||||
*/
|
*/
|
||||||
@ -51,7 +51,7 @@ class Bancontact
|
|||||||
'currency' => 'eur',
|
'currency' => 'eur',
|
||||||
'payment_method_types' => ['bancontact'],
|
'payment_method_types' => ['bancontact'],
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::BANCONTACT,
|
'gateway_type_id' => GatewayType::BANCONTACT,
|
||||||
|
@ -70,7 +70,7 @@ class BrowserPay implements MethodInterface
|
|||||||
'amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
|
'amount' => $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
|
||||||
'currency' => $this->stripe->client->getCurrencyCode(),
|
'currency' => $this->stripe->client->getCurrencyCode(),
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::APPLE_PAY,
|
'gateway_type_id' => GatewayType::APPLE_PAY,
|
||||||
|
@ -51,7 +51,7 @@ class EPS
|
|||||||
'currency' => 'eur',
|
'currency' => 'eur',
|
||||||
'payment_method_types' => ['eps'],
|
'payment_method_types' => ['eps'],
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::EPS,
|
'gateway_type_id' => GatewayType::EPS,
|
||||||
|
@ -52,7 +52,7 @@ class FPX
|
|||||||
'currency' => $this->stripe->client->getCurrencyCode(),
|
'currency' => $this->stripe->client->getCurrencyCode(),
|
||||||
'payment_method_types' => ['fpx'],
|
'payment_method_types' => ['fpx'],
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::FPX,
|
'gateway_type_id' => GatewayType::FPX,
|
||||||
|
@ -51,7 +51,7 @@ class GIROPAY
|
|||||||
'currency' => 'eur',
|
'currency' => 'eur',
|
||||||
'payment_method_types' => ['giropay'],
|
'payment_method_types' => ['giropay'],
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::GIROPAY,
|
'gateway_type_id' => GatewayType::GIROPAY,
|
||||||
|
@ -47,15 +47,7 @@ class Klarna
|
|||||||
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
|
||||||
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
$data['country'] = $this->stripe->client->country->iso_3166_2;
|
||||||
|
|
||||||
$amount = $data['total']['amount_with_fee'];
|
$description = $this->stripe->getDescription(false);
|
||||||
|
|
||||||
$invoice_numbers = collect($data['invoices'])->pluck('invoice_number');
|
|
||||||
|
|
||||||
if ($invoice_numbers->count() > 0) {
|
|
||||||
$description = ctrans('texts.stripe_payment_text', ['invoicenumber' => $invoice_numbers->implode(', '), 'amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()], $this->stripe->client->company->locale());
|
|
||||||
} else {
|
|
||||||
$description = ctrans('texts.stripe_payment_text_without_invoice', ['amount' => Number::formatMoney($amount, $this->stripe->client), 'client' => $this->stripe->client->present()->name()], $this->stripe->client->company->locale());
|
|
||||||
}
|
|
||||||
|
|
||||||
$intent = \Stripe\PaymentIntent::create([
|
$intent = \Stripe\PaymentIntent::create([
|
||||||
'amount' => $data['stripe_amount'],
|
'amount' => $data['stripe_amount'],
|
||||||
|
@ -51,7 +51,7 @@ class PRZELEWY24
|
|||||||
'currency' => 'eur',
|
'currency' => 'eur',
|
||||||
'payment_method_types' => ['p24'],
|
'payment_method_types' => ['p24'],
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::PRZELEWY24,
|
'gateway_type_id' => GatewayType::PRZELEWY24,
|
||||||
|
@ -60,7 +60,7 @@ class SEPA
|
|||||||
'payment_method_types' => ['sepa_debit'],
|
'payment_method_types' => ['sepa_debit'],
|
||||||
'setup_future_usage' => 'off_session',
|
'setup_future_usage' => 'off_session',
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::SEPA,
|
'gateway_type_id' => GatewayType::SEPA,
|
||||||
|
@ -51,7 +51,7 @@ class SOFORT
|
|||||||
'currency' => 'eur',
|
'currency' => 'eur',
|
||||||
'payment_method_types' => ['sofort'],
|
'payment_method_types' => ['sofort'],
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::SOFORT,
|
'gateway_type_id' => GatewayType::SOFORT,
|
||||||
|
@ -51,7 +51,7 @@ class iDeal
|
|||||||
'currency' => 'eur',
|
'currency' => 'eur',
|
||||||
'payment_method_types' => ['ideal'],
|
'payment_method_types' => ['ideal'],
|
||||||
'customer' => $this->stripe->findOrCreateCustomer(),
|
'customer' => $this->stripe->findOrCreateCustomer(),
|
||||||
'description' => $this->stripe->decodeUnicodeString(ctrans('texts.invoices').': '.collect($data['invoices'])->pluck('invoice_number')),
|
'description' => $this->stripe->getDescription(false),
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'payment_hash' => $this->stripe->payment_hash->hash,
|
'payment_hash' => $this->stripe->payment_hash->hash,
|
||||||
'gateway_type_id' => GatewayType::IDEAL,
|
'gateway_type_id' => GatewayType::IDEAL,
|
||||||
|
3
public/js/clients/payments/stripe-eps.js
vendored
3
public/js/clients/payments/stripe-eps.js
vendored
@ -65,7 +65,6 @@ var ProcessEPSPay = /*#__PURE__*/_createClass(function ProcessEPSPay(key, stripe
|
|||||||
if (!document.getElementById('eps-name').value) {
|
if (!document.getElementById('eps-name').value) {
|
||||||
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
||||||
errors.hidden = false;
|
errors.hidden = false;
|
||||||
console.log("name");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +76,7 @@ var ProcessEPSPay = /*#__PURE__*/_createClass(function ProcessEPSPay(key, stripe
|
|||||||
payment_method: {
|
payment_method: {
|
||||||
eps: _this.eps,
|
eps: _this.eps,
|
||||||
billing_details: {
|
billing_details: {
|
||||||
name: document.getElementById("ideal-name").value
|
name: document.getElementById("eps-name").value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
return_url: document.querySelector('meta[name="return-url"]').content
|
return_url: document.querySelector('meta[name="return-url"]').content
|
||||||
|
14
public/js/clients/payments/stripe-przelewy24.js
vendored
14
public/js/clients/payments/stripe-przelewy24.js
vendored
@ -102,6 +102,20 @@ var ProcessPRZELEWY24 = /*#__PURE__*/_createClass(function ProcessPRZELEWY24(key
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
return_url: document.querySelector('meta[name="return-url"]').content
|
return_url: document.querySelector('meta[name="return-url"]').content
|
||||||
|
}).then(function (result) {
|
||||||
|
if (result.error) {
|
||||||
|
// Show error to your customer
|
||||||
|
errors.textContent = result.error.message;
|
||||||
|
errors.hidden = false;
|
||||||
|
document.getElementById('pay-now').disabled = false;
|
||||||
|
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||||
|
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||||
|
} else {
|
||||||
|
// The payment has been processed!
|
||||||
|
if (result.paymentIntent.status === 'succeeded') {
|
||||||
|
window.location = document.querySelector('meta[name="return-url"]').content;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -38,9 +38,9 @@
|
|||||||
"/js/clients/payments/stripe-acss.js": "/js/clients/payments/stripe-acss.js?id=447c587a5eeb0c1de3091c8358db7ad7",
|
"/js/clients/payments/stripe-acss.js": "/js/clients/payments/stripe-acss.js?id=447c587a5eeb0c1de3091c8358db7ad7",
|
||||||
"/js/clients/payments/stripe-bancontact.js": "/js/clients/payments/stripe-bancontact.js?id=f694d3f9f01e4550cb5a3eb6cb43c12d",
|
"/js/clients/payments/stripe-bancontact.js": "/js/clients/payments/stripe-bancontact.js?id=f694d3f9f01e4550cb5a3eb6cb43c12d",
|
||||||
"/js/clients/payments/stripe-becs.js": "/js/clients/payments/stripe-becs.js?id=97ea3555a8504662eda5fce9c9115e5a",
|
"/js/clients/payments/stripe-becs.js": "/js/clients/payments/stripe-becs.js?id=97ea3555a8504662eda5fce9c9115e5a",
|
||||||
"/js/clients/payments/stripe-eps.js": "/js/clients/payments/stripe-eps.js?id=749cba1332a29baa444b37cee2ade2d7",
|
"/js/clients/payments/stripe-eps.js": "/js/clients/payments/stripe-eps.js?id=146d48d03f5fc4b1cf122189119e2877",
|
||||||
"/js/clients/payments/stripe-ideal.js": "/js/clients/payments/stripe-ideal.js?id=34cf4ee3f189427fb69d0df8f5a4b766",
|
"/js/clients/payments/stripe-ideal.js": "/js/clients/payments/stripe-ideal.js?id=34cf4ee3f189427fb69d0df8f5a4b766",
|
||||||
"/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=448b197a1d94b4408e130b5b8b1c2e53",
|
"/js/clients/payments/stripe-przelewy24.js": "/js/clients/payments/stripe-przelewy24.js?id=cfdcc5bf20d6bfa09700708dfdd943e2",
|
||||||
"/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=7015e43eb5f9f9f2f45f54b41b5780a0",
|
"/js/clients/payments/stripe-browserpay.js": "/js/clients/payments/stripe-browserpay.js?id=7015e43eb5f9f9f2f45f54b41b5780a0",
|
||||||
"/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=243c2929386b10c6a0c49ca3bcabfb2d",
|
"/js/clients/payments/stripe-fpx.js": "/js/clients/payments/stripe-fpx.js?id=243c2929386b10c6a0c49ca3bcabfb2d",
|
||||||
"/css/app.css": "/css/app.css?id=0cb847167b91d8db2ca50d30e0d691ae",
|
"/css/app.css": "/css/app.css?id=0cb847167b91d8db2ca50d30e0d691ae",
|
||||||
|
3
resources/js/clients/payments/stripe-eps.js
vendored
3
resources/js/clients/payments/stripe-eps.js
vendored
@ -56,7 +56,6 @@ class ProcessEPSPay {
|
|||||||
if (!document.getElementById('eps-name').value) {
|
if (!document.getElementById('eps-name').value) {
|
||||||
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
errors.textContent = document.querySelector('meta[name=translation-name-required]').content;
|
||||||
errors.hidden = false;
|
errors.hidden = false;
|
||||||
console.log("name");
|
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
document.getElementById('pay-now').disabled = true;
|
document.getElementById('pay-now').disabled = true;
|
||||||
@ -69,7 +68,7 @@ class ProcessEPSPay {
|
|||||||
payment_method: {
|
payment_method: {
|
||||||
eps: this.eps,
|
eps: this.eps,
|
||||||
billing_details: {
|
billing_details: {
|
||||||
name: document.getElementById("ideal-name").value,
|
name: document.getElementById("eps-name").value,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
return_url: document.querySelector(
|
return_url: document.querySelector(
|
||||||
|
@ -93,7 +93,22 @@ class ProcessPRZELEWY24 {
|
|||||||
},
|
},
|
||||||
return_url: document.querySelector('meta[name="return-url"]').content,
|
return_url: document.querySelector('meta[name="return-url"]').content,
|
||||||
}
|
}
|
||||||
);
|
).then(function (result) {
|
||||||
|
|
||||||
|
if (result.error) {
|
||||||
|
// Show error to your customer
|
||||||
|
errors.textContent = result.error.message;
|
||||||
|
errors.hidden = false;
|
||||||
|
document.getElementById('pay-now').disabled = false;
|
||||||
|
document.querySelector('#pay-now > svg').classList.add('hidden');
|
||||||
|
document.querySelector('#pay-now > span').classList.remove('hidden');
|
||||||
|
} else {
|
||||||
|
// The payment has been processed!
|
||||||
|
if (result.paymentIntent.status === 'succeeded') {
|
||||||
|
window.location = document.querySelector('meta[name="return-url"]').content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user