Page 1 of 1

Emulating Authorize.net AIM (NMI Gateway)

PostPosted: December 13th, 2011, 6:12 pm
by jesseAe
I'm trying to integrate a gateway that's not supported by s2member called NMI. HOWEVER, this gateway's API actually emulates auth.net's AIM. But since I'm not using an actual auth.net account the auth.net form generator isn't going to work for me. Before trying to alter the s2member behavior with hooks and filters I just wanted to post here to see if someone could point me to an easy solution that I'm overlooking.



Thanks in advance.

Re: Emulating Authorize.net AIM (NMI Gateway)

PostPosted: December 14th, 2011, 2:30 pm
by jesseAe
I'll just keep this thread going to try and document another approach to integrating an unsupported Gateway. So I'm going to start from the beginning for my own sake. From this post it seems the cleanest way to manipulate s2member is through the Paypal IPN w/ Proxy Key methodology.

The Gateway I'm using (NMI) has support for recurring billing. So, the main problem is keeping s2member in sync with the Gateway as far as membership status goes. Here's a use case:

A visitor wants to buy a membership so she goes to a payment form and fills out her details. When the form is submitted the visitor is taken to a payment processing page, which does two things:

1. It sends the visitor's payment details to the Gateway, and an attempt is made to process the payment. A successful attempt sends a positive response back to the processing page.
2. The processing page THEN posts the visitor's details to s2Member's IPN handler in a Paypal response format allowing s2member to process the signup.

After that the visitor is taken to a payment confirmation page.

I'm hoping s2member keeps track of a subscription's payment schedule independently as this Gateway does NOT send out event-based messsages like auth.net and Paypal. Looking at the wp_users and wp_usermeta databases I only see two fields specific to s2member, and neither have to do with scheduling or expiration. At this point I'm wondering what s2member does internally when it creates a new member, but pawing through the class files is a little overwhelming.

If something about this seems completely bonkers please let me know. I'll try and update this thread with my results.

Re: Emulating Authorize.net AIM (NMI Gateway)

PostPosted: December 14th, 2011, 4:32 pm
by jesseAe
It's occurred to me that it'd be a lot easier to just use the wp_create_user() wordpress function to create a new user whenever I process a subscription payment INSTEAD OF the Paypal IPN w/ Proxy Key methodology. Would this work? It looks like that's what's being used in the c_ws_plugin__s2member_pro_remote_ops_in::create_user method, so I assume s2member will take care of the rest? If someone can confirm this I'd really appreciate it.

Re: Emulating Authorize.net AIM (NMI Gateway)

PostPosted: December 16th, 2011, 10:44 pm
by jesseAe
Since this is more broadly about unsupported gateways and the proxy IPN handler I'm moving over to this thread: http://www.primothemes.com/forums/viewtopic.php?f=36&t=3154