test/test_data.rb in stripe-1.43.1 vs test/test_data.rb in stripe-1.44.0

- old
+ new

@@ -321,11 +321,11 @@ :object => 'list', :resource_url => '/v1/transfers/' + transfer_id + '/reversals' } end - def make_invoice + def make_invoice(params={}) { :id => 'in_test_invoice', :object => 'invoice', :livemode => false, :amount_due => 1000, @@ -359,11 +359,11 @@ :total => 1000, :charge => nil, :discount => nil, :ending_balance => nil, :next_payment_attempt => 1349825350, - } + }.merge(params) end def make_paid_invoice make_invoice.merge({ :attempt_count => 1, @@ -374,10 +374,21 @@ :ending_balance => 0, :next_payment_attempt => nil, }) end + def make_invoice_item(params={}) + { + id: "ii_test_invoice_item", + object: "invoiceitem", + date: 1466982411, + invoice: "in_test_invoice", + livemode: false, + metadata: {}, + }.merge(params) + end + def make_invoice_customer_array { :data => [make_invoice], :object => 'list', :resource_url => '/v1/invoices?customer=test_customer' @@ -790,8 +801,37 @@ "legal_entity.verification.document" ] } } }.merge(params) + end + + def make_plan(params={}) + { + id: "silver", + object: "plan", + amount: 1000, + created: 1463962497, + currency: "usd", + interval: "year", + interval_count: 1, + livemode: false, + metadata: {}, + name: "Silver", + statement_descriptor: nil, + trial_period_days: nil, + }.merge(params) + end + + def make_plan_array + { + :object => "list", + :resource_url => "/v1/plans", + :data => [ + make_plan, + make_plan, + make_plan, + ] + } end end end