NMI Gateway - Self Hosted

Good Day,

I ready that the NMI (www.nmi.com) gateway is supported by the self hosted Ninja Invoice system, but I am not seeing that option.

In addition, they have an Authorize.net emulation mode which we have used extensively and works well, but It is not working either (after changing URLs etc.).

Is there a way to get NMI working?

-Mike

Can you point me to the page you’re referring to, NMI isn’t supported with the app.

I know other gateways work with the Authorize.net platform, are you seeing a specific error?

Thanks for the quick response, I can’t remember where I saw what I thought was definite confirmation of NMI support, but there is this one:

https://www.invoiceninja.com/partners/nmi-gateway/

NMI.com emulation information is available here:

https://secure.networkmerchants.com/gw/merchants/resources/integration/integration_portal.php#carts_authnet

We have used the emulator many times without issue, error we are getting when trying to pay is:

Authorizenet_aim: Invalid response from payment gateway

Thanks,
Mike

Are you using the “XML Emulator” link from the page.

I have tried both. When I use the XML Emulator (is that the correct one that we should use, you are using the newest Auth.net API?) I am getting a credit card expiry date error.

-Mike

Yes, I believe the app expects to use the XML version.

Ok, will try again, but pretty sure its setup correctly.

Do you offer or know of entities that offer paid support to get this setup correctly?

Thanks,
Mike

https://boldcompass.com/customize-invoice-ninja/

OK, have contacted them, if they are willing, maybe they could NMI and it could be included in the list of available gateway options.

And we have put all the settings in the gateway again and are getting the same error below:

Authorizenet_aim: Credit card expiration date is invalid.

Thanks,
Mike

Sorry, the gateway isn’t supported.

I highly recommend Bold Compass, they do great work!

Thanks, we are in contact with them.

We have worked with BoldCompass and this is the issue:

I set up my local environment to point to NMI, and I think I found the issue. The Omnipay library Invoice Ninja uses is submitting the expiration date to the API in the MMYY format. See code here: https://github.com/thephpleague/omnipay-authorizenet/blob/58948ff930d665e1b43a78618d85cc7cb8dafa3e/src/Message/AIMAuthorizeRequest.php#L99

While this was supported by the older transact.dll API, the new API calls for it to be formatted as YYYY-MM. I’m guessing that when Authorize.net implemented their new API, they carried over support for all of the old formats but just made their documentation list YYYY-MM supported. NMI, on the other hand probably just implemented their API to support what the Authorize.net documentation lists, rather than what the API actually supports, which makes sense.

I changed my local code to use the YYYY-MM format, and the transaction went through successfully. The code I had to change is part of the Omnipay library, so fixing this would require getting the change approved into the Omnipay library and then getting Invoice Ninja to update to the latest version.

Glad to hear it’s working, thanks for sharing what the problem was!

Hi, not sure if you read the whole thing. It was made to work by “hacking” the code. If/when the system is updated this “fix” would stop working. As per my last, there is an error in the Omnipay library that needs to be fixed. In Invoice Ninja able to advise Omnipay of same.

This information was tested and advised by Bold Compass, who you advised we should contact.

Thanks,
Mike

NMI isn’t a supported gateway, if you update the app you would need to re-add it.

If a PR is merged into the Omnipay library we could look into adding the gateway.

Hillel, thanks for the recommendation. I checked into this, and the reason the Authorize.net emulation isn’t working with NMI is that there’s a minor issue in the Omnipay Authorize.net library. On line 99 of AIMAuthorizeRequest.php the library is using the format MMYY to submit the expiration date, while the Authorize.net API documentation shows that it should be formatted as YYYY-MM.

It seems that the Authorize.net API has an undocumented “feature” that supports more formats than are documented, but the NMI API doesn’t. I’d consider this a bug in the Omnipay library, so I plan to submit a PR to omnipay-authorizenet to fix it. Do you know of any reason they’d be using the incorrect MMYY format, and once the Omnipay library is up to date, would you have any reason to not update to the latest version of the library?

Thanks!

Further to this, we are seeing that Network Merchants (NMI.com) is actually already supported within the Omnipay framework, as per this page:

https://github.com/thephpleague/omnipay

As such, is it possible to add as a supported gateway in Invoice Ninja?

Thanks,
Mike

Do you know of any reason they’d be using the incorrect MMYY format, and once the Omnipay library is up to date,

Sorry, I don’t

would you have any reason to not update to the latest version of the library?

We typically only update libraries to fix problems for supported gateways

As such, is it possible to add as a supported gateway in Invoice Ninja?

We aren’t currently adding more gateways to the app but it should be possible to add a gateway in a self host install: https://invoice-ninja.readthedocs.io/en/latest/configure.html#omnipay