Hello,

I am in process of creating a module for Paypal's new REST API and have almost achieved what I needed.
But I don't like the way it is done.

Can anyone suggest what is the best way to create such modules? like using library module and place the sdk seperately (if so then how can this be achieved?)

Thanks.

Comments

proloy03’s picture

Still no reply.... Please help...
Or am I doing something wrong??
Is it the wrong category, or is it a very newbie question or till now no Drupal Pro Developers have read this thread??
I gave Paypal REST API only as an example, it can be any other REST APIs too...

Thanks..

WorldFallz’s picture

From what I can tell, you haven't asked an answerable question. Personally, I have no clue what you're asking.

proloy03’s picture

Ok, got the point.
So, let me make clear what I want.

As you might know that you can load 3rd party Namespaces via autoload.php file. For reference download the paypal REST API (PHP sdk) and check.

I need a way to load that API and use it in a module, just like I would use in scratch PHP (like $api_class_object->createPayment(),....). But I need to do some setup before I can do that.
Can you tell what setup I need to do? I was trying to use "hook_xautoload()", but that is not working out quite well for me, may be I am doing something wrong.

Please let me know if I am still not clear.

Thanks.

proloy03’s picture

Nevermind.

I found a way to do it using hook_init(), and including the autoload.php file.

Thanks.