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.apiusername & Twocheckout.apipassword class variables 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 a TwocheckoutResponse object.

####Example Usage (toJson):

HashMap<String, String> params = new HashMap<String, String>();
params.put("option_name", "test");
params.put("option_value_name", "test");
params.put("option_value_surcharge", "1.00");

TwocheckoutResponse result = TwocheckoutOption.create(params);

####Example Response:

{
   "option_id" : "4774527631",
   "response_code" : "OK",
   "response_message" : "Option created successfully"
}

Clone this wiki locally