mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 14:12:44 +01:00
Remove debbuging code
This commit is contained in:
parent
98a938235f
commit
b0e6c62049
@ -61,8 +61,7 @@ class BACS
|
||||
if ($request->session_id){
|
||||
$session = $this->stripe->stripe->checkout->sessions->retrieve($request->session_id, ['expand' => ['setup_intent']]);
|
||||
}
|
||||
file_put_contents("/home/blumagin/domains/blumagine.de/invoiceninja/log2.txt", $session);
|
||||
$this->storePaymentMethod($session, 1, $this->stripe->findOrCreateCustomer());
|
||||
$this->storePaymentMethod($session, $this->stripe->findOrCreateCustomer());
|
||||
|
||||
return redirect()->route('client.payment_methods.index');
|
||||
}
|
||||
@ -198,7 +197,7 @@ class BACS
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
}
|
||||
|
||||
private function storePaymentMethod($method, $payment_method_id, $customer)
|
||||
private function storePaymentMethod($method, $customer)
|
||||
{
|
||||
try {
|
||||
$payment_meta = new \stdClass;
|
||||
|
57
public/js/clients/payments/stripe-bacs.js
vendored
57
public/js/clients/payments/stripe-bacs.js
vendored
@ -1,55 +1,2 @@
|
||||
/**
|
||||
* 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 ProcessBACS {
|
||||
constructor(key, stripeConnect) {
|
||||
this.key = key;
|
||||
this.errors = document.getElementById('errors');
|
||||
this.stripeConnect = stripeConnect;
|
||||
}
|
||||
|
||||
setupStripe = () => {
|
||||
|
||||
if (this.stripeConnect){
|
||||
// this.stripe.stripeAccount = this.stripeConnect;
|
||||
|
||||
this.stripe = Stripe(this.key, {
|
||||
stripeAccount: this.stripeConnect,
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
this.stripe = Stripe(this.key);
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
handle = () => {
|
||||
document.getElementById('authorize-bacs').addEventListener('click', (e) => {
|
||||
let errors = document.getElementById('errors');
|
||||
|
||||
document.getElementById('authorize-bacs').disabled = true;
|
||||
document.querySelector('#authorize-bacs > svg').classList.remove('hidden');
|
||||
document.querySelector('#authorize-bacs > span').classList.add('hidden');
|
||||
location.href=document.querySelector('meta[name=stripe-redirect-url').content;
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
const publishableKey = document.querySelector(
|
||||
'meta[name="stripe-publishable-key"]'
|
||||
)?.content ?? '';
|
||||
|
||||
const stripeConnect =
|
||||
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||
|
||||
new ProcessBACS(publishableKey, stripeConnect).setupStripe().handle();
|
||||
/*! For license information please see stripe-bacs.js.LICENSE.txt */
|
||||
(()=>{var e,t,n,r;function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var a=o((function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"setupStripe",(function(){return r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key),r})),c(this,"handle",(function(){document.getElementById("authorize-bacs").addEventListener("click",(function(e){document.getElementById("errors");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.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}));new a(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void 0===t?void 0:t.content)&&void 0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void 0===r?void 0:r.content)&&void 0!==n?n:"").setupStripe().handle()})();
|
Loading…
Reference in New Issue
Block a user