Skip to content

Commit

Permalink
Fix orders object
Browse files Browse the repository at this point in the history
  • Loading branch information
mauryaratan committed Oct 7, 2023
1 parent 030a570 commit ad22426
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Sources/LemonSqueezy/Types+Order.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ extension Order {
public let storeId: Int

/// The ID of the customer this subscription belongs to.
public let customerId: Int
public let customerId: Int?

/// The unique identifier (UUID) for this order.
public let identifier: String

/// An integer representing the sequential order number for this store.
public let orderNumber: Int

/// The full name of the customers.
public let userName: String
public let userName: String?

/// The email address of the customer.
public let userEmail: String
public let userEmail: String?

/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code for the order (e.g. `USD`, `GBP` etc.).
public let currency: String
Expand Down Expand Up @@ -84,7 +84,7 @@ extension Order {
public let statusFormatted: String

/// Has the value true if the order has been refunded.
public let refunded: Int
public let refunded: Bool

/// If the order has been refunded, this will be an [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date-time string indicating when the order was refunded.
public let refundedAt: String?
Expand All @@ -102,7 +102,10 @@ extension Order {
public let totalFormatted: String

/// An object representing the first [order item](https://docs.lemonsqueezy.com/api/order-items) belonging to this order.
public let firstOrderItem: FirstOrderItem
//public let firstOrderItem: FirstOrderItem

/// An object of customer-facing URLs for this order.
public let urls: Urls

/// An [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date-time string indicating when the object was created.
public let createdAt: String
Expand Down Expand Up @@ -137,6 +140,11 @@ extension Order {
/// An [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted date-time string indicating when the object was last updated.
public let updatedAt: String
}

public struct Urls: Codable {
/// A pre-signed URL for viewing the order in the customer's [My Orders](https://docs.lemonsqueezy.com/help/online-store/my-orders) page.
public let receipt: String
}
}

extension Order {
Expand Down

0 comments on commit ad22426

Please sign in to comment.