Language

2Checkout Documentation

Create

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

create

Use to create a option.

Arguments

  • Array containing create_option parameters in key => value pairs. Parameters -> API Create Option

Returns

Returns an Array or JSON depending on your format specification.

Example Usage:

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

$args = array(
    'option_name' => 'Example Option',
    'option_value_name' => 'Example Option Value Name',
    'option_value_surcharge' => 1.00
);
$option = Twocheckout_Option::create($args);

Example Response:

Array
(
    [option_id] => 4838121600
    [response_code] => OK
    [response_message] => Option created successfully
)