planet x
planet x

Reputation: 1607

paypal payment action missing

I did what necessarily the latest available documentation says in integrating the PayPal in our shop system. I just found out that it seems like there PAYMENTREQUEST_n_PAYMENTACTION parameter in NVP.

I get payment details using the token and PayerID returned by SetExpressCheckout. When I output my returned cURL, I just found out this:

[CHECKOUTSTATUS] => PaymentActionNotInitiated

What seems to be the problem?

I use this query in cURL:

// Prepare PayPal API URL
$url = "https://api-3t.sandbox.paypal.com/nvp";

// $PAYMENTACTION = "Sale"

// Prepare PayPal NVP (Name-Value Pair) payment request
$nvp = "METHOD=" . $SETMETHOD;
$nvp .= "&VERSION=" . $VERSION;
$nvp .= "&USER=" . $USERNAME;
$nvp .= "&PWD=" . $PASSWORD;
$nvp .= "&SIGNATURE=" . $SIGNATURE;
$nvp .= "&PAYMENTREQUEST_0_PAYMENTACTION=" . $PAYMENTACTION;
$nvp .= "&PAYMENTREQUEST_0_CURRENCYCODE=" . $CURRENCY;
$nvp .= "&SOLUTIONTYPE=" . $SOLUTIONTYPE;
$nvp .= "&RETURNURL=" . $RETURNURL;
$nvp .= "&CANCELURL=" . $CANCELURL;
$nvp .= "&L_PAYMENTREQUEST_0_NAME0=" . $PAYMENTNAME0;
$nvp .= "&L_PAYMENTREQUEST_0_DESC0=" . $PAYMENTDESC0;
$nvp .= "&L_PAYMENTREQUEST_0_AMT0=" . $PAYMENTAMT0;
$nvp .= "&L_PAYMENTREQUEST_0_QTY0=" . $PAYMENTQTY0;
$nvp .= "&PAYMENTREQUEST_0_ITEMAMT=" . $PAYMENTITEMAMT;
$nvp .= "&PAYMENTREQUEST_0_AMT=" . $PAYMENTAMT;
$nvp .= "&PAYMENTREQUEST_0_CURRENCYCODE=" . $CURRENCY;
$nvp .= "&LOCALECODE=" . $LOCALECODE;
$nvp .= "&HDRIMG=" . $HEADERLOGO;
$nvp .= "&PAYFLOWCOLOR=" . 262626;

Upvotes: 2

Views: 3393

Answers (1)

Robert
Robert

Reputation: 19356

PaymentActionNotInitiated does not refer to PAYMENTREQUEST_0_PAYMENTACTION.
It merely means that you have not yet direct a buyer to the PayPal page in order to confirm his/her payment.

To recap, this is how Express Checkout works:

  1. SetExpressCheckout sets up the payment and returns a token
  2. You redirect the buyer to https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=TOKEN-HERE, where TOKEN-HERE is the token you received earlier
  3. After the buyer has agreed to the payment, he is returned back to your site
  4. You can call GetExpressCheckoutDetails and supply the token as a parameter to get the PAYERID of the buyer.
  5. Call DoExpressCheckoutPayment with the token and PAYERID supplied to finalize the payment

Upvotes: 9

Related Questions