Skip to content

Option_Create

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

You must specify your API username and password using the Twocheckout::API.credentials method before calling a method in this class.

##Method

###create

Use to create an option.

####Arguments

  • hash Parameters
  • Hash containing create_option parameters. Parameters -> API Create Option

####Returns

Returns an Option object.

####Example Usage:

Twocheckout::API.credentials = { :username => 'APIuser1817037', :password => 'APIpass1817037' }

new_option = Twocheckout::Option.create({:option_name => "test option", :option_value_name => "test option value", :option_value_surcharge => 1.00})

####Example Response:

#{
    "option_id"=>"4839039618",
    "option_name"=>"test option",
    "option_values"=>[
        {
            "option_value_id"=>"4839039621",
            "option_value_name"=>"test option value",
            "option_value_surcharge"=>"1.00"
        }
    ]
}
Clone this wiki locally