Skip to content

Option_Retrieve

Jacob McConnell edited this page Jun 10, 2014 · 2 revisions

The Twocheckout_Option class provides methods to create, retrieve, update and delete options and will return an Array or JSON response depending on your format specification.

##Method

###retrieve

Use to retrieve an option.

####Arguments

  • array Array
  • Array containing list_options parameters or just a option_id. Parameters -> API Detail Option

####Returns

Returns an Array or JSON Object depending on your specification.

####Example Usage:

Twocheckout::username('APIuser1817037');
Twocheckout::password('APIpass1817037');

$args = array(
    'option_id' => 4836975248
);

$option = Twocheckout_Option::retrieve($args);

####Example Response:

Array
(
    [option] => Array
        (
            [0] => Array
                (
                    [option_id] => 4836975248
                    [option_name] => Example Option
                    [option_values] => Array
                        (
                            [0] => Array
                                (
                                    [option_value_id] => 4836975251
                                    [option_value_name] => Test1
                                    [option_value_surcharge] => 1.00
                                )

                            [1] => Array
                                (
                                    [option_value_id] => 4836975266
                                    [option_value_name] => Test2
                                    [option_value_surcharge] => 1.00
                                )

                        )

                )

        )

    [response_code] => OK
    [response_message] => Option detail retrieved successfully.
)
Clone this wiki locally