Jump to content

Refund hooks?


fbas

Recommended Posts

I've had to write a payment module to support our organization's payment API. the one piece I have left is refunds.

 

Does anyone have code or documentation or tips on hooking into the refund functionality?

 

thanks

 

fbas

Link to comment
Share on other sites

  • 2 weeks later...

The problem now is that returning FALSE in cancelProduct does not halt the refund process. Prestashop still marks the product refunded. This is obviously NOT acceptable!!

 

Can anyone give me a pointer or resource to resolve this?

 

 

 

Server information

Prestashop Version: 1.4.3 (upgraded to 1.4.4 - don't know why the upgrade doesn't patch the version number)

Server information: Windows NT build 7601 ((null) Service Pack 1) i586

Server software Version: Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

PHP Version: 5.3.1

MySQL Version: 5.1.41

Link to comment
Share on other sites

The docs correctly state that this hook is for after the item is deleted from an order. Any ideas about another hook I could use?

 

"Called when an item is deleted from an order, right after the deletion."

Link to comment
Share on other sites

I have been reading the Paypal module (that's how I found the cancelProduct hook) and they don't respond to any error in the refund process at all - they just echo out the response values from the PayPal api calls.

 

The paypal module also severely lacks documentation. Not being familiar with the paypal process, it can be hard to understand why the code does what it does.

 

Also, because the cancelProduct hook is called for every line item that has an item being cancelled/refunded, a refund call is made separately for each one. This seems like it could be pretty confusing for the customer to get several refunds rather than one amount.

Link to comment
Share on other sites

  • 3 weeks later...

update: I avoided this approach (using cancelProduct hook) and wrote a new admin tab (based on AdminOrder) in a module with a custom refund hook to let store staff specify a refund price. they have to calculate this themselves.

 

kind of disappointing that prestashop has such poor and neglected support for refunds.

 

as I finish up their shipping scheme, I would like to make a more automatic process that uses the cancelProduct hook to as well as my custom refund hook. my approach will be to use cancelProduct to add line items to a table (indicating they are intended to be refunded, all indexed by the current timestamp), then the refund hook will tally up the refund rows with that index (timestamp), calculate shipping refund and add to that table, issue a refund with my payment processor, then mark those rows as refunded.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...