Marketpress issue with live mode - * 550006 - The application is not authorized for the user

I have tested the WPMU with MarketPress in sandbox mode (set to PayPal Chained Payment only).

Now I entered the PayPal live app ID and other things from paypal inside the network admin MakrtPress settings, and then entered a business paypal account email in sub-blog Marketpress' payment setting, it should work like it was in sandbox mode.

But when I tested the check out, I saw:

There was a problem connecting to PayPal to setup your purchase. Please try again.

* 550006 - The application is not authorized for the user

Any idea to debug this issue? What should I look into?

Thanks a lot in advance :slight_smile:

  • winning
    • The Incredible Code Injector

    I found on the x.com the following message where people posted the same issue.

    My question is: how to find the "the API call headers" in MarketPress? Just want to check it if that is right.

    The reason you are getting this error is because the account you are using the API call headers is not the same as the PayPal account you used to submit the application. The APP-ID is provided for a single account only, you cannot use it on multiple accounts.

    https://www.x.com/developers/paypal/forums/adaptive-payments-api/my-app-gets-error-theapplicationisnotauthorizedfortheuser-550006#answer-205223

    https://www.x.com/developers/paypal/forums/adaptive-payments-api/why-am-i-getting-error-application-not-authorized-user-550006

    Thanks!

  • Timothy Bowers
    • Chief Pigeon

    Hey again :slight_smile:

    I notice on the page you link to Ciaran explained:

    This error would generally occur if you are using an APP-ID with a PayPal account other than the PayPal account the APP-ID was assigned to. An APP-ID can only be used with a PayPal account it is assigned to. So if you submitted an app through x.com with one email address and are using the APP-ID on another you will get this error.

    So I suppose the next question is does your x.com email match that of your Paypal account?

    I'll ping the developer on this one to see if he has any ideas as its not something I've experienced myself.

    Take care.

  • Aaron
    • CTO

    Just to make doubly sure, all the PayPal info you have in network settings is from the same love account that your app Id is assigned to?

    Sometimes people accidentally leave their sandbox info there. And of course make sure the stores PayPal email is of a different account.

  • winning
    • The Incredible Code Injector

    Hi Aaron,

    Yes, checked it a few times, same paypal account that app id was assigned to and I'm using the live id.

    PayPal is asking:

    request headers and body sent to PayPal
    response from PayPal (correlation Id and time stamp, etc.)
    the url where the request was sent to

    How can I get this kind of information from MarketPress?

    The error happened when buyers checked out on sub-blog store.

    Thanks a lot :slight_smile:

  • winning
    • The Incredible Code Injector

    Thank you Aaron for the code! I got the sent and received message from Paypal. I've provided it to Paypal and wait to see what they would say.

    Quick question: I do not actually see the live PayPal API Credentials in the "sent message" to Paypal, such as "API Username", "API Password", "Signature", or "Application ID". Are those in the "header"?

    How to display the header in the debug email?

  • johnnymestizo
    • HummingBird

    Hi

    Line 686 seems to be in the middle of an args array. (X-PAYPAL-REQUEST-RESPONSE-FORMAT)

    Can I get a confirmation of where to put the above code? Perhaps the line numbering has changed in the past year...

    function api_call($methodName, $nvpStr) {
        global $mp;
    
        //build args
        $args['headers'] = array(
          'X-PAYPAL-SECURITY-USERID' => $this->API_Username,
          'X-PAYPAL-SECURITY-PASSWORD' => $this->API_Password,
          'X-PAYPAL-SECURITY-SIGNATURE' => $this->API_Signature,
          'X-PAYPAL-DEVICE-IPADDRESS' => $_SERVER['REMOTE_ADDR'],
          'X-PAYPAL-REQUEST-DATA-FORMAT' => 'NV',
          'X-PAYPAL-REQUEST-RESPONSE-FORMAT' => 'NV',
          'X-PAYPAL-APPLICATION-ID' => $this->appId
        );
      	$args['user-agent'] = "MarketPress/{$mp->version}: https://premium.wpmudev.org/project/e-commerce | PayPal Chained Payments Plugin/{$mp->version}";
        $args['body'] = $nvpStr . '&requestEnvelope.errorLanguage=en_US';
        $args['sslverify'] = false;
    		$args['timeout'] = 60;
    
        //use built in WP http class to work with most server setups
      	$response = wp_remote_post($this->API_Endpoint . $methodName, $args);
    
      	if (is_wp_error($response) || wp_remote_retrieve_response_code($response) != 200) {
          $mp->cart_checkout_error( __('There was a problem connecting to PayPal. Please try again.', 'mp') );
          return false;
        } else {
          //convert NVPResponse to an Associative Array
    		  $nvpResArray = $this->deformatNVP($response['body']);
    		  return $nvpResArray;
        }
    
    	}

    Thanks

    Johnny

  • johnnymestizo
    • HummingBird

    Still cant get it to work sorry...

    $args['sslverify'] = false;
    		$args['timeout'] = 60;
    
    //paypal debugging
    wp_mail('my_email_address_goes_here', 'Paypal debugging', var_export($args['headers'], true)."\n\nSent:\n{$args['body']}\n\nReceived:\n{$response['body']}");
    
        //use built in WP http class to work with most server setups
      	$response = wp_remote_post($this->API_Endpoint . $methodName, $args);

    Cheers,

    Johnny

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.