Skip to content

Sale_Stop

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

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

##Method

###stop_recurring!

Use to stop one or all active recurring lineitems on a Sale, Invoice or Lineitem object.

####Arguments

  • None
  • Must be called on a sale, lineitem or invoice instance.

####Returns

Returns stopped Lineitem object.

####Example Usage:

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

sale = Twocheckout::Sale.find(:sale_id => 4839284412)
sale.stop_recurring!

####Example Response:

#{
    "affiliate_vendor_id"=>nil,
    "billing"=>#{
        "amount"=>"0.01",
        "bill_method"=>"paypal_int",
        "billing_id"=>"4839284484",
        "customer_amount"=>"0.01",
        "customer_id"=>"4839284418",
        "date_deposited"=>nil,
        "date_end"=>nil,
        "date_fail"=>"2012-11-01",
        "date_next"=>"2012-11-01",
        "date_pending"=>"2012-10-25",
        "date_start"=>"2012-10-27",
        "lineitem_id"=>"4839284475",
        "recurring_status"=>"active",
        "status"=>"bill",
        "usd_amount"=>"0.01",
        "vendor_amount"=>"0.01"
    },
    "commission"=>nil,
    "commission_affiliate_vendor_id"=>nil,
    "commission_flat_rate"=>nil,
    "commission_percentage"=>nil,
    "commission_type"=>nil,
    "commission_usd_amount"=>nil,
    "customer_amount"=>"0.01",
    "flat_rate"=>nil,
    "installment"=>"1",
    "invoice_id"=>"4839284421",
    "lc_affiliate_vendor_id"=>nil,
    "lc_usd_amount"=>nil,
    "lineitem_id"=>"4839284475",
    "linked_id"=>nil,
    "options"=>[
        {
            "customer_surcharge"=>"0.01",
            "lineitem_id"=>"4839284475",
            "lineitem_option_id"=>"4839284481",
            "option_name"=>"0.5",
            "option_value"=>"test1",
            "usd_surcharge"=>"0.01",
            "vendor_surcharge"=>"0.01"
        }
    ],
    "percentage"=>nil,
    "product_description"=>"This is a test product!",
    "product_duration"=>"Forever",
    "product_handling"=>"0.00",
    "product_id"=>"4774388564",
    "product_is_cart"=>"0",
    "product_name"=>"Example Product",
    "product_price"=>"0.01",
    "product_recurrence"=>"1 Week",
    "product_startup_fee"=>nil,
    "product_tangible"=>"0",
    "sale_id"=>"4839284412",
    "status"=>"bill",
    "type"=>nil,
    "usd_amount"=>"0.01",
    "usd_commission"=>nil,
    "vendor_amount"=>"0.01",
    "vendor_product_id"=>"example123"
}
]
Clone this wiki locally