Forums / Addon Payment Modules / How do I make "authorize-only" in payments for wholesalers?

How do I make "authorize-only" in payments for wholesalers?

Started by aditya369 on 17 Apr 2012, 7:40 AM · Views: 1,600

Results 1 to 5 of 5
17 Apr 2012, 7:40 AM
#1
aditya369 avatar

aditya369

New Zenner

Join Date:
Oct 2011
Posts:
36
Plugin Contributions:
0

How do I make "authorize-only" in payments for wholesalers?

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

17 Apr 2012, 8:44 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: How do I make "authorize-only" in payments for wholesalers?

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.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

17 Apr 2012, 1:24 PM
#3
aditya369 avatar

aditya369

New Zenner

Join Date:
Oct 2011
Posts:
36
Plugin Contributions:
0

Re: How do I make "authorize-only" in payments for wholesalers?

DrByte:

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.

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?

17 Apr 2012, 7:08 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: How do I make "authorize-only" in payments for wholesalers?

aditya369:

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?
Yes that is correct.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

8 May 2012, 6:57 AM
#5
aditya369 avatar

aditya369

New Zenner

Join Date:
Oct 2011
Posts:
36
Plugin Contributions:
0

Re: How do I make "authorize-only" in payments for wholesalers?

aditya369:

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

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