cancel
Showing results for 
Search instead for 
Did you mean: 

Javascript buttons return error 401 from graphql with Sanbox client-id

Options
mpoletiek1
Contributor
Posted on

Hello,

 

Without any code changes on my site, all of a sudden, my sandbox client-id's don't seem to be working anymore. However, I'm not sure if this error is strictly related to my account. The full error is as follows.

 

update_client_config_error:

/graphql returned status 401\nCe/<@https://www.sandbox.paypal.com/smart/buttons?style.label=paypal&style.layout=vertical&style.color=wh..."

 

Can anyone help me troubleshoot this?

 

My Javascript looks like the following...

 

paypal.Buttons({
	style: {
		shape: 'pill',
		color: 'white',
		layout: 'vertical',
		label: 'paypal',
	},
    createOrder: function(data, actions) {
      return actions.order.create({
        purchase_units: [{
          amount: {
            value: '24.00'
          }
        }]
      });
    },
    onApprove: function(data, actions) {
      return actions.order.capture().then(function(details) {
        
        // Call your server to save the transaction
        return fetch('/pp/getOrder.php', {
          method: 'post',
          headers: {
            'content-type': 'application/json'
          },
          body: JSON.stringify({
            orderID: data.orderID,
			checkout: 'u5o5LI5RnKMQEM7J9hdCH5Bj2yGcPQas',
			customer: 100,
			cmd: 'newPlan'
          })
        }).then(function(val) { window.location.href='/ovpn/account.php'; });
      });
	
    }
  }).render('#paypal-button-container');


I'm also using Cloudflare.

Thanks for your time.

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.