Skip to content
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

New Authorize.net API #33

Open
mgroger opened this issue Mar 4, 2017 · 14 comments
Open

New Authorize.net API #33

mgroger opened this issue Mar 4, 2017 · 14 comments

Comments

@mgroger
Copy link

mgroger commented Mar 4, 2017

Any plans to add support for the new Authorize.net API?

@ghidinelli
Copy link
Owner

Would love it - I'm not an Authorize.net user so would be looking for a contributor. I can provide technical guidance. All one has to do is write the glue to translate authorize.net parameters into cfpayment parameters.

@cfmitrah
Copy link

@cypersonic made lot of progress related to this & some more work, Not sure, why he haven't made PR for those? cmd-ltd@df9d7ad

@ghidinelli
Copy link
Owner

@cybersonic I think you were mis-tagged above?

@ARehmanMahi
Copy link

ARehmanMahi commented Mar 6, 2020

Hi, Does this library work with Authorise.net?
I mean the gatway is there but I don't see the required userid and transaction id params in the authorize.cfc file. If it could be used to charge credit card, please guide me into an example or some pointers to it.

would something like this work

// initialize gateway
cfg = { path = "gateway.authorizenet.authorizenet",  **name = "xxx", transactionKey = "yyy"** };
svc = createObject("component", "cfpayment.api.core").init(cfg);
gw = svc.getGateway();

// create the account
account = svc.createCreditCard().setAccount(4242424242424242).setMonth(10).setYear(year(now())+1)
             .setFirstName("John").setLastName("Doe");

// in cents = $50.00, defaults to USD but can take any ISO currency code
money = svc.createMoney(5000);

// charge the card
response = gw.purchase(money = money, account = account);

// did we succeed?
if (response.getSuccess()) {
  // yay!  look at response.getResult() or response.getParsedResult()
  // verify response.isValidAVS() or response.isValidCVV()
} else {
  // check response.getStatus(), output response.getMessage()
}

sorry if its somewhere explained, and I overlooked it. New to CF and this.

@jmohler1970
Copy link

This question has been around for a while, so let me give some general advice. A more modern solution would be to find their REST endpoint and just run against it.

Why?

  1. Because it it highly likely that the component is doing just that anyway.
  2. It is likely that the component isn't actively supported
  3. A REST endpoint would address modern security concerns
  4. You can ask many many people about REST. CFML not so much. A CFML component even fewer people would know about it.

@ARehmanMahi
Copy link

@jmohler1970 Thanks for your reply. I was afraid this was gonna be the case. But your advise is great and I'll look at their site for any REST implementation. They have API endpoints that accepts JSON and XML so most probably I'll have to roll my own code. Thanks again.

@cybersonic
Copy link
Collaborator

I did a lot of the Auth.Net work on this a while back but have since stopped working for that client and don't have the source code.

I would really suggest using their rest end point directly. IIRC it was a real PITA otherwise. If there is a more modern approach use that.

@jmohler1970
Copy link

jmohler1970 commented Mar 6, 2020

Two quick additional words of advice.

  1. Postman is your friend. If you can do it in Postman, you can do it in CF

  2. CFML does not document it very much but [:] ordered structs are good for you sanit

  3. As are making structs via mystruct['key'] and not mystruct.key will make things much easier.

@ARehmanMahi
Copy link

@cybersonic You are absolutelly right about that :), looking into their site now.

@jmohler1970 I read about the structure stuff somewhere and you confirmed it for me. Awesome tips. Really grateful. And yes postman seems a sane option to start with.

I'm not good at this stuff otherwise I would say I'll try a PR. Wished I could.

@cybersonic
Copy link
Collaborator

I can't remember which provider it was but they wanted ordered structs in JSON and that was just mind-blowing to develop against if you didn't know!

@jmohler1970
Copy link

I think I had to deal with that once.

Some company internally converted JSON input into XML. JSON is normally not position sensitive, but XML is. So you had to create a JSON with data in the right order [sic] so that internally it could create the XML.

No where was that documented.

@ARehmanMahi
Copy link

ARehmanMahi commented Mar 6, 2020

O wow, Now I get it. such quirks are really difficult to deal with in CF world. I've been bitten by such scenarios a couple of times. One such thing is CF and lucee differences for handling JSON and form[] arrays.

@ghidinelli
Copy link
Owner

@bsienn - I'd recommend still using cfpayment as your base library but echo what Mark said about integrating against the REST API directly. cfpayment still provides valuable base functionality to help abstract away gateway-specific implementations. Even if you never switch providers, some of the abstractions may be helpful in building an elegant system.

@ARehmanMahi
Copy link

@ghidinelli HI, Thanks for your reply. I'm no where near as much skilled in libraries as the contributors of this project. But I do have plan on making payment gateways for stripe, 2checkout and paypal so that I could use them for my clients' projects.

I'm just starting my career as a freelancer and these payment gateways are essential in custom development.

I do have 4+ years of developments experience in php, vuejs and 2+ in CF.
I'll try to understand how this project works and will try to complete the authorize.net gateway near future. I've not tested stripe & paypal of this library, hopefully they are compatible with current APIs of the payment processors. Hoping to be part of this project.

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

No branches or pull requests

6 participants