Hi guys,
I have a few questions about how to make the Authorize.net plugin work properly for my purposes.
QUESTION 1
I found out that I could add items to the Curl Request that goes to Authorize.net as follows:
In authrorize.php in function _loadStandardVars(&$order) I added the following line:
$vars["x_description"]='My description text';
That sends my description text through to Authorize.net and displays it on the customer receipt that Authorize.net sends out as well.
I need to know how I load variables into a payment plugin from custom fields, so that I can get data from the product, cart, etc. and use them in the payment plugin. I have custom fields in both the Order and the Item tables.
QUESTION 2
In
function onBeforeOrderCreate(&$order,&$do) the CURL request is built and sent and the response is parsed.
I saw that the only the following information was being parsed from the data that Authorize.net sends back:
$response_subcode = @$response_array[1];
$response_reason_code = @$response_array[2];
$response_reason_text = @$response_array[3];
Since there is other data in the Authorize.net response that I want to preserve I added the following lines:
$response_auth_code = @$response_array[4]; // Authorization Code
$response_trans_id = @$response_array[8]; // Transaction ID
$response_account = @$response_array[52]; // Account Number (Last 4 digits of card)
$response_card_type = @$response_array[53]; // Card Type
I also added corresponding custom fields in the Order table (_hikashop_order in the DB) and I need to know how to populate those fields with the data I get back from Authorize.net.
I want to be able to view the data under Orders in the admin and I want the customer to be able to view some of that information on their email receipt and on the order view.
In your sample code I have seen the following in the
onPaymentNotification(&$statuses) function:
$this->modifyOrder($order_id, $this->payment_params->verified_status, true, true);
Is there some variation of that that I can use to get the custom fields and Authorize.net response data into the orders table in the DB?
I have also thought about just using a MySQL query to push the information from the Authorize.net response into the DB, but I'd rather use the functions that are already built into the extension if possible.
QUESTION 3
In order to generate an activation key that users will be purchasing through HikaShop I need to do the following:
1) Run a MySQL query on one of my other Joomla tables
2) Use the results from that to query a remote script
3) Take the response from the remote script and load it into the
_hikashop_order table, attached to an item.
4) Display the Activation Key that the remote script generated on the Thank You page.
I purchased HikaSerial and tried unsuccessfully to create a HikaSerial plugin to perform this function. Nothing I tried would make my pack generator appear or work properly, so I have abandoned that for now.
I have viewed the information in the docs on writing a custom plugin, but the documentation doesn't really have enough information about how to get data into and out of a plugin from the main extension, from controllers or from other plugins. It would be really helpful if the documentation was a little clearer about this for those of us that need to make modifications. I also searched the forum, but there is vary little in here about this topic also.
I know you guys are great programmers and this is a great extension. I'm hoping you'll be able to assist me in finding the information I need. I will gladly update this post with the solution when I get it working.
Thanks in advance for your help.