Skip to content

Commit b781fc4

Browse files
committed
Merge pull request stripe-ruby-mock#292 from TrevorHinesley/master
Added missing fields to mocked invoices
2 parents 2e62498 + eef0a06 commit b781fc4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

lib/stripe_mock/data.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,15 @@ def self.mock_charge(params={})
5757
livemode: false,
5858
paid: true,
5959
amount: 0,
60+
application_fee: nil,
6061
currency: "usd",
62+
destination: nil,
63+
fraud_details: {},
64+
receipt_email: nil,
65+
receipt_number: nil,
6166
refunded: false,
67+
shipping: {},
68+
statement_descriptor: "Charge #{charge_id}",
6269
status: 'succeeded',
6370
source: {
6471
object: "card",
@@ -89,6 +96,7 @@ def self.mock_charge(params={})
8996
url: "/v1/charges/#{charge_id}/refunds",
9097
data: []
9198
},
99+
transfer: nil,
92100
balance_transaction: "txn_2dyYXXP90MN26R",
93101
failure_message: nil,
94102
failure_code: nil,
@@ -256,12 +264,14 @@ def self.mock_line_item(params = {})
256264
livemode: false,
257265
amount: 1000,
258266
currency: "usd",
267+
discountable: false,
259268
proration: false,
260269
period: {
261270
start: 1349738920,
262271
end: 1349738920
263272
},
264273
quantity: nil,
274+
subscription: nil,
265275
plan: nil,
266276
description: "Test invoice item",
267277
metadata: {}

lib/stripe_mock/request_handlers/invoices.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def get_mock_subscription_line_item(subscription)
8585
type: "subscription",
8686
plan: subscription[:plan],
8787
amount: subscription[:plan][:amount],
88+
discountable: true,
8889
quantity: 1,
8990
period: {
9091
start: subscription[:current_period_end],

0 commit comments

Comments
 (0)