Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Graham Kite
PLUS
Graham Kite
Courses Plus Student 8,123 Points

connecting to an api

I have to find some way of connecting a shopping cart plugin to an api are there any tutorials here anywhere?I've never done this before and need some help understanding how to do it.

8 Answers

Graham Kite, What API are you specifically looking to connect to? Within WordPress you will be best to create a plugin for your connection needs to keep with practices of that code base. Most API's have existing libraries that will allow you to use your language to connect to their API. I am currently working on a Course for the Stripe API which has a PHP library.

Maybe give us a bit more information and the community here can give you more relevant advice.

Graham Kite
PLUS
Graham Kite
Courses Plus Student 8,123 Points

Hi Hampton, difficult to tell at present. The client has asked me to integrate Australia post api (not critical) and I personally am not sure it is the right thing for them.

And for a point of sales system I am looking at either paypal or stripe shopping carts and they need to talk to Possibly a Magento cart and system, or iThemes Exchange plugin in wordpress.

The product pages will be run from the plugin or Magento, which need to talk to the cart which will be paypal or stripe and then the sales must come back from their api's to talk to the point of sales system, one of which uses a csv in a password protected folder and the other has fields I can tap into.

Client is asking for my advice and this is out of my depth at present. I have never added an api to anything before.

In reality I know it is just a matter of adding the correct field in wordpress or a form etc and then figuring out how to output or parse it.

Just don't know how to do it yet.

Graham Kite
PLUS
Graham Kite
Courses Plus Student 8,123 Points

All that aside the stripe training sound exciting, Stripe is now beta testing in Australia and It is now a very viable option. When will that training be available?

It might go a long way to working out this job, if ready. :)

Graham Kite
PLUS
Graham Kite
Courses Plus Student 8,123 Points

I put a support ticket through and they said to raise this in the forum as it would be good for members. I will start another api/wordpress integration later to follow up on that request.

Thanks for the update Graham. You may want to look into a plugin for WordPress called 'shopp'. It is not overly expensive and can integrate with quite a few payment gateways. After you have sales data in the Wordpress backend, then it is a matter of figuring out how to communicate with their API to send that data to them. I can say for sure that working with an unknown API can be a bit daunting depending on the author and how good their documentation is at present. I would make sure you are comfortable before diving in head first. Perhaps try to bring on someone to help you with that portion of the project and then work on the parts you know for now... Either way, sounds like a fun challenge.

The stripe course will be coming directly after the course on Object Oriented PHP which should be out in December.

Graham Kite
PLUS
Graham Kite
Courses Plus Student 8,123 Points

Thanks for the updates. I am considering getting help, however, I would really love to learn an get up to speed with this if possible. Have a meeting on Friday, AM my time with one of the systems people, hoping they may have a configured html demo page. If so I should be able to work it into wordpress form that. In the mean time trying to go through the wordpress plugin before then but very time poor this week. will do as much as I can. hopefully I can get through enough to be a bit more educated before the meeting.

Either way you choose, I wish you luck. Let us know how we could help.