3

I'm testing out drupal commance and setup a paypal sandbox seller/buyer account. When I complete a payment with the test accounts, the status of the order says "PENDING" is this what its suppose to do after a successful payment?

I would imagine it would say PAID. I see there are other order status options such as checkout complete. Shouldn't it say that instead of Pending?

5

I believe these are exports of the rules that Ryan proposed. The weight is 1 to evaluate after existing rules.

Rule #1

{ "rules_update_the_order_status_on_checkout_completion_if_payment_" : {
    "LABEL" : "Update the order status on checkout completion (if payment complete)",
    "PLUGIN" : "reaction rule",
    "WEIGHT" : "1",
    "TAGS" : [ "Commerce Checkout" ],
    "REQUIRES" : [ "commerce_payment", "commerce_order", "commerce_checkout" ],
    "ON" : [ "commerce_checkout_complete" ],
    "IF" : [
      { "commerce_payment_order_balance_comparison" : { "commerce_order" : [ "commerce_order" ], "value" : "0" } }
    ],
    "DO" : [
      { "commerce_order_update_status" : { "commerce_order" : [ "commerce_order" ], "order_status" : "processing" } }
    ]
  }
}

Rule #2

{ "rules_order_paid_in_full_order_state_to_processing" : {
    "LABEL" : "Order paid in full: Order state to processing",
    "PLUGIN" : "reaction rule",
    "WEIGHT" : "1",
    "REQUIRES" : [ "commerce_cart", "commerce_order", "commerce_payment" ],
    "ON" : [ "commerce_payment_order_paid_in_full" ],
    "IF" : [
      { "NOT commerce_order_is_cart" : { "commerce_order" : [ "commerce_order" ] } }
    ],
    "DO" : [
      { "commerce_order_update_status" : { "commerce_order" : [ "commerce_order" ], "order_status" : "processing" } }
    ]
  }
}
7

Orders aren't being "stuck" here so much as placed here for you to determine what to do with them. When you build a Drupal Commerce site, you should consider what needs to happen to an order after the checkout process has been completed / payment has been received and either implement a manual process or some form of Rules or code based automation to do it. Drupal Commerce leaves it here because we don't make any assumptions about the type of product a Commerce site sells or the business processes involved in taking an order from checkout completion to final fulfillment.

PayPal WPS and related payment gateways are a bit of a special case, too, in that you actually cannot use the "When an order is first paid in full" event to manipulate the order status. Because these orders may not have completed the checkout process when their payment notifications arrive at the site, the checkout router still depends on these orders being in a checkout order status to complete the checkout process after the payment has been processed.

Instead, if you need to update the order status based on payment receipt for PayPal WPS, you should use the "Order balance comparison" condition in conjunction with the "Completing the checkout process" event to update the order status on that event instead if payment has been received. Additionally you can use a "Data comparison" condition to check the order status on the "When an order is first paid in full" event and update the order status if the order is not still in a checkout order status.

1

Actually this is normal for Drupal Commerce out of the box. When an order is fully paid, say with Paypal. The user get's redirected back to the /checkout/#/complete (# is for order #)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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