Skip to content

Commit

Permalink
Merge pull request #77 from robipresotto/master
Browse files Browse the repository at this point in the history
invoice: add invoice url model
  • Loading branch information
anthonycastelli authored Oct 11, 2018
2 parents 5dd0be1 + c42ac4e commit d224569
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Stripe/Models/Invoices/Invoice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public struct StripeInvoice: StripeModel {
public var dueDate: Date?
public var endingBalance: Int?
public var forgiven: Bool?
public var hostedInvoiceUrl: String?
public var invoicePdf: String?
public var lines: InvoiceLineGroup?
public var livemode: Bool?
public var metadata: [String: String]
Expand Down Expand Up @@ -68,6 +70,8 @@ public struct StripeInvoice: StripeModel {
case dueDate = "due_date"
case endingBalance = "ending_balance"
case forgiven
case hostedInvoiceUrl = "hosted_invoice_url"
case invoicePdf = "invoice_pdf"
case lines
case livemode
case metadata
Expand Down
4 changes: 4 additions & 0 deletions Tests/StripeTests/InvoiceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class InvoiceTests: XCTestCase {
"date": 1234567890,
"due_date": 1234567890,
"forgiven": false,
"hosted_invoice_url": "https://pay.stripe.com/invoice/invst_zw7Gf743ihdarScjrVuMTtctoT",
"invoice_pdf": "https://pay.stripe.com/invoice/invst_zw7Gf743ihdarScjrVuMTtctoT/pdf",
"id": "in_1BoJ2NKrZ43eBVAbQ8jb0Xfj",
"lines": {
"data": [
Expand Down Expand Up @@ -88,6 +90,8 @@ class InvoiceTests: XCTestCase {
XCTAssertEqual(invoice.date, Date(timeIntervalSince1970: 1234567890))
XCTAssertEqual(invoice.dueDate, Date(timeIntervalSince1970: 1234567890))
XCTAssertEqual(invoice.forgiven, false)
XCTAssertEqual(invoice.hostedInvoiceUrl, "https://pay.stripe.com/invoice/invst_zw7Gf743ihdarScjrVuMTtctoT")
XCTAssertEqual(invoice.invoicePdf, "https://pay.stripe.com/invoice/invst_zw7Gf743ihdarScjrVuMTtctoT/pdf")
XCTAssertEqual(invoice.livemode, false)
XCTAssertEqual(invoice.nextPaymentAttempt, Date(timeIntervalSince1970: 1234567890))
XCTAssertEqual(invoice.number, "fe61cc956c-0001")
Expand Down

0 comments on commit d224569

Please sign in to comment.