Class: Recurly::Requests::SubscriptionPurchase

Inherits:
Recurly::Request show all
Defined in:
lib/recurly/requests/subscription_purchase.rb

Instance Attribute Summary collapse

Attributes inherited from Recurly::Request

#attributes

Method Summary

Methods inherited from Recurly::Request

#==, #to_s

Methods included from Schema::SchemaFactory

#schema

Methods included from Schema::RequestCaster

#cast_request

Methods included from Schema::ResourceCaster

#cast

Methods included from Schema::SchemaValidator

#get_did_you_mean, #validate!, #validate_attribute!

Instance Attribute Details

#add_onsArray[SubscriptionAddOnCreate]

Returns Add-ons.

Returns:



11
# File 'lib/recurly/requests/subscription_purchase.rb', line 11

define_attribute :add_ons, Array, { :item_type => :SubscriptionAddOnCreate }

#auto_renewBoolean

Returns Whether the subscription renews at the end of its term.

Returns:

  • (Boolean)

    Whether the subscription renews at the end of its term.



15
# File 'lib/recurly/requests/subscription_purchase.rb', line 15

define_attribute :auto_renew, :Boolean

#bulkBoolean

Returns Optional field to be used only when needing to bypass the 60 second limit on creating subscriptions. Should only be used when creating subscriptions in bulk from the API.

Returns:

  • (Boolean)

    Optional field to be used only when needing to bypass the 60 second limit on creating subscriptions. Should only be used when creating subscriptions in bulk from the API.



19
# File 'lib/recurly/requests/subscription_purchase.rb', line 19

define_attribute :bulk, :Boolean

#custom_fieldsArray[CustomField]

Returns The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.

Returns:

  • (Array[CustomField])

    The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.



23
# File 'lib/recurly/requests/subscription_purchase.rb', line 23

define_attribute :custom_fields, Array, { :item_type => :CustomField }

#next_bill_dateDateTime

Returns If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). This can be used to align the subscription’s billing to a specific day of the month. The initial invoice will be prorated for the period between the subscription's activation date and the billing period end date. Subsequent periods will be based off the plan interval. For a subscription with a trial period, this will change when the trial expires.

Returns:

  • (DateTime)

    If present, this sets the date the subscription's next billing period will start (`current_period_ends_at`). This can be used to align the subscription’s billing to a specific day of the month. The initial invoice will be prorated for the period between the subscription's activation date and the billing period end date. Subsequent periods will be based off the plan interval. For a subscription with a trial period, this will change when the trial expires.



27
# File 'lib/recurly/requests/subscription_purchase.rb', line 27

define_attribute :next_bill_date, DateTime

#plan_codeString

Returns Plan code.

Returns:

  • (String)

    Plan code



31
# File 'lib/recurly/requests/subscription_purchase.rb', line 31

define_attribute :plan_code, String

#plan_idString

Returns Plan ID.

Returns:

  • (String)

    Plan ID



35
# File 'lib/recurly/requests/subscription_purchase.rb', line 35

define_attribute :plan_id, String

#quantityInteger

Returns Optionally override the default quantity of 1.

Returns:

  • (Integer)

    Optionally override the default quantity of 1.



39
# File 'lib/recurly/requests/subscription_purchase.rb', line 39

define_attribute :quantity, Integer

#ramp_intervalsArray[SubscriptionRampInterval]

Returns The new set of ramp intervals for the subscription.

Returns:



43
# File 'lib/recurly/requests/subscription_purchase.rb', line 43

define_attribute :ramp_intervals, Array, { :item_type => :SubscriptionRampInterval }

#renewal_billing_cyclesInteger

Returns If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.

Returns:

  • (Integer)

    If `auto_renew=true`, when a term completes, `total_billing_cycles` takes this value as the length of subsequent terms. Defaults to the plan's `total_billing_cycles`.



47
# File 'lib/recurly/requests/subscription_purchase.rb', line 47

define_attribute :renewal_billing_cycles, Integer

#revenue_schedule_typeString

Returns Revenue schedule type.

Returns:

  • (String)

    Revenue schedule type



51
# File 'lib/recurly/requests/subscription_purchase.rb', line 51

define_attribute :revenue_schedule_type, String

#shippingSubscriptionShippingPurchase

Returns Create a shipping address on the account and assign it to the subscription.

Returns:



55
# File 'lib/recurly/requests/subscription_purchase.rb', line 55

define_attribute :shipping, :SubscriptionShippingPurchase

#starts_atDateTime

Returns If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.

Returns:

  • (DateTime)

    If set, the subscription will begin in the future on this date. The subscription will apply the setup fee and trial period, unless the plan has no trial.



59
# File 'lib/recurly/requests/subscription_purchase.rb', line 59

define_attribute :starts_at, DateTime

#tax_inclusiveBoolean

Returns Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.

Returns:

  • (Boolean)

    Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.



63
# File 'lib/recurly/requests/subscription_purchase.rb', line 63

define_attribute :tax_inclusive, :Boolean

#total_billing_cyclesInteger

Returns The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.

Returns:

  • (Integer)

    The number of cycles/billing periods in a term. When `remaining_billing_cycles=0`, if `auto_renew=true` the subscription will renew and a new term will begin, otherwise the subscription will expire.



67
# File 'lib/recurly/requests/subscription_purchase.rb', line 67

define_attribute :total_billing_cycles, Integer

#trial_ends_atDateTime

Returns If set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.

Returns:

  • (DateTime)

    If set, overrides the default trial behavior for the subscription. When the current date time or a past date time is provided the subscription will begin with no trial phase (overriding any plan default trial). When a future date time is provided the subscription will begin with a trial phase ending at the specified date time.



71
# File 'lib/recurly/requests/subscription_purchase.rb', line 71

define_attribute :trial_ends_at, DateTime

#unit_amountFloat

Returns Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.

Returns:

  • (Float)

    Override the unit amount of the subscription plan by setting this value. If not provided, the subscription will inherit the price from the subscription plan for the provided currency.



75
# File 'lib/recurly/requests/subscription_purchase.rb', line 75

define_attribute :unit_amount, Float