Class: Stripe::InvoiceCreatePreviewParams::ScheduleDetails

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/invoice_create_preview_params.rb

Defined Under Namespace

Classes: Amendment, BillingMode, Phase, Prebilling

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(amendments: nil, billing_behavior: nil, billing_mode: nil, end_behavior: nil, phases: nil, prebilling: nil, proration_behavior: nil) ⇒ ScheduleDetails

Returns a new instance of ScheduleDetails.



1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1507

def initialize(
  amendments: nil,
  billing_behavior: nil,
  billing_mode: nil,
  end_behavior: nil,
  phases: nil,
  prebilling: nil,
  proration_behavior: nil
)
  @amendments = amendments
  @billing_behavior = billing_behavior
  @billing_mode = billing_mode
  @end_behavior = end_behavior
  @phases = phases
  @prebilling = prebilling
  @proration_behavior = proration_behavior
end

Instance Attribute Details

#amendmentsObject

Changes to apply to the phases of the subscription schedule, in the order provided.



1493
1494
1495
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1493

def amendments
  @amendments
end

#billing_behaviorObject

Configures when the subscription schedule generates prorations for phase transitions. Possible values are ‘prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front.



1495
1496
1497
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1495

def billing_behavior
  @billing_behavior
end

#billing_modeObject

Controls how prorations and invoices for subscriptions are calculated and orchestrated.



1497
1498
1499
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1497

def billing_mode
  @billing_mode
end

#end_behaviorObject

Behavior of the subscription schedule and underlying subscription when it ends. Possible values are ‘release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription.



1499
1500
1501
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1499

def end_behavior
  @end_behavior
end

#phasesObject

List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the ‘end_date` of one phase will always equal the `start_date` of the next phase.



1501
1502
1503
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1501

def phases
  @phases
end

#prebillingObject

Provide any time periods to bill in advance.



1503
1504
1505
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1503

def prebilling
  @prebilling
end

#proration_behaviorObject

In cases where the ‘schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request.



1505
1506
1507
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1505

def proration_behavior
  @proration_behavior
end

Class Method Details

.field_encodingsObject



1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1525

def self.field_encodings
  @field_encodings = {
    phases: {
      kind: :array,
      element: {
        kind: :object,
        fields: {
          add_invoice_items: {
            kind: :array,
            element: {
              kind: :object,
              fields: {
                price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
              },
            },
          },
          items: {
            kind: :array,
            element: {
              kind: :object,
              fields: {
                price_data: { kind: :object, fields: { unit_amount_decimal: :decimal_string } },
              },
            },
          },
        },
      },
    },
  }
end