2 weeks ago
Hi.
I'm trying to do an advanced integration with PapPal, and I use a fetch() with a POST request. This request returns a '405 Method Not Allowed' error.
If I use the same request with Ajax, it works fine, but I have to do it with fetch() because Ajax is asynchronous and it doesn't work properly.
I've done all the CROS origin configurations, but I'm still in the same situation.
This is the configuration:
corsfilter.default.allowedMethods=GET POST HEAD PUT PATCH DELETE OPTIONS FETCH
corsfilter.default.allowedOrigins=*
corsfilter.default.allowedHeaders=*
xss.filter.header.X-Frame-Options=*
xss.filter.header.Access-Control-Allow-Origin=*
This is the request from js, in storefront:
// Render the button component
paypal
.Buttons({
// Sets up the transaction when a payment button is clicked
createOrder: function (data) {
return fetch(ACC.config.encodedContextPath', {
method: "POST",
body: {
"paymentSource": data.paymentSource,
}
})
.then((response) => response.json())
.then((order) => order.id);
}
})
.render("#paypal-button-container");
With all this setup, this is the message error I get always
Any idea what I'm missing? I'm using the 1808.2 hybris version.
Thanx a lot.
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.