Error on the final checkout page (Paypal Sandbox)

Hi !

I'm sorry to disturb you once again, but I have a problem with Marketpress during the checkout :

I'm getting an error on the final checkout page when using a PayPal sandbox account that says Missing argument 6 for MP_Gateway_Paypal_Express::smiley:oExpressCheckoutPayment()... (this repeats for arguments 3 - 6) called in plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php

So, can you explain this problem, or help me ?

  • maxaud
    • The Crimson Coder

    This code looks like it needs to be edited on the plugin as it currently accepts 6 parameters but is only using the first two.

    Additionally, there is a var_dump() being called in that function which I'm sure is not intended.

    Change the method from this on line 1048 of /marketpress/marketpress-includes/plugins-gateway/paypal-express.php...

    //Purpose: 	Prepares the parameters for the DoExpressCheckoutPayment API Call.
    	function DoExpressCheckoutPayment($token, $payer_id, $final_amts, $seller_paypal_accounts, $ipns, $prs) {
    
    		$nvpstr  = '&TOKEN=' . urlencode($token);
    	  $nvpstr .= '&PAYERID=' . urlencode($payer_id);
    		$nvpstr .= $_SESSION['nvpstr'];
    		var_dump($nvpstr);
    	  /* Make the call to PayPal to finalize payment
    	    */
    	  return $this->api_call("DoExpressCheckoutPayment", $nvpstr);
    	}

    to this:

    //Purpose: 	Prepares the parameters for the DoExpressCheckoutPayment API Call.
    	function DoExpressCheckoutPayment($token, $payer_id ) {
    
    		$nvpstr  = '&TOKEN=' . urlencode($token);
    	  $nvpstr .= '&PAYERID=' . urlencode($payer_id);
    		$nvpstr .= $_SESSION['nvpstr'];
    	  /* Make the call to PayPal to finalize payment
    	    */
    	  return $this->api_call("DoExpressCheckoutPayment", $nvpstr);
    	}
  • Kimberly
    • Champion of Loops

    Hi there!

    I'm sorry to disturb you once again,

    That is what we are here for! Don't be sorry!

    You can try the above advice if it makes sense to you :slight_smile: If not I will see what we can do. I have asked the developer to stop in and see about maxaud's statement

    This code looks like it needs to be edited on the plugin as it currently accepts 6 parameters but is only using the first two.

    Additionally, there is a var_dump() being called in that function which I'm sure is not intended.

    Thanks @maxaud

    Kimberly

  • EspaceRA
    • Design Lord, Child of Thor

    Thank you maxaud and Kimberly !

    But before to make changement, do you know if these variables ($final_amts, $seller_paypal_accounts, $ipns, $prs) are usefull if we don't use the Sandbox Paypal ? Because if it doesn't work only during the test phase, and if these variables are important with other payment, I don't want to delete it...

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.