I want to "authorize-only" instead of "authorize+capture" only for WHOLESALERS. Where as for other customers it should be "authorize+capture". How to do this?
My payment gateway is Authorize.net.
Thanks,
Aditya
Printable View
I want to "authorize-only" instead of "authorize+capture" only for WHOLESALERS. Where as for other customers it should be "authorize+capture". How to do this?
My payment gateway is Authorize.net.
Thanks,
Aditya
You'll need to customize the code in your payment module to have it determine whether the customer is a wholesaler or not, and have it take appropriate action accordingly.
Being mindful that "wholesale" is not a built-in feature in the Zen Cart code, so whatever you're doing is in conjunction with other addons, and any solution you devise is custom to your specific setup.
Hello,
Thanks for your response. Could you please tell me in which page I need to customize the code?
Also, Authorize.net people said that "what it needs to be done is a way for the wholesale customers transactions be "authorize only"and from them I can just complete the transaction on their website". Is this correct?
Finally, I have figured it out.
Here goes the solution....
File Name: /includes/modules/payment/authorizenet_aim.php
In this file search for "$submit_data". This Populate an array that contains all of the data to be sent to Authorize.net.
In this array, find and comment the below line.
// 'x_type' => MODULE_PAYMENT_AUTHORIZENET_AIM_AUTHORIZATION_TYPE == 'Authorize' ? 'AUTH_ONLY': 'AUTH_CAPTURE',
and finally, add the below code after the array ends and above the line that shows "unset($response);". Line #300 around...
Code:
// Authorisation based on customer
if($_SESSION['customer_whole'] == '0'){
$submit_data['x_type']='AUTH_CAPTURE';
}else{
$submit_data['x_type']='AUTH_ONLY';
}
That's it...
Thanks,
Aditya