Closed adrienverge closed 1 year ago
It can be desirable to use localstripe from a user-defined URL with a custom path, e.g.:
https://domain/subpath/js.stripe.com/v3/ https://domain/subpath/v1/payment_intents/ https://domain/subpath/v1/customers/cus_S5TdpWqIoiuKlq/sources
instead of:
http://domain:8420/js.stripe.com/v3/ http://domain:8420/v1/payment_intents/ http://domain:8420/v1/customers/cus_S5TdpWqIoiuKlq/sources
This can be achieved by using a reverse-proxy for example, but the JavaScript part of localstripe didn't support it.
This commit fixes that by dynamically computing the base API URL from which the JavaScript code is loaded.
Thanks for reviewing!
It can be desirable to use localstripe from a user-defined URL with a custom path, e.g.:
instead of:
This can be achieved by using a reverse-proxy for example, but the JavaScript part of localstripe didn't support it.
This commit fixes that by dynamically computing the base API URL from which the JavaScript code is loaded.