mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Explicitly send cookies in fetch
Not sent by default in old browsers
This commit is contained in:
parent
5be88678e7
commit
23cb96e6f9
12 changed files with 15 additions and 1 deletions
|
@ -16,6 +16,7 @@ class CartActionHandler {
|
|||
this.config.bn_codes[this.config.context] : '';
|
||||
return fetch(this.config.ajax.create_order.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: this.config.ajax.create_order.nonce,
|
||||
purchase_units: [],
|
||||
|
|
|
@ -31,6 +31,7 @@ class CheckoutActionHandler {
|
|||
|
||||
return fetch(this.config.ajax.create_order.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: this.config.ajax.create_order.nonce,
|
||||
payer,
|
||||
|
|
|
@ -18,6 +18,7 @@ class FreeTrialHandler {
|
|||
|
||||
fetch(this.config.ajax.vault_paypal.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: this.config.ajax.vault_paypal.nonce,
|
||||
return_url: location.href
|
||||
|
|
|
@ -80,6 +80,7 @@ class SingleProductActionHandler {
|
|||
this.config.bn_codes[this.config.context] : '';
|
||||
return fetch(this.config.ajax.create_order.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: this.config.ajax.create_order.nonce,
|
||||
purchase_units,
|
||||
|
|
|
@ -27,6 +27,7 @@ const storeToken = (token) => {
|
|||
const dataClientIdAttributeHandler = (script, config) => {
|
||||
fetch(config.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: config.nonce
|
||||
})
|
||||
|
|
|
@ -20,6 +20,7 @@ class UpdateCart {
|
|||
this.endpoint,
|
||||
{
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: this.nonce,
|
||||
products,
|
||||
|
@ -42,4 +43,4 @@ class UpdateCart {
|
|||
}
|
||||
}
|
||||
|
||||
export default UpdateCart;
|
||||
export default UpdateCart;
|
||||
|
|
|
@ -2,6 +2,7 @@ const onApprove = (context, errorHandler) => {
|
|||
return (data, actions) => {
|
||||
return fetch(context.config.ajax.approve_order.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: context.config.ajax.approve_order.nonce,
|
||||
order_id:data.orderID,
|
||||
|
|
|
@ -5,6 +5,7 @@ const onApprove = (context, errorHandler, spinner) => {
|
|||
|
||||
return fetch(context.config.ajax.approve_order.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: context.config.ajax.approve_order.nonce,
|
||||
order_id:data.orderID,
|
||||
|
|
|
@ -80,6 +80,7 @@ const ppcp_onboarding = {
|
|||
|
||||
fetch(PayPalCommerceGatewayOnboarding.pui_endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: PayPalCommerceGatewayOnboarding.pui_nonce,
|
||||
checked: onboard_pui.checked
|
||||
|
|
|
@ -20,6 +20,7 @@ document.addEventListener(
|
|||
submitButton.setAttribute('disabled', 'disabled');
|
||||
fetch(config.ajax.tracking_info.endpoint, {
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: config.ajax.tracking_info.nonce,
|
||||
transaction_id: transactionId ? transactionId.value : null,
|
||||
|
|
|
@ -10,6 +10,7 @@ document.addEventListener(
|
|||
PayPalCommerceGatewayVaulting.delete.endpoint,
|
||||
{
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
|
|
|
@ -10,6 +10,7 @@ document.addEventListener(
|
|||
PayPalCommerceGatewayWebhooksStatus.resubscribe.endpoint,
|
||||
{
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
|
@ -52,6 +53,7 @@ document.addEventListener(
|
|||
PayPalCommerceGatewayWebhooksStatus.simulation.start.endpoint,
|
||||
{
|
||||
method: 'POST',
|
||||
credentials: 'same-origin',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
|
@ -106,6 +108,7 @@ document.addEventListener(
|
|||
PayPalCommerceGatewayWebhooksStatus.simulation.state.endpoint,
|
||||
{
|
||||
method: 'GET',
|
||||
credentials: 'same-origin',
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue