mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Add content type json to all fetch ajax endpoints
This commit is contained in:
parent
5ceb39c9e0
commit
8d97954f42
7 changed files with 21 additions and 0 deletions
|
@ -49,6 +49,9 @@ class FreeTrialHandler {
|
|||
|
||||
const res = await fetch(this.config.ajax.vault_paypal.endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: this.config.ajax.vault_paypal.nonce,
|
||||
|
|
|
@ -27,6 +27,9 @@ const storeToken = (token) => {
|
|||
const dataClientIdAttributeHandler = (script, config) => {
|
||||
fetch(config.endpoint, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: config.nonce
|
||||
|
|
|
@ -10,6 +10,9 @@ export default class FormSaver {
|
|||
|
||||
const res = await fetch(this.url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: this.nonce,
|
||||
|
|
|
@ -10,6 +10,9 @@ export default class FormValidator {
|
|||
|
||||
const res = await fetch(this.url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: this.nonce,
|
||||
|
|
|
@ -20,6 +20,9 @@ class UpdateCart {
|
|||
this.endpoint,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
credentials: 'same-origin',
|
||||
body: JSON.stringify({
|
||||
nonce: this.nonce,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue