Language

2Checkout Documentation

Active

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

Method

active_lineitems

Use to return all active recurring lineitem_id’s on a sale.

Arguments

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

Returns

Returns a lineitem object.

Example Usage:

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

sale = Twocheckout::Sale.find(:sale_id => 4839284412)
last_invoice = sale.invoices.last
active_lineitems = last_invoice.active_lineitems

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"
}
]