Hi maybe I don't understand how it should work but:
When client buys sth it takes his points and when admin decides to cancell that order or to delete it, the points (which were taken from the client) should be given back.

But unfortunatelly it doesn't work like that because in uc_userpoints_payment_refund($order) it checks the current user id [in that example its Admin so its 1] and searches for his payments connected with that order.
Finally when youre deleting the order, client's userpoints are never given back.

Comments

attheshow’s picture

Version: 6.x-2.x-dev » 6.x-2.0-beta2
Category: support » bug

If you go into the uc_userpoints_payment.module and change:

function uc_userpoints_payment_refund($order) {
  global $user;
  $curUserId	= $user->uid;

To:

function uc_userpoints_payment_refund($order) {
  $curUserId	= $order->uid;

It works correctly.

attheshow’s picture

Also need to change:
$points = intval((($pointinfo->points) * (-1)));

To:
$points = $pointinfo->points;

...So that the points are given back to the user instead of subtracted A SECOND TIME. :)

sano’s picture

thank you.