Language

2Checkout Documentation

Create

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

Returns

Returns a TwocheckoutResponse object.

Example Usage (toJson):

HashMap params = new HashMap();
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"
}