Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Jul 1, 2024
1 parent d0df211 commit 6e6c69f
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
<br>

🎟️ A Vapor package which handles all the server side elements required to implement passes for Apple Wallet.
🎟️ 📦 A Vapor package which handles all the server side elements required to implement Apple Wallet passes and orders.

### Major Releases

Expand All @@ -36,16 +36,16 @@ Use the SPM string to easily include the dependendency in your `Package.swift` f
.package(url: "https://github.com/vapor-community/PassKit.git", from: "0.4.0")
```

and add it to your target's dependencies:
> Note: This package is made for Vapor 4.
## 🎟️ Wallet Passes

Add the `Passes` product to your target's dependencies:

```swift
.product(name: "Passes", package: "PassKit")
```

> Note: This package is made for Vapor 4.
## Usage

### Implement your pass data model

Your data model should contain all the fields that you store for your pass, as well as a foreign key for the pass itself.
Expand Down Expand Up @@ -128,6 +128,9 @@ FOR EACH ROW
EXECUTE PROCEDURE "public"."RemoveUnregisteredItems"();
```

> [!CAUTION]
> Be careful with SQL triggers, as they can have unintended consequences if not properly implemented.
### Model the `pass.json` contents

Create a `struct` that implements `PassJSON` which will contain all the fields for the generated `pass.json` file.
Expand Down Expand Up @@ -434,3 +437,15 @@ fileprivate func passHandler(_ req: Request) async throws -> Response {
return Response(status: .ok, headers: headers, body: body)
}
```

## 📦 Wallet Orders

Add the `Orders` product to your target's dependencies:

```swift
.product(name: "Orders", package: "PassKit")
```

> [!WARNING]
> The `Orders` is WIP, right now you can only set up the models and generate `.order` bundles.
APNS support and order updates will be added soon. See the `Orders` target's documentation.

0 comments on commit 6e6c69f

Please sign in to comment.