Tim Keefer > eBay-API-Simple > eBay::API::SimpleBase

Download:
eBay-API-Simple-0.29.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

eBay::API::SimpleBase - Flexible SDK supporting all eBay web services

DESCRIPTION ^

This is the base class for the eBay::API::Simple::* libraries that provide support for all of eBay's web services. This base class does nothing by itself and must be subclassed to provide the complete web service support.

eBay::API::Simple::Merchandising
eBay::API::Simple::Finding
eBay::API::Simple::Shopping
eBay::API::Simple::Trading
eBay::API::Simple::HTML
eBay::API::Simple::JSON
eBay::API::Simple::RSS

GET THE SOURCE ^

http://code.google.com/p/ebay-api-simple

PUBLIC METHODS ^

eBay::API::Simple::{subclass}->new()

see subclass for more docs.

eBay::API::Simple::Merchandising
eBay::API::Simple::Finding
eBay::API::Simple::Shopping
eBay::API::Simple::Trading
eBay::API::Simple::HTML
eBay::API::Simple::JSON
eBay::API::Simple::RSS

execute( $verb, $call_data )

Calling this method will prepare the request, execute, and process the response.

It is recommended that prepare and process be subclassed rather than this method.

$verb (required)

call verb, i.e. FindItems

$call_data (required)

hashref of call_data that will be turned into xml.

prepare( $verb, $call_data )

This is called by execute to prepare the request and may be supplied by the subclass.

process()

This is called by execute to process the response and may be supplied by the subclass.

request_agent

Accessor for the LWP::UserAgent request agent

request_object

Accessor for the HTTP::Request request object

request_content

Accessor for the complete request body from the HTTP::Request object

response_content

Accessor for the HTTP response body content

response_object

Accessor for the HTTP::Request response object

response_dom

Accessor for the LibXML response DOM

response_hash

Accessor for the hashified response content

response_json

Not implemented yet.

nodeContent( $tag, [ $dom ] )

Helper for LibXML that retrieves node content

$tag (required)

This is the name of the xml element

$dom (optional)

optionally a DOM object can be passed in. If no DOM object is passed then the main response DOM object is used.

errors

Accessor to the hashref of errors

has_error

Returns true if the call contains errors

errors_as_string

Returns a string of API errors if there are any.

INTERNAL METHODS ^

api_config

Accessor to a hashref of api config data that will be used to execute the api call.

  siteid,domain,uri,etc.

api_config_append( $hashref )

This method is used to merge config into the config_api hash

api_config_dump()

This method is used for debugging

errors_append

This method lets you append errors to the errors stack

PRIVATE METHODS ^

_execute_http_request

This method performs the http request and should be used by each subclass.

_process_http_request

This method processes the http request after it has completed.

_reset

Upon execute() we need to undef any data from a previous call. This method will clear all call data and is usually done before each execute

_build_url( $base_url, $%params )

Constructs a URL based on the supplied args

_get_request_body

The request body should be provided by the subclass

_get_request_headers

The request headers should be provided by the subclass

_get_request_agent

The request request agent should be used by all subclasses

_get_request_object

The request object should be provided by the subclass

_load_yaml_defaults

This method will search for the ebay.yaml file and load configuration defaults for each service endpoint

YAML files can be placed at the below locations. The first file found will be loaded.

  ./ebay.yaml, ~/ebay.yaml, /etc/ebay.yaml 

Sample YAML:

  # Trading - External
  api.ebay.com:
    appid: <your appid>
    certid: <your certid>
    devid: <your devid>
    token: <token>
    
  # Shopping
  open.api.ebay.com:
    appid: <your appid>
    certid: <your certid>
    devid: <your devid>
    version: 671

  # Finding/Merchandising
  svcs.ebay.com:
    appid: <your appid>
    version: 1.0.0

AUTHOR ^

Tim Keefer <tim@timkeefer.com>

CONTRIBUTOR ^

Andrew Dittes <adittes@gmail.com> Brian Gontowski <bgontowski@gmail.com>

syntax highlighting: