0

I'm on localhost without ssl and fix IP. I can checkout with PayPal WPS, go to sandbox, confirm as buyer, and when I click in the sandbox I go back to my testsite after confirming to leave SSL.

In my logs I can see (watchdog) that the function commerce_paypal_wps_redirect_form_validate() works fine and gives me a lot of data from my client and the transaction.

In my sandbox seller account I can see the payment is accepted and I earned my bucks ;)

Here the problems:

The orders overview at admin/commerce/orders only shows pending orders instead completed although the posted data from paypal show

[payment_status] => Completed

Next when I go to the payment of any order I see that there's no payment method available although payment is done per WPS.

admin/commerce/orders/1/payment:

No payment methods available to add payments.

I believe that these are the reasons why my hook I want to use is not called?? I want to change the user role after the transaction is completed so I took hook_commerce_paypal_ipn_process() without success.

Does anybody has any ideas??

My modules: commerce 7.x-1.11+52-dev, PayPal 7.x-2.3+4-dev, Commerce (Tax)7.x-1.0-rc2, rules 7.x-2.9

2 Answers 2

0

PayPal WPS has to send IPN to your Drupal website(application) in order for Drupal to process and store payment for the order. When IPN is received and payment transaction is registered in db you can then run some logic (via Rules) to set the order status accordingly and do other things.

You are not receiving IPN from PayPal because your website is on the local host. You have to host your website on live domain(sub domain, domain sub folder , etc.) so that PayPal server can ping yours and send you data.

Read your question a few more times, and here's more thoughts:

You may be messing up PayPal WPS module's logic by using that hook in a wrong way. Why not assign the role via Rules?

4
  • Thank you but I'm sure that I receive the IPN! The conditions of the commerce_paypal_wps_redirect_form_validate() are that the IPN is set and the watchdog function in this function writes the IPN data into my database.
    – maen
    Commented Mar 25, 2016 at 9:16
  • do you see watchdog message that looks like this "IPN validated for Order ...." ?
    – oksana-c
    Commented Mar 25, 2016 at 10:37
  • Nope, I see the following: Customer returned from PayPal with the following POST data: Array ( [mc_gross] => 39.00 [invoice] => 13-1458898385 [protection_eligibility] => Ineligible [item_number1] => [payer_id] => Q4KY3TN9EHYAW [tax] => 0.00 [payment_date] => 02:34:05 Mar 25, 2016 PDT [option_selection1_1] => 1 [payment_status] => Completed [charset] => utf-8 [mc_shipping] => 0.00 [mc_handling] => 0.00 [first_name] => Michael ...
    – maen
    Commented Mar 25, 2016 at 11:32
  • it is not clear if you receive IPN from paypal. The data that you pasted is added to the log when the customer returns from paypal by clicking specific return url provided by paypal. Enable full IPN logging in PayPal WPS settings and see if you receive different log messages.
    – oksana-c
    Commented Mar 28, 2016 at 10:56
0

Looking at this problem today (paypal POST shows 'complete', but orders do not), I approached it like this:

  • Checking the orders' 'Revisions', it became clear that some (default) rule triggered and returned the order from 'checkout: complete' to 'pending'. Based on the event 'checkout complete'. I disabled that rule.
  • I use a new rule based on the event 'first paid in full' to 'complete' orders automatically. (plus do specific workflow reactions there)

The availability of payment methods to different users was, as well, dependent on rule conditions, per each specific payment method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.