Introduction

Xero still don't support Authorize.net integration but I've created a workaround that allows me to include an Authorize.net payment link within my Xero invoices.

The solution lies in this easy-to-overlook setting in General > Settings > Invoice Settings > Payment Services > Add Payment Service

DISCLAIMER: I'm not in any way a programmer. I literally cannot code a single line of HTML so I'm hoping somebody with a better understanding of coding or Authorize.net's API integration can improve on my methods. Use at your own risk.

I'm happy to help everybody out with this and hope that by sharing my solution people will be able to contact me and improve on it.

Introduction

You'll Need ..

  • An Authorize.net merchant account (obviously)
  • Your own website with an SSL certificate
  • A merchat gateway script (detailed next) which you host on your own website.
  • cURL must be active on your hosting account (I have no idea what this means but fortunately i must already have this)

#1 Install your own payment gateway script on your server

I didn't really shop around but I recommend this:
http://codecanyon.net/item/authorizenet-payment-terminal/234122

It costs $16 and also provides the option to bill through PayPal if you want. The script is clearly coded, has active support and in theory it should be very easy for a proper programmer to tweak it to your specific needs.

Again I'm no programmer but by googling the information I need I've made some improvements which I'll detail below.

The script is very straightforward to setup, you merely add your details to config.php and upload all files into a folder on your website.

 

 

#1  Install your own payment gateway script on your server

#2 Tweaking the script

We already (Should) have all the pertinant details of our customer so I chose to modify the default payment page (index.php) to streamline it

I duplicated the file, named it xero_billing.php and made these modifications ....

1) I deleted all the code from line 86 to 425 starting and ending with <!-- BILLING BLOCK --> . This removes all the non-essential fields

2) To make the gateway as foolproof as possible I want to show customers the invoice number and total cost but I don't want to give them the opportunity to edit these details. We'll be pre-populating the description and total price fields so I've added 'readonly' to the code where these fields are displayed. These are on line 76 and 79 in my code.

<input name="item_description" readonly id="item_description" type="text" class="long-field" value="<?php echo $item_description;?>" onkeyup="checkFieldBack(this);" />
<input name="item_description" readonly id="item_description" type="text" class="long-field" value="<?php echo $item_description;?>" onkeyup="checkFieldBack(this);" />

 

#3 Using the script

In Xero to General > Settings > Invoice Settings > Payment Services > Add Payment Service

Name: Authorize.net (Customers don't get to see this anyway)
Your Custom URL: http://yoursite.com/pay/xero_billing.php?amount=[AMOUNTDUE]&item_description=[INVOICENUMBER]

After you do this, you should go to: General Settings > Invoice Settings and set the Payment Meithd to 'Authorize.net'

#3  Using the script

#4 Here's What Happens

#1 If you email customers with a PDF attachment there is a simple 'Pay onlnie now' link
#2 There's no reference to the actual payment method when you enter the Xero payment page but there's the clear green 'pay now' link at the top
#3 When clicked the customer is directed to a simple payment page where they are asked to enter their credit card details. The Description (Invoice #) and total amount are pre-populated and cannt be edited.

Suggested Improvements

I don't have a clue about the many APIs that Authorize.net offer but I am sure that there must be a way of sending customers directly to an authorize.net hosted payment page. The main disadvantage of that would be that it'd be hard / impossible to customize therefore using the self-hosted script is probably a better idea.

I'll probably get a programmer to customize the design of the payment page so that it looks the same as the xero payment page (i/e/ same background image, fonts etc.) This will make the transaction look a little more streamlined.

I could easily add PayPal processing into the payment page too but I'd much prefer customers to pay with authorize.net

I'll certainly be adding the authorize.net trust logo and my company logo to the payment page.

There is no way to pre-populate the customers address into the payment gateway so I've chosen to remove that data instead of ask customers to enter it again. This means that Authorize.net can't perform any checks on whether the card billing address and the delivery address are the same. For my clients this isn't really an issue but if it's important you could perhaps choose to ask the customers to enter the 1st line of their credit card billing address into the gateway.

Contact Me

http://truepot.com/contact-us/

Remember I'm not a programmer so if you have technical questions I probably won't be able to help you.