Skip to content

Migrate to XML API for AIM + CIM support #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 82 commits into from
Apr 30, 2016
Merged

Conversation

anush
Copy link
Contributor

@anush anush commented Mar 18, 2016

PR Highlights:

  • Migrates the AIM gateway to use the new and improved XML API. As part of this change, the SIM classes have been completely decoupled from the AIM classes; they used to share some functionality earlier, but that's no longer possible since the endpoints and data format are now very different.
  • Added integration tests that actually hit AuthorizeNet. These make me feel a LOT safer when rolling out big changes like this one. Note that these tests only kick in if the following environment variables are set: AUTHORIZE_NET_API_LOGIN_ID, AUTHORIZE_NET_TRANSACTION_KEY.
  • Introduces support for a new CIM gateway (Customer Information Manager) which supports creating cards and customer profiles. Ideally, this should have been a separate PR, but Using the XML API for AIM gateway #6 (the original PR for migrating to the XML API) got quite stale over time and too much CIM work had been done to backtrack now and split it up.

Note: This PR replaces #6.

anush and others added 30 commits August 2, 2014 11:44
… attribute requires the presence of itemId, name, quantity, unitPrice which is not properly documented in AuthorizeNet's API documentation.
… valid CC info. AuthorizetNet only requires last 4 digits of the credit card for refund transactions
Fix refunds for authorize.net
…yment profile for a give customer profile. If that call also results in duplicate, then get the customer profile containing all its payment profiles. Then get the payment profile id matching the last4 in our original request. Once this is done, use the customer profile id, payment profile id, and update the card details. (It is possible that last4 matches but the expiry dates change). After updation of the payment profile, return the response.
…erence will contain customer profile id and customer payment profile id, as these are enough for making a transaction
@delatbabel
Copy link
Contributor

Looks good to me. Can someone who actually has gateway keys verify that this actually works in the real world? The PR that this replaces has been tossed around for a while so I think it's time we considered merging this.

@judgej
Copy link
Member

judgej commented Mar 21, 2016

Was hoping to look at this sooner, but got dragged into other things this weekend. I can look at this from the DPM view first, then work backwards into SIM, AIM and CIM. I've got codes for this, but generally am only using DPM in production for its easier PCI conformance. This week, definitely.

@anush
Copy link
Contributor Author

anush commented Mar 28, 2016

Just an FYI, we deployed this to production last Tuesday. So far so good with AIM & CIM.

@judgej
Copy link
Member

judgej commented Mar 28, 2016

Thanks.

@judgej
Copy link
Member

judgej commented Mar 28, 2016

Am I looking at the right branch? The SIM gateway still seems to extend the AIM gateway. I used this to get the branch to test:

git clone https://github.com/anushr/authorizenet.git xml-api

When submitting a DPM form, this is giving me the following error at https://apitest.authorize.net/xml/v1/request.api

{
    "messages": 
{
    "resultCode": "Error",
    "message": 
[
            {
                "code": "E00001",
                "text": "Unexpected character encountered while parsing value: x. Path '', line 0, position 0."
            }
        ]
    }
}

I'm not sure if this is in response to the callback - I'll check.

@judgej
Copy link
Member

judgej commented Mar 29, 2016

Ah, got it. You changed the AIM endpoints to XML endpoints, but those URLs now filter down to SIM and DPM, for which they don't work as those methods don't use XML. SIM may, but DPM just uses a direct POST so no XML is involved.

If you could modify Omnipay\AuthorizeNet\SIMGateway::getDefaultParameters() to set the original endpoints for the default, then we can give it another go. This works for me, as a quick hack, but it's probably best done from your end than me trying to merge it into your PR to avoid branch hell:

    public function getDefaultParameters()
    {
        $parameters = parent::getDefaultParameters();
        $parameters['hashSecret'] = '';
        $parameters['liveEndpoint'] = 'https://secure2.authorize.net/gateway/transact.dll';
        $parameters['developerEndpoint'] = 'https://test.authorize.net/gateway/transact.dll';

        return $parameters;
    }

Maybe stick a comment in there too, and a test to check the default endpoints for each gateway (AIM/CIM/DPM), but that's not essential for merging.

Thanks :-)

@anush
Copy link
Contributor Author

anush commented Apr 2, 2016

@judgej I've fixed the endpoints for SIM & DPM

@judgej
Copy link
Member

judgej commented Apr 3, 2016

Thanks - that's DPM working for me again. Will try SIM next.

@judgej
Copy link
Member

judgej commented Apr 17, 2016

Finally got around to testing SIM with my test account. All works without a hitch.

How's your production instance going? Any changes needed, or is it just ticking along taking payments? I'll merge if there are no further changes or surprises you've found in production.

@anush
Copy link
Contributor Author

anush commented Apr 17, 2016

Awesome!

AIM & CIM have been working smoothly in production. No issues whatsoever. Pleasantly surprised :)

@aditya-cherukuri
Copy link

Would be nice if deleteCard is supported for CIM.

@judgej judgej merged commit bd9523c into thephpleague:master Apr 30, 2016
@judgej
Copy link
Member

judgej commented Apr 30, 2016

Sorry for the delay in merging - just up to my neck in all sorts here :-)

Would you like to give dev-master a try to confirm it all looks okay to you. I'll do the same this end on a test site. This would then be release 2.4.0.

@anush
Copy link
Contributor Author

anush commented May 1, 2016

Nice!

I gave dev-master a whirl. Works fine locally and all the functional tests in our application passed. So looks good to me.

@anush anush deleted the xml-api branch May 1, 2016 07:39
@aditya-cherukuri
Copy link

I have tried the AIM and CIM gateways with sandbox accounts I was successful in performing transactions.

@judgej
Copy link
Member

judgej commented May 4, 2016

Thanks. Just finding the time to try it on my DPM UAT system, then we can go for a release.

@judgej
Copy link
Member

judgej commented May 7, 2016

Works fine on my UAT system using DPM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants