Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

AUTOLOAD to Access PayPal API

by TomKane (Beadle)
on Jul 24, 2012 at 23:50 UTC ( #983526=perlquestion: print w/ replies, xml ) Need Help??
TomKane has asked for the wisdom of the Perl Monks concerning the following question:

As I read through the code in the Business::PayPal::NVP module, I see that it has an AUTOLOAD function defined. I know it is calling into the PayPal NVP API, but I don't understand how the linkage is made. I know this is part of perl's automagic and I'm not an advanced perl programmer, I guess.

I would like to create a parallel module that will call the newer PayPal Payflow Gateway API.

I think that it may be easy enough to substitute one API name for the other and make some other adjustments. But I don't see where the PayPal API is being called.

Any insights/advice would be appreciated.

Comment on AUTOLOAD to Access PayPal API
Re: AUTOLOAD to Access PayPal API
by kcott (Abbot) on Jul 25, 2012 at 00:31 UTC

      kcott,

      Thanks for your help.

      Unfortunately, perlobj says the same thing as the camel book. But I was looking for a method in AUTOLOAD that exposed a remote API's interface -- kind of like the DYNALOAD linkage to dynamic libraries.

      I realize now there is no linkage there at all. After looking more closely at the Business::PayPal::NVP package, I see that the API is actually reached via a url. Other than the magic of AUTOLOAD itself, there is no other magic happening.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://983526]
Approved by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2014-07-30 01:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls