PrestaShop hook for standard Refund - prestashop

what hooks should be used for standard refund in prestaShop?
i used hookActionOrderSlipAdd in partial refund and works good , but got stuck with standard refund

You can consider using actionOrderStatusPostUpdate hook and check if the order status is set to any on the one to be considered as refunded (usually PS_OS_CANCELED / PS_OS_REFUNDED in Configuration table).

Related

How to skip payment step in Prestashop 1.7

I'm using prestashop 1.7.6.8. In my process the client can take the item from the store or get it delivered and the payment will be when receiving the item.
Is there any way to remove payment method step or redirect it to the next step in tpl file?
You have the payment option "cash on delivery" to allow the customer to pay after receiving the order.
It's a native Prestashop payment module. You can install it as any other payment method.
If it's not what you are looking for, you can also override the OrderController class to add or remove a step, but in my opinion, the "payment method" way is much simpler.

PrestaShop iframe payment module

I'm developing a payment gateway module for prestashop 1.6.x - 1.7.x versions and this module is iFrame. I mean, when a customer chooses this payment method then he's redirected to an iframe page in prestashop (not redirected to another web page). But I must create an order before payment on this page. If I create the order after payment is done in order-confirmation page (to this page is automatically redirected to in 5 sec by iframe after the payment is done), it's maybe not the correct way for this method. Maybe the customer has left the iframe page in these 5 secs. So, the order is not created.
When I use the validateOrder function for creating an order, it is sending an email to the customer before payment is done. So, I did some changes in this function and it's working fine. But, if this page is refreshed then the order is created over and over again. Also, the validateOrder function is deleting the cart. I duplicate the cart because of this.
I hope everything is ok here. Here are my problems;
I don't want to show duplicated orders to the customer. Maybe these orders can be updated like id_customer = 0. But in this case, the customers can not be seen in the BO order table and I don't know if is it legal.
validateOrder function is not compatible with all of these versions. How can I use this for all versions without sending an email? Actually I want to use core function but I guess there is no way.
What is the best practice in this scenario? What is the way I have to follow?

Paypal custom reports Api

I need to get a custom report of the payments that we received in the last X (variable) days.
We use a PSP to handle our payments but they only store the amount of the original sales (not without the FEEAMT and currency conversion).
Important is that the report shows the amount that actually is ours, so:
after the FEEAMT
after currency conversion
PAYMENTSTATUS must be "complete"
I cant find any working examples, only code snippets on https://developer.paypal.com
You can use TransactionSearch to pull orders within a time range, and then use GetTransactionDetails to pull specifics about any particular transaction.
If you are using PHP then you can use the PHP SDK for PayPal to make those calls very simple for you.

Importing Historical Sales Data via API

I'm scouting for a business solution, I haven't tried bigcommerce yet but would want to confirm a few things first.
Is there a way to import historical sales data via API? Is there a direct way to do this?
Here are some of the available fields that I'd like to import:
Date
Product ordered
Sale price
Do you think it would work if I create a new product for this, assign the sale price to it, create an Order, assign the previously created product, and lastly mark the order complete? However, I wonder how this would affect my reports.
You can import all orders from BigCommerce using API.
Check Orders API Call.
Simple PHP cURL Snippet to get orders.

Prestashop - set different prices according to payment method?

I'm using Prestashop 1.5.6 and I'd need to set a different total price for an order depending on the chosen method, some modules work intermediating with credit cards (like Mercado Pago module) and I'd need to increase the price in that case, is this possible to do it with the functionality of the shop itself, is there a module , a workaround or something? The module of the payment method I need to increase the price doesn't allow to be configured in that sense.
This feature is not supported by PrestaShop up to 1.5.6. So far PrestaShop 1.6 will not support that either. You will need to search for a module for that.
This module claims to support that feature:
http://addons.prestashop.com/en/checkout-modules/3495-additional-payment-fees.html
but one client that uses it said it's not working properly and they had to tweak the core Moneybookers & PayPal modules to add fees feature. Also the developer did not respond very friendly when issues were reported, so it's up to you if you'll use it or will search for another.