Paypal Website Payments Standard - Status (refund)

Project:Ubercart Contributions
Component:Code
Category:
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

Hello,

When someone pays with paypal wps and finish his/her payment, the Transaction ID is return to ubercart and the status of the order is updated to Payment Received, balance is 0.00€. This is ok.
When you do a refund of the order, the transaction id comes in from the paypal website and the balance is changed to the total order price, this is ok.
Problem : the status isn't changed back to :
or pending
or payment refunded
or simular

Is this a code issue or is this a configuration setting in workflow?

TIA,
Fossie

Version: 
Ubercart 1.6
fossie@drupal.org's picture
Offline
Joined: 11/20/2007
Juice: 48
Current workaround: Add a

Current workaround:

Add a new Workflow-ng action:
Get a payment entered
check if order balance > 0.00€
action: set order status to pending.

Maybe a question, will this fail on other items get the payment received status?

Maybe this can be included in the uc_payment module workflow-ng configuration.

HTH,
Fossie

fossie@drupal.org's picture
Offline
Joined: 11/20/2007
Juice: 48
Re: Current workaround: Add a

Maybe this code can be added to uc_payment_workflow.inc: (should I post it here or on the drupal issue tracking queue.

<?php
 
// Set the order status to "Pending" when a payment is paid or refunded
  // and the balance is greater than 0.
 
$configurations['uc_payment_refund'] = array(
   
'#type' => 'configuration',
   
'#label' => t('Update order status on refund'),
   
'#event' => 'payment_entered',
   
'#module' => 'uc_payment',
   
'#active' => TRUE,
  );
 
$configurations['uc_payment_refund'][] = array(
   
'#type' => 'condition',
   
'#name' => 'uc_payment_condition_balance',
   
'#argument map' => array(
     
'order' => 'order',
    ),
   
'#settings' => array(
     
'balance_comparison' => 'greater',
    ),
  );
 
$configurations['uc_payment_refund'][] = array(
   
'#type' => 'action',
   
'#name' => 'uc_order_action_update_status',
   
'#argument map' => array(
     
'order' => 'order',
    ),
   
'#settings' => array(
     
'order_status' => 'pending',
    ),
  );
?>

HTH,
Fossie

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Current workaround: Add a
Assigned to:fossie@drupal.org» Ryan

Thanks for posting your process up for us. One thing you can do is also add a condition to check the current order status. In other words, only allow this action if the status is already payment received or complete. I'll bookmark this for review later, but we're really trying to limit new features on D5 atm.

fossie@drupal.org's picture
Offline
Joined: 11/20/2007
Juice: 48
Re: Re: Re: Current workaround: Add a
Assigned to:Ryan» fossie@drupal.org

Thx, I added that condition to our shop.