Problem with ExpressCheckout

JSP_Solutions
Contributor
Contributor

Hi,

 

I have some issues with the Paypal API ExpressCheckout.

 

My first steps are : 

1) SetExpressCheckout call

2) Redirect to the paypal page

 

Everything works fine at this moment.

 

After that, I call GetExpressCheckoutDetails to have the Paypal payerID. Ather, I do a DoExpressCheckoutPayment. 

 

The problem is I never receive an email for the receipt and I never see a pending transactions in my account... When I display the result from the cURL of DoExpressCheckoutPayment call, I always receive a CHECKOUTSTATUS=PaymentActionNotInitiated.

 

So where is the problem ?

 

 

There is my code for the DoExpressCheckoutPayment call : 

 

// curl init
            $url = $PAYPAL_TARGET_URL;
            $fields = array(
                            'TOKEN'                             => $_GET['token'],
                            'PAYERID'                           => $result_data['PAYERID'],
                            'PAYMENTREQUEST_0_AMT'              => $result_data['L_PAYMENTREQUEST_0_AMT0'],
                            'PAYMENTREQUEST_0_CURRENCYCODE'     => 'CAD',
                            'PAYMENTREQUEST_0_PAYMENTACTION'    => 'Sale',
                            'METHOD'                            => 'DoExpressCheckoutPayment',
                            'LC'                                => 'FR'
                            );
                            
            //url-ify the data for the POST
            foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
            rtrim($fields_string, '&');
            
            //open connection
            $ch = curl_init();

            //set the url, number of POST vars, POST data
            curl_setopt($ch,CURLOPT_URL, $url);
            curl_setopt($ch,CURLOPT_POST, count($fields));
            curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
            curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);

            //execute post
            $result = curl_exec($ch);

            //close connection
            curl_close($ch);

 

Do I miss some steps ? I followed the documentation step by step...

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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