=== WalletPassBuilder – Passes for Apple Wallet and Google Wallet ===
Contributors: walletpassbuilder
Tags: wallet, apple wallet, google wallet, booking, event tickets
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Design a wallet pass and add the official Add to Apple Wallet and Add to Google Wallet buttons to any page.

== Description ==

WalletPassBuilder connects your site to your [WalletPassBuilder](https://walletpassbuilder.com) account, so your visitors can save your event pass, ticket or membership card to the wallet on their phone in one tap.

* **Connect your account** with an API key, and see your plan and remaining pass credits.
* **Design a pass** in WordPress from a ready-made template: business name, title, background colour (text adjusts automatically for contrast), logo (your Site Icon or theme logo to start with, otherwise the WalletPassBuilder icon), up to three fields on the front, a QR code or barcode and details on the back, with live Apple Wallet and Google Wallet previews of the front and back.
* **Add the official Add to Apple Wallet and Add to Google Wallet buttons** to any page with a block or a shortcode. Each one opens that wallet with the pass.
* **Add a hero image and reminders** in the Advanced section: a hero image across the pass (move and zoom it to frame it, and pick a different one for kids' tickets or cancelled bookings), and lock-screen reminders when the event starts, before the pass expires, or when people are near your venue.
* **Keep the pass current.** Change the template and update the pass: everyone who already saved it gets the new version on their phone.
* **See what happened** in the activity log, with the reason for any failure and a Retry button.

Use the pass from the plugin's Pass Template tab, or any other pass from your WalletPassBuilder account.

= LatePoint =

Turn on LatePoint on the Integrations tab and every appointment gets its own wallet pass with the service, date, time, place and booking code. Design the booking pass in the same editor as the Generic Pass: type your own text and add data fields where you want them, such as the service, date, start and end time, duration, location, agent, customer name, booking code, status and price. When the appointment is rescheduled or moved, the pass on the customer's phone updates; if it's cancelled, the pass says so. The Add to Wallet buttons appear on the booking confirmation and in the customer's bookings, and you can add `{{wallet_pass_buttons}}` or `{{wallet_pass_link}}` to LatePoint's emails. A check every 15 minutes retries anything that failed and catches changes made outside LatePoint's normal screens.

= Amelia =

Turn on Amelia on the Integrations tab and every appointment and every event booking gets its own wallet pass. There are two passes to design, one for appointments (service, date, time, employee, location) and one for events (event, date, time, location, tickets), in the same editor with the same data fields. When a booking is rescheduled, approved or cancelled, or the event itself changes or is cancelled, the pass on the customer's phone updates. The Add to Wallet buttons appear on the confirmation screen of Amelia's booking forms, and you can add `%wallet_pass_buttons%` or `%wallet_pass_link%` to Amelia's customer emails.

= Sugar Calendar =

Turn on Sugar Calendar on the Integrations tab and every ticket sold or claimed through Sugar Calendar's ticketing gets its own wallet pass: the event, date, time and place, the ticket holder and the ticket code as a QR code. Tickets bought together each get their own pass, so they can be shared and scanned one by one. When the event moves or an order is refunded, the passes on people's phones update. The Add to Wallet buttons appear on the order receipt, one pair per ticket, and you can add `{wallet_pass_buttons}` or `{wallet_pass_link}` to Sugar Calendar's ticket and receipt emails.

= Event Tickets =

Turn on Event Tickets on the Integrations tab and every ticket and RSVP from Event Tickets (by The Events Calendar) gets its own wallet pass: the event, its date, time and venue, the ticket holder and the security code as a QR code. It works with RSVPs and Tickets Commerce, on The Events Calendar's events or any page with tickets. A pass is issued once a ticket is paid for or an RSVP is "Going"; when the event changes, an order is refunded or someone checks in, the pass on their phone updates. The Add to Wallet buttons appear on the order confirmation and the "My Tickets" page, one pair per ticket, and beside each ticket in Event Tickets' ticket emails.

= Bookly =

Turn on Bookly on the Integrations tab and every booking made with Bookly (Lite or Pro) gets its own wallet pass: the service, date, time, staff member, customer and booking number as a QR code. Everyone in a group booking gets their own pass. When an appointment is rescheduled, approved, cancelled or rejected, from Bookly's calendar, its appointments list or the links in its emails, the pass on the customer's phone updates. The Add to Wallet buttons appear on the booking form's last step, and you can add `[wallet_pass_buttons {booking_number}]` or `[wallet_pass_link {booking_number}]` to Bookly's email notifications (Bookly fills in the booking number). Those only show in emails to that booking's customer, its staff member or the site's admin. Bookly has to send its emails through WordPress (its default), not its own SMTP setting.

= Events Manager =

Turn on Events Manager on the Integrations tab and every space in an Events Manager booking gets its own wallet pass: a booking for three people is three tickets, each with the event, date, time and place, who booked it, the ticket type and number, and its own ticket code as a QR code. A pass is issued once a booking is pending approval or approved. When the event moves or is cancelled, or the booking is approved, rejected or cancelled, the passes on people's phones update. The Add to Wallet buttons appear in the booking form's success message and on the "My Bookings" page, and you can add `#_WALLETPASSBUTTONS` or `#_WALLETPASSLINK` to Events Manager's booking emails.

= EventON =

Turn on EventON (Lite or the full version) on the Integrations tab and every upcoming event gets a wallet pass that everyone shares: the event, its date, time and place, and its status. People add it from an Add to Wallet box on EventON's event card; when the event moves, is cancelled or postponed, or (when it repeats) its next date comes round, the pass on every phone that saved it updates. Each event uses one pass credit, whoever adds it. If you've arranged EventON's event card yourself, add the "Add to Wallet" box in EventON › Settings › EventCard.

= Event Espresso =

Turn on Event Espresso on the Integrations tab and every registration gets its own wallet pass. Event Espresso makes a registration for each ticket in an order, so a group of three gets three passes, each with the event, date, time and venue, the attendee, the ticket type and number, and the registration code as a QR code. A pass is issued once a registration is approved or awaiting review. When the event, its dates, tickets or venue change, or a registration is approved, cancelled or declined, the passes on people's phones update. The Add to Wallet buttons appear on the thank-you page, and you can add `[WALLET_PASS_BUTTONS]` or `[WALLET_PASS_LINK]` to Event Espresso's messages.

= WooCommerce =

Turn on WooCommerce on the Integrations tab, then tick "Wallet pass" on the products that should issue one. Each unit bought gets its own wallet pass once the order is paid, so three tickets are three passes, each with the product and its options, the customer's name, the order number and its own code as a QR code. A cancelled, refunded or failed order, or a refunded unit, shows as cancelled on the pass. The Add to Wallet buttons appear on the order received page, in My Account's orders and in WooCommerce's order emails to the customer. Works with WooCommerce's order tables (HPOS).

= Requirements =

A WalletPassBuilder account. You can [create one for free](https://walletpassbuilder.com/signup); each new pass uses pass credits from your account.

== External services ==

This plugin connects to the WalletPassBuilder service (https://walletpassbuilder.com), which creates and signs Apple Wallet and Google Wallet passes. The plugin does not work without it.

What is sent, and when:

* **When you connect, and when you open the plugin's Settings tab:** your API key, to check it and show your account name, email address, plan and pass credits.
* **When you create or update the pass from the Pass Template tab:** the pass design you entered (business name, title, background colour, logo image, front fields, barcode value and back sections).
* **With LatePoint turned on, when an appointment is booked or changed:** the appointment details your booking pass shows (by default the customer's name, the service, the date, time and location, the booking code and the status; optionally the end time, duration, agent and price), to create or update that customer's pass. Customer email addresses and phone numbers are never sent. Nothing is sent for appointments made while the integration is off.
* **With Amelia turned on, when an appointment or event booking is made or changed:** the booking details its pass shows (by default the customer's name, the service or event, the date, time and location, the employee or tickets, the booking number and the status), to create or update that customer's pass. Customer email addresses and phone numbers are never sent. Nothing is sent for bookings made while the integration is off.
* **With Sugar Calendar turned on, when a ticket is bought or claimed, or its order or event changes:** the ticket details its pass shows (by default the ticket holder's name, the event, its date, time and location, the ticket type, the ticket code, the order number and the status), to create or update that ticket's pass. Email addresses are never sent. Nothing is sent for tickets sold while the integration is off.
* **With Event Tickets turned on, when a ticket or RSVP is confirmed, checked in or changed:** the ticket details its pass shows (by default the ticket holder's name, the event, the ticket type, the security code, the order number and the status, and with The Events Calendar the event's date, time and venue), to create or update that ticket's pass. Email addresses are never sent. Nothing is sent for tickets made while the integration is off.
* **When you search for an address in the Advanced section:** what you type, to suggest addresses and find the chosen one's coordinates. WalletPassBuilder looks addresses up with Google Maps Platform (Places); see Google's [privacy policy](https://policies.google.com/privacy).
* **When you send a message from the Help tab (or request an integration):** your reply-to email address, subject, message and any screenshots you attach, and (unless you untick "Include site details") your site's address, the plugin, WordPress and PHP versions, which integrations are on, your Generic Pass id and the last few failed entries from Activity; an integration request also lists your active plugins. The Help tab shows exactly what's included before you send. It goes to the WalletPassBuilder support team.
* **With Bookly turned on, when a booking is made or changed:** the booking details its pass shows (by default the customer's name, the service, the date, time and location, the staff member, the status and the booking number), to create or update that customer's pass. Customer email addresses and phone numbers are never sent. Nothing is sent for bookings made while the integration is off.
* **With Events Manager turned on, when a booking is made or changed, or its event changes:** each ticket's details its pass shows (by default who booked it, the event, its date, time and location, the ticket type and number, the ticket code, the booking number and the status), to create or update that ticket's pass. Email addresses and phone numbers are never sent. Nothing is sent for bookings made while the integration is off.
* **With EventON turned on, when an event is published or changed, and every 15 minutes for upcoming events:** the event details its pass shows (by default the event's name, date, start and end time, location, address, organizer, status and page link), to create or update that event's pass. Nothing about the people who add it is sent.
* **With Event Espresso turned on, when a registration, attendee, event, date, ticket or venue is saved:** each affected registration's details its pass shows (by default the attendee's name, the event, its date, time and venue, the ticket type and number, the registration code, the order number and the status), to create or update that registration's pass. Email addresses, phone numbers and addresses are never sent. Nothing is sent for registrations made while the integration is off.
* **With WooCommerce turned on, when an order with a "Wallet pass" product is paid, changed or refunded:** each unit's details its pass shows (by default the customer's name, the product and its options, the unit number, its code, the order number and date and the status), to create or update that unit's pass. Email addresses, phone numbers and addresses are never sent. Nothing is sent for products without "Wallet pass" ticked.
* **When a page shows an "Add to Wallet" button, and when you pick a pass in the block editor:** the pass id, to look up the pass's share link and the list of your passes. Results are cached on your site.

Every request also includes your site's address in its user agent. Apart from the bookings and tickets above, the plugin sends no information about your visitors or customers. When a visitor clicks an Add to Apple Wallet or Add to Google Wallet button, their browser opens the pass on the WalletPassBuilder service (walletpassbuilder.com, gowalletpass.com or your own custom share domain), which hands it to Apple Wallet or Google Wallet. The button images are part of the plugin and load from your site.

WalletPassBuilder [terms of service](https://walletpassbuilder.com/terms) and [privacy policy](https://walletpassbuilder.com/privacy).

== Installation ==

1. Install and activate the plugin.
2. Open **WalletPassBuilder** in your WordPress admin menu, paste your API key from **API** in your WalletPassBuilder dashboard, and click **Connect**.
3. On the **Pass Template** tab, change the ready-made pass to suit you and click **Save and create pass**.
4. Add the **Add to Wallet** block to a page, or the shortcode `[wallet_pass_builder]`.

== Frequently Asked Questions ==

= Can I show a pass I made in WalletPassBuilder? =

Yes. Pick it in the block's settings, or use `[wallet_pass_builder pass="PASS_ID"]`. The **Add to Wallet button** tab lists your passes with their shortcodes.

= What options does the shortcode take? =

`pass` (a pass id; leave it out for the pass from the Pass Template tab), `wallets` (`both`, `apple` or `google`) and `align` (`left`, `center` or `right`). For example: `[wallet_pass_builder pass="PASS_ID" wallets="both" align="center"]`.

= Does updating the pass change it on people's phones? =

Yes. Updating keeps the same pass and link, and phones that saved it receive the new version. The plugin asks you to confirm first.

= Does the plugin delete passes? =

No. Passes stay in your WalletPassBuilder account. Deleting the plugin removes your API key from the site, and also its settings and activity log if you tick that option on the Settings tab.

= Which workspace are passes created in? =

Your account's default workspace. You can change it in WalletPassBuilder under Settings > Workspace.

= Where do the QR code and barcode come from? =

The preview draws them in your browser with the bundled [QR Code Generator](https://github.com/kazuhikoarase/qrcode-generator) library by Kazuhiko Arase (MIT licence) and a built-in Code 128 encoder, the same formats Apple Wallet and Google Wallet show.

== Changelog ==

= 1.1.0 =
* LatePoint: a wallet pass for every appointment, updated when the appointment changes, with Add to Wallet buttons on the confirmation, in the customer's bookings and in emails.
* Design the LatePoint booking pass in the Pass Template editor, inserting appointment details anywhere.
* A scheduled check every 15 minutes retries failed passes and catches missed changes.
* Amelia: a wallet pass for every appointment and event booking, updated when it changes, with Add to Wallet buttons on the booking confirmation and in Amelia's emails.
* Sugar Calendar: a wallet pass for every ticket, updated when the event or order changes, with Add to Wallet buttons on the order receipt and in Sugar Calendar's emails.
* Event Tickets: a wallet pass for every ticket and RSVP, updated on check-in, refunds and event changes, with Add to Wallet buttons on the order confirmation, "My Tickets" and in Event Tickets' emails.
* Events Manager: a wallet pass for every ticket (each space in a booking), updated when the booking or event changes, with Add to Wallet buttons in the booking confirmation, on "My Bookings" and in Events Manager's emails.
* EventON: a wallet pass for every upcoming event, shared by everyone who adds it from the event card, updated when the event changes, is cancelled or moves on to its next date.
* Event Espresso: a wallet pass for every registration (each ticket in an order), updated when the registration, attendee, event, date, ticket or venue changes, with Add to Wallet buttons on the thank-you page and in Event Espresso's messages.
* WooCommerce: a wallet pass for every unit bought of the products you tick, issued when the order is paid and cancelled when it's refunded, with Add to Wallet buttons on the order received page, in My Account and in order emails.
* Bookly: a wallet pass for every booking (one per customer in a group), updated when it's rescheduled, approved or cancelled, with Add to Wallet buttons on the booking form's last step and in Bookly's emails.
* Advanced section on every pass: a hero image (Apple's strip, Google's hero) you can move and zoom to frame, with variations for bookings whose details match (a kids' ticket, a cancelled booking), and reminders at the start time, before expiry and near a place. Booking passes remind each customer at their own booking's start time.
* A Header line above the pass title, and one shared layout for every booking pass: the holder's name, then date, time and place.
* Booking passes get the new design automatically after an update to the plugin changes it.
* The activity log shows the customer for each pass.
* A Help tab with quick answers and a form to message the WalletPassBuilder team (with screenshots), showing exactly which site details go with it. Request an integration from the Integrations tab.

= 1.0.0 =
* First release: connect your account, design a pass with Apple Wallet and Google Wallet previews, official Add to Wallet buttons as a block and shortcode, activity log with retry.
