Download & Extend

Altering submit_data before senting to authorize.net

Project:Ubercart
Version:7.x-3.x-dev
Component:Payment
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

I am facing a problem in one of my project. I needed a custom description in every customer receipt email that is sent form the authorize.net. I looked into the uc_athorizet module for an alter before sending this information to authorize.net.

I hoping to see a drupal_alter before sending all the payment information to authorize.net so that I can easily alter the description before it is sent to authorize.net

Wouldn't it be good to have a drupal_alter('uc_authorizenet_transaction', $submit_data); before the curl function that posts $submit_data to authorize.net.

Thanks,
Unnikrishnan B.

Comments

#1

This is probably a good idea, if you post this change as a patch it is much more likely to be reviewed and included in Ubercart.

#2

Version:7.x-3.2» 7.x-3.x-dev
Status:active» needs review

Here is the patch to add drupal_alter on $submit_data before posting the data to authorize.net.

Thanks.

AttachmentSizeStatusTest resultOperations
uc_authorizenet-transaction-alter-1840764-2.patch751 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 2,684 pass(es).View details

#3

Thanks for the patch. Can you give a code example of something in the data array you would change with this hook? We can then use that example as hook documentation in a uc_authorizenet.api.php file.

#4

Our use case is that we needed a custom description to send to authorize.net. Authorize.net uses the description in the email that goes out to the customers. If I could alter the description field, I could add more details of the product purchased.

Thanks,
Unnikrishnan B.

#5

So your code is something like this?

<?php
function MODULE_uc_authorizenet_transaction_alter(&$data) {
 
$data['x_description'] = 'Custom Authorize.Net transaction description.';
}
?>

#6

Status:needs review» fixed

Committed, thanks for the patch!

http://drupalcode.org/project/ubercart.git/commitdiff/8005cb3

#7

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.