0

I need to have a reference number (rn) or purchase order (po) as an optional field during the credit card part of the checkout. I am using Authorize.net for credit cards and there isn't an out-of-the-box solution to include an rn or po with the information.

For those that aren't familiar with rn or po, it's an internal number that the customer provides for purchasing reasons (most commonly if the customer is a business). They'll see the rn or po on all the invoices, transactions, packing slips and receipts.

There is little to no information on integrating purchase order numbers or reference numbers with Authorize.net and It's something we need on our checkout to ensure customers are able to track their purchases internally.

  • why not user the incremental order number? – paj Sep 23 '15 at 15:03
  • A lot of our customers are government, military, schools, etc that need to enter their own po or rn numbers. – NotJay Sep 23 '15 at 15:04
2

Take a look at https://developer.authorize.net/api/reference/ you could implement refId or poNumber.

poNumber - The merchant-assigned purchase order number. Purchase order number must be created dynamically on the merchant's server or provided on a per-transaction basis. The payment gateway does not perform this function.

refId - Merchant-assigned reference ID for the request. If included in the request, this value will be included in the response. This feature might be especially useful for multi-threaded applications.

Then you will need to add this field to your one page checkout

and rewrite /app/code/core/Mage/Paygate/Model/Authorizenet.php

/**
 * Prepare request to gateway
 *
 * @link http://www.authorize.net/support/AIM_guide.pdf
 * @param Mage_Payment_Model_Info $payment
 * @return Mage_Paygate_Model_Authorizenet_Request
 */
protected function _buildRequest(Varien_Object $payment)
{
    $order = $payment->getOrder();

    $this->setStore($order->getStoreId());

    $request = $this->_getRequest()
        ->setXType($payment->getAnetTransType())
        ->setXMethod(self::REQUEST_METHOD_CC);

    if ($order && $order->getIncrementId()) {
        $request->setXInvoiceNum($order->getIncrementId());
    }

   ....

   //add field
   ....
  • Great, I will look into this and give it a try. Thank you for the information. – NotJay Sep 23 '15 at 15:36
  • 1
    Should I copy the file to local rather than core? – NotJay Sep 23 '15 at 15:36
  • My personal preference is to create a module – Renon Stewart Sep 23 '15 at 16:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.