Author Topic: Automatic refund to buyer from PayPal ?  (Read 4073 times)

Mister Paul

  • Jr. Member
  • **
  • Posts: 281
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Automatic refund to buyer from PayPal ?
« on: October 25, 2020, 05:19:44 am »
Hi,

For the first time I’ll have to make refunds. The payment method is PayPal.
And I am wondering if the refund is automatic. Or what is the good process to manage refund from PayPal.

I tried with sandbox and it seems that no refund was made…

What I did:
- In the Order backend  page, I modified the Order status of a previously Confirmed order (made with PayPal Sandbox):
I set the status to Refunded and selected the Notify shopper option.
- Yes the shopper was notified by email from Virtuemart
- But nothing was received from PayPal (no email, no confirmation) by the Shopper, nor by the Seller (for what I saw)

I suppose that my setings are OK on the PayPal configuration page: I have the Refunded status selected for the Refunded transactions and the Partial Refunded transactions (cf screenshot)

Please, could you help me on this?

Thanks for your patience!
;-)

Paul

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3510
  • VirtueMart Version: 3.8.9
Re: Automatic refund to buyer from PayPal ?
« Reply #1 on: October 25, 2020, 09:21:49 am »
From my understanding

If you set an order to refund status in VM it will generate a FULL refund of the PayPal transaction. 

There is no method for giving a partial refund using this method.

As a personal preference for a workflow I therefore generate all refunds using my PayPal Console.
Regards
A

Joomla 3.9.27
php 7.4

Mister Paul

  • Jr. Member
  • **
  • Posts: 281
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Re: Automatic refund to buyer from PayPal ?
« Reply #2 on: October 25, 2020, 10:52:18 am »
Thank you very much for your answer.

Just to fully understand your workflow:
• after the refund (full or partial) made from the PayPal Console, do you modify the Order status to get the historic in Virtuemart?
• in Virtuemart PayPal configuration, your setting should be different from mine to avoid the PayPal automatic refund, right?

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1542
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Automatic refund to buyer from PayPal ?
« Reply #3 on: October 25, 2020, 10:59:31 am »
Quote
And I am wondering if the refund is automatic.

I think no.
On our payment plugin, which is developed from the Paypal payment plugin, is not automatic too and we must create self.

But!

All of admins or the owners' shops don't want this function, after we are developing and we must add checkbox in setting - refund automatic (Yes/No), because as written AH - personal preferences is No.
Then my recommended is the same - you don't need this function.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Mister Paul

  • Jr. Member
  • **
  • Posts: 281
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Re: Automatic refund to buyer from PayPal ?
« Reply #4 on: October 25, 2020, 12:05:28 pm »
Thank you too !

So in Virtuemart PayPal configuration, your settings are different from mine to get a correct order status but to avoid the PayPal automatic refund, right?

pinochico

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1542
    • MiniJoomla
  • Skype Name: support-easysoftware
  • VirtueMart Version: 3
Re: Automatic refund to buyer from PayPal ?
« Reply #5 on: October 25, 2020, 12:09:50 pm »
No,
in the payment method settings we use your settings, but in the plugin settings we have a checkbox with which we can set whether an automatic refund will take place without the administrator's knowledge or not.

But as I said, it's a custom development and the plugin is customized like this from us. (Beware, this is not a Paypal plugin - we do not use it, but the Gopay payment method we use)
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

Mister Paul

  • Jr. Member
  • **
  • Posts: 281
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Re: Automatic refund to buyer from PayPal ?
« Reply #6 on: October 25, 2020, 13:25:39 pm »
OK...

So if I want to avoid the automatic refund from PayPal but get the good status in the Virtuemart Orders page, do I have to  the set the PayPal payment configuration like that:
Refunded transactions -> Confirmed
Partial Refunded transactions -> Confirmed

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3510
  • VirtueMart Version: 3.8.9
Re: Automatic refund to buyer from PayPal ?
« Reply #7 on: October 25, 2020, 20:42:49 pm »
I did develop the code for the core VM paypal plugin to prevent automatic refunds based on an order status update

Unfortunately it has never made it to the core:

I can try again


No dont set them to confirmed!!


If you want to hard code for now - to prevent vm initiating a refund  (you can test this code of course before moving to live)


in plugins paypal / paypal.php 

comment out the code in function plgVmOnUpdateOrderPayment where it tries to handle the refund status


Code: [Select]

//dont inititate a paypal refund based on VM order status
// elseif ($order->order_status == $this->_currentMethod->status_refunded /*OR $order->order_status == $this->_currentMethod->status_canceled*/) {
// $paypalInterface = $this->_loadPayPalInterface();
// $paypalInterface->setOrder($order);
// $paypalInterface->setTotal($order->order_total);
// $paypalInterface->loadCustomerData();
// if ($paypalInterface->RefundTransaction($payment)) {
// if ($this->_currentMethod->payment_type == '_xclick-subscriptions') {
// $paypalInterface->debugLog(vmText::_('VMPAYMENT_PAYPAL_SUBSCRIPTION_CANCELLED'), 'plgVmOnUpdateOrderPayment Refund', 'message', true);
// } else {
// //Mark the order as refunded
// // $order->order_status = $method->status_refunded;
// $paypalInterface->debugLog(vmText::_('VMPAYMENT_PAYPAL_API_TRANSACTION_REFUNDED'), 'plgVmOnUpdateOrderPayment Refund', 'message', true);
// }
// $this->_storePaypalInternalData( $paypalInterface->getResponse(false), $order->virtuemart_order_id, $payment->virtuemart_paymentmethod_id, $order->order_number);
// }
// }

return true;
}





Ask the team to do a very straightforward configuration inclusion

Config:

Refund PayPal transactions when the refund status is set in VM:

VMpaypalRefunds

Default = Yes
Option = Y/N
Regards
A

Joomla 3.9.27
php 7.4

Mister Paul

  • Jr. Member
  • **
  • Posts: 281
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Re: Automatic refund to buyer from PayPal ?
« Reply #8 on: December 02, 2020, 17:58:47 pm »
Oh YES, because for now all automatic refunds are full refunds,
I ask the team to do your very straightforward configuration inclusion to prevent automatic refunds based on an order status update.

Where is the wishlist?

EDIT:
no way to affect only "Partial refunded transactions"?

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3510
  • VirtueMart Version: 3.8.9
Re: Automatic refund to buyer from PayPal ?
« Reply #9 on: December 02, 2020, 18:48:14 pm »
In the latest version there is now a config to stop VM requesting a  PayPal refund
Regards
A

Joomla 3.9.27
php 7.4

Mister Paul

  • Jr. Member
  • **
  • Posts: 281
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Re: Automatic refund to buyer from PayPal ?
« Reply #10 on: December 02, 2020, 18:59:30 pm »
Good news AH !
 :)

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3510
  • VirtueMart Version: 3.8.9
Re: Automatic refund to buyer from PayPal ?
« Reply #11 on: December 03, 2020, 09:29:34 am »
Yes - it gives shop owners a choice on how they want VM to act on setting the refund status

I have always issued refunds via the PayPal website and let an PayPal IPN message set the VM order status
Regards
A

Joomla 3.9.27
php 7.4

Mister Paul

  • Jr. Member
  • **
  • Posts: 281
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Re: Automatic refund to buyer from PayPal ?
« Reply #12 on: December 03, 2020, 10:16:34 am »
Quote
and let an PayPal IPN message set the VM order status
You use the "Notes and special requests" field for that?

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3510
  • VirtueMart Version: 3.8.9
Re: Automatic refund to buyer from PayPal ?
« Reply #13 on: December 03, 2020, 12:12:54 pm »
Are you sure you have posted in the correct thread

I was referring to setting a refund using PAYPAL's systems and a subsequent IPN message changing the order status

Notes is irrelevant and is not part of IPN handling
Regards
A

Joomla 3.9.27
php 7.4

Mister Paul

  • Jr. Member
  • **
  • Posts: 281
  • Joomla! 3.9.6 - VirtueMart 3.4.2
Re: Automatic refund to buyer from PayPal ?
« Reply #14 on: December 03, 2020, 13:21:39 pm »
Well... so I don't fully undertsand the second part of your phrase:
Quote
I have always issued refunds via the PayPal website and let an PayPal IPN message set the VM order status
I thought that you were pasting the PayPal references (given by PayPal's system console after refund) somewhere in the relevant VM order to keep historic updated...
Am I wrong?