diff --git a/content/concepts/messages-notifications/messages/index.mdx b/content/concepts/messages-notifications/messages/index.mdx index d67e47c..71d60f6 100644 --- a/content/concepts/messages-notifications/messages/index.mdx +++ b/content/concepts/messages-notifications/messages/index.mdx @@ -16,18 +16,25 @@ marketplace. They can be exchanged freely between a customer and a provider once they have engaged in a transaction. Messages always need to be associated with a transaction and can not be sent outside of one. -The default booking and purchase -[transaction processes](https://github.com/sharetribe/example-processes/blob/master/default-booking/process.edn) +The transaction processes +[default-booking](https://github.com/sharetribe/example-processes#default-booking), +[default-purchase](https://github.com/sharetribe/example-processes#default-purchase), +and +[default-download](https://github.com/sharetribe/example-processes#default-download) include an inquiry transition, which initiates a transaction without running any [actions](/references/transaction-process-actions/#actions), -allowing the provider and customer to send messages to each other. In -addition, the -[default-inquiry process](https://github.com/sharetribe/example-processes/blob/master/default-inquiry/process.edn) +allowing the provider and customer to send messages to each other. + +n addition, the +[default-inquiry process](https://github.com/sharetribe/example-processes#default-inquiry) initiates a simple transaction that is only intended for messaging. Note that messages do not alter the transaction or transition it to a different state. +In all transaction processes, both default and custom, messages can be +sent once the transaction has been initiated with any transition. + ## Sending messages You can send messages using the diff --git a/content/how-to/payments/removing-stripe-and-payments/index.mdx b/content/how-to/payments/removing-stripe-and-payments/index.mdx index d1e5852..9016748 100644 --- a/content/how-to/payments/removing-stripe-and-payments/index.mdx +++ b/content/how-to/payments/removing-stripe-and-payments/index.mdx @@ -63,15 +63,15 @@ You need to remove at least the following actions: - `:action/stripe-refund-payment` If you are using the template default processes with strong customer -authentication (e.g. `default-booking`, `default-purchase`, -`default-negotiation`) you need to remove confirming the payment. -Otherwise, the transaction will get stuck. The simplest way to do this -is to remove `pending-payment` and `expire-payment` states and point -`request-payment` and `request-payment-after-inquiry`, or +authentication (`default-booking`, `default-purchase`, +`default-negotiation`, `default-download`) you need to remove confirming +the payment. Otherwise, the transaction will get stuck. The simplest way +to do this is to remove `pending-payment` and `expire-payment` states +and point `request-payment` and `request-payment-after-inquiry`, or `request-payment-to-accept-offer`, directly to the following state: - `preauthorized` in `default-booking` -- `purchased` in `default-purchase` +- `purchased` in `default-purchase` and `default-download` - `offer-accepted` in `default-negotiation` When you are building the transaction process for your marketplace, it @@ -95,7 +95,8 @@ has a number of helper functions that are used to determine which state the transaction is. Depending on the transaction process being used, the _transaction.js_ file refers to either _src/transactions/transactionProcessBooking.js_, -_src/transactions/transactionProcessPurchase.js_ or +_src/transactions/transactionProcessPurchase.js_, +_src/transactions/transactionProcessDownload.js_ or _src/transactions/transactionProcessNegotiation.js_ for the correct states in each process. The transaction process file should be updated to match the new transaction process. diff --git a/content/how-to/transaction-process/add-transaction-fields/index.mdx b/content/how-to/transaction-process/add-transaction-fields/index.mdx index 1d9b369..2b7bc47 100644 --- a/content/how-to/transaction-process/add-transaction-fields/index.mdx +++ b/content/how-to/transaction-process/add-transaction-fields/index.mdx @@ -195,9 +195,10 @@ transaction process. - `default-inquiry`: transaction fields with `showTo: 'customer'` are collected on CheckoutPageWithInquiryProcess page. Fields with `showTo: 'provider'` are not collected. -- `default-booking` and `default-purchase`: transaction fields with - `showTo: 'customer'` are collected on CheckoutPageWithPayment. Fields - with `showTo: 'provider'` are not collected. +- `default-booking`, `default-purchase`, and `default-download`: + transaction fields with `showTo: 'customer'` are collected on + CheckoutPageWithPayment. Fields with `showTo: 'provider'` are not + collected. - `default-negotiation`: transaction fields with `showTo: 'customer'` are collected on RequestQuotePage, and transaction fields with `showTo: 'provider'` are collected on the MakeOfferPage. diff --git a/content/how-to/transaction-process/change-transaction-process-in-template/index.mdx b/content/how-to/transaction-process/change-transaction-process-in-template/index.mdx index 34fafd7..6e57326 100644 --- a/content/how-to/transaction-process/change-transaction-process-in-template/index.mdx +++ b/content/how-to/transaction-process/change-transaction-process-in-template/index.mdx @@ -10,11 +10,12 @@ import { Callout, FileTree } from 'nextra/components'; # Change transaction process in Sharetribe Web Template -Sharetribe Web Template defines four transaction processes by default: +Sharetribe Web Template defines five transaction processes by default: - daily, nightly, hourly, and fixed bookings use the **default-booking** process, -- product sales use the **default-purchase** process +- product sales use the **default-purchase** process, +- digital download sales use the **default-download** process, - price negotiations use the **default-negotiation** process, and - inquiries use the **default-inquiry** process. @@ -118,6 +119,7 @@ and handles these unit types by default: - **day**, **night**, **hour**, and **fixed** for the **default-booking** process - **item** for the **default-purchase** process +- **file** for the **default-download** process - **inquiry** for the **default-inquiry** process - **request** and **offer** for the **default-negotiation** process. @@ -150,6 +152,7 @@ export const PURCHASE_PROCESS_NAME = 'default-purchase'; export const BOOKING_PROCESS_NAME = 'default-booking'; export const INQUIRY_PROCESS_NAME = 'default-inquiry'; export const NEGOTIATION_PROCESS_NAME = 'default-negotiation'; +export const DOWNLOAD_PROCESS_NAME = 'default-download'; // Add new processes with a descriptive name export const NEGOTIATED_BOOKING_PROCESS_NAME = 'booking-with-negotiation'; @@ -377,6 +380,7 @@ to review. + @@ -384,6 +388,7 @@ to review. + @@ -480,6 +485,8 @@ export const getStateData = (params) => { /* ... */ if (processName === PURCHASE_PROCESS_NAME) { return getStateDataForPurchaseProcess(params, processInfo()); + } else if (processName === DOWNLOAD_PROCESS_NAME) { + return getStateDataForDownloadProcess(params, processInfo()); } else if (processName === BOOKING_PROCESS_NAME) { return getStateDataForBookingProcess(params, processInfo()); } else if (processName === INQUIRY_PROCESS_NAME) { @@ -570,6 +577,8 @@ export const getStateData = params => { /* ... */ if (processName === PURCHASE_PROCESS_NAME) { return getStateDataForPurchaseProcess(params, processInfo()); + } else if (processName === DOWNLOAD_PROCESS_NAME) { + return getStateDataForDownloadProcess(params, processInfo()); } else if (processName === BOOKING_PROCESS_NAME) { return getStateDataForBookingProcess(params, processInfo()); } else if (processName === INQUIRY_PROCESS_NAME) { @@ -612,6 +621,7 @@ const tabsForListingType = (processName, listingTypeConfig) => { ['default-purchase']: [DETAILS, PRICING_AND_STOCK, ...deliveryMaybe, ...styleOrPhotosTab], ['default-negotiation']: [DETAILS, ...locationMaybe, ...pricingMaybe, ...styleOrPhotosTab], ['default-inquiry']: [DETAILS, ...locationMaybe, ...pricingMaybe, ...styleOrPhotosTab], + ['default-download']: [DETAILS, ...locationMaybe, FILES, ...pricingMaybe, ...styleOrPhotosTab], }; return tabs[processName] || tabs['default-inquiry']; diff --git a/content/references/digital-files/index.mdx b/content/references/digital-files/index.mdx index 3fe404d..9bc8003 100644 --- a/content/references/digital-files/index.mdx +++ b/content/references/digital-files/index.mdx @@ -56,8 +56,9 @@ attachment determines the visibility of the file: - `privateFileAttachments` are visible only to the user who created the resource. -The [API reference](https://www.sharetribe.com/api-reference/) details -which resources have which scopes of file attachments available. +The +[API reference for supported attaching resources](https://www.sharetribe.com/api-reference/marketplace.html#supported-attaching-resources) +details which resources have which scopes of file attachments available. ## Further reading diff --git a/content/references/transaction-process-actions/index.mdx b/content/references/transaction-process-actions/index.mdx index f8c026b..b3a4c82 100644 --- a/content/references/transaction-process-actions/index.mdx +++ b/content/references/transaction-process-actions/index.mdx @@ -1109,6 +1109,24 @@ requires that the transition is made from a trusted context. **Configuration options**: - +### Files + +#### :action/reveal-listing-protected-files + +Copy protected file attachments from the transaction's listing to the +transaction itself. + +When the action runs during a transition, it reads all non-deleted +fileAttachment entities with :fileAttachment.scope/protected on the +transaction's listing and creates matching fileAttachment entities +attached to the transaction. + +**Preconditions**: - + +**Parameters**: - + +**Configuration options**: - + ### Stripe integration #### `:action/stripe-create-payment-intent` diff --git a/content/template/payments/save-payment-card/index.mdx b/content/template/payments/save-payment-card/index.mdx index 2732f88..82a86c9 100644 --- a/content/template/payments/save-payment-card/index.mdx +++ b/content/template/payments/save-payment-card/index.mdx @@ -27,9 +27,10 @@ payment). In the default-booking process, a preauthorization is created: the money is reserved, but not yet moved to Stripe. When a provider accepts the request, the preauthorization is captured (i.e. the payment is charged from the card and money moved to Stripe and held on the -connected account of the provider until payout). In the default-purchase -and default-negotiation processes, the payment is created and captured -immediately. The actual payout happens when the transaction completes. +connected account of the provider until payout). In the +**default-purchase**, **default-download** and **default-negotiation** +processes, the payment is created and captured immediately. The actual +payout happens when the transaction completes. A payment card also needs to be saved for off-session payments if those are in use. They are automatic one-time payments that happen when the diff --git a/content/tutorial/create-transaction-process/index.mdx b/content/tutorial/create-transaction-process/index.mdx index 0a85cb7..6bc82b5 100644 --- a/content/tutorial/create-transaction-process/index.mdx +++ b/content/tutorial/create-transaction-process/index.mdx @@ -504,6 +504,7 @@ Let's first import the new process and export its name as a constant. import * as bookingProcess from './transactionProcessBooking'; import * as inquiryProcess from './transactionProcessInquiry'; import * as negotiationProcess from './transactionProcessNegotiation'; + import * as downloadProcess from './transactionProcessDownload'; + import * as instantProcess from './transactionProcessInstantBooking'; export const ITEM = 'item'; @@ -514,6 +515,7 @@ Let's first import the new process and export its name as a constant. export const INQUIRY = 'inquiry'; export const OFFER = 'offer'; // The unitType 'offer' means that provider created the listing on default-negotiation process export const REQUEST = 'request'; // The unitType 'request' means that customer created the listing on default-negotiation process + export const FILE = 'file'; // Then names of supported processes @@ -521,6 +523,7 @@ Let's first import the new process and export its name as a constant. export const BOOKING_PROCESS_NAME = 'default-booking'; export const INQUIRY_PROCESS_NAME = 'default-inquiry'; export const NEGOTIATION_PROCESS_NAME = 'default-negotiation'; + export const DOWNLOAD_PROCESS_NAME = 'default-download'; + export const INSTANT_PROCESS_NAME = 'biketribe-instant-booking'; ``` @@ -557,6 +560,12 @@ const PROCESSES = [ process: negotiationProcess, unitTypes: [OFFER, REQUEST], }, + { + name: DOWNLOAD_PROCESS_NAME, + alias: `${DOWNLOAD_PROCESS_NAME}/release-1`, + process: downloadProcess, + unitTypes: [FILE], + }, + { + name: INSTANT_PROCESS_NAME, + alias: `${INSTANT_PROCESS_NAME}/release-1`, @@ -623,6 +632,7 @@ import { INQUIRY_PROCESS_NAME, PURCHASE_PROCESS_NAME, NEGOTIATION_PROCESS_NAME, + DOWNLOAD_PROCESS_NAME, resolveLatestProcessName, getProcess, } from '../../transactions/transaction'; @@ -631,6 +641,8 @@ import { ```jsx if (processName === PURCHASE_PROCESS_NAME) { return getStateDataForPurchaseProcess(params, processInfo()); +} else if (processName === DOWNLOAD_PROCESS_NAME) { + return getStateDataForDownloadProcess(params, processInfo()); } else if (isBookingProcess(processName)) { return getStateDataForBookingProcess(params, processInfo()); } else if (processName === INQUIRY_PROCESS_NAME) { diff --git a/content/tutorial/new-wizard-tab/index.mdx b/content/tutorial/new-wizard-tab/index.mdx index 31fe9e0..a7eeda1 100644 --- a/content/tutorial/new-wizard-tab/index.mdx +++ b/content/tutorial/new-wizard-tab/index.mdx @@ -361,6 +361,7 @@ export const DELIVERY = 'delivery'; export const LOCATION = 'location'; export const AVAILABILITY = 'availability'; export const PHOTOS = 'photos'; +export const FILES = 'files'; export const STYLE = 'style'; // EditListingWizardTab component supports these tabs @@ -372,6 +373,7 @@ export const SUPPORTED_TABS = [ LOCATION, AVAILABILITY, PHOTOS, + FILES, STYLE, ]; ``` @@ -432,6 +434,7 @@ import EditListingWizardTab, { LOCATION, AVAILABILITY, PHOTOS, + FILES, STYLE, } from './EditListingWizardTab'; ``` @@ -457,7 +460,20 @@ const TABS_BOOKING = [ STYLE, ]; const TABS_INQUIRY = [DETAILS, LOCATION, PRICING, PHOTOS, STYLE]; -const TABS_ALL = [...TABS_PRODUCT, ...TABS_BOOKING, ...TABS_INQUIRY]; +const TABS_DOWNLOAD = [ + DETAILS, + LOCATION, + FILES, + PRICING, + PHOTOS, + STYLE, +]; +const TABS_ALL = [ + ...TABS_PRODUCT, + ...TABS_BOOKING, + ...TABS_INQUIRY, + ...TABS_DOWNLOAD, +]; ``` The EditListingWizard component checks the tab value in two functions: