Question

I have a problem when passing information from "SetExpressCheckout" to "DoExpressCheckout" using PayPal adaptive services.

Currently, I am doing like this:

// Single-item purchase
$nvps["METHOD"] = "SetExpressCheckout";
$nvps["PAYMENTREQUEST_0_NUMBER"] = "itemnumber";
$nvps["PAYMENTREQUEST_0_CUSTOM"] = "customvalue";

Then, I in the "DoExpressCheckout", I am doing it like this:

$nvps["METHOD"] = "DoExpressCheckoutPayment";
$nvps["PAYMENTREQUEST_0_CUSTOM"] = $response["CUSTOM"];
$nvps["PAYMENTREQUEST_0_NUMBER"] = $response["NUMBER"];

So, the weird thing here is the PAYMENTREQUEST_0_CUSTOM is actually getting passed to the DoExpressCheckout:

var_dump($nvps);

Gives me:

array(9) {
  ["VERSION"]=>
  string(5) "109.0"
  ["METHOD"]=>
  string(24) "DoExpressCheckoutPayment"
  ["PAYMENTREQUEST_0_CUSTOM"]=>
  string(6) "itemnumber"
  ["PAYMENTREQUEST_0_NUMBER"]=>
  NULL
 }

But as you can see, the PAYMENTREQUEST_0_NUMBER is NULL.

Why is that? Shouldn't it function just the same way as I am setting the CUSTOM value?

Was it helpful?

Solution

Did you mean to use "L_PAYMENTREQUEST_n_NUMBERm" ?
I don't think there is a PAYMENTREQUEST_0_NUMBER.

L_PAYMENTREQUEST_n_NUMBERm
(Optional) Item number. You can specify up to 10 payments, where n is a digit between 0 and 9, inclusive, and m specifies the list item within the payment. These parameters must be ordered sequentially beginning with 0 (for example L_PAYMENTREQUEST_n_NUMBER0, L_PAYMENTREQUEST_n_NUMBER1).
Character length and limitations: 127 single-byte characters.
This field is introduced in version 53.0. L_NUMBERn is deprecated since version 63.0. Use L_PAYMENTREQUEST_0_NUMBERm instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top