Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,39 +83,39 @@ articles in Sharetribe Developer Docs.

### default-booking:

This is the default process that is created in our backend for new
This is a default process that is created in our backend for new
test marketplaces and used for bookings.

When used in **Sharetribe Web Template** ([web-template](https://github.com/sharetribe/web-template/)) customizing
[pricing](https://www.sharetribe.com/docs/concepts/pricing/) can be
done within the template by utilizing [privileged
done within the template by using [privileged
transitions](https://www.sharetribe.com/docs/concepts/privileged-transitions/).

![default-booking](./default-booking.png)

### default-purchase:

This is the default process that is created in our backend for new
This is a default process that is created in our backend for new
test marketplaces and used for purchases. It is a
transaction process designed for product selling with shipping or pickup, and it
uses the Sharetribe stock management features.

When used in **Sharetribe Web Template** ([web-template](https://github.com/sharetribe/web-template/)) customizing
[pricing](https://www.sharetribe.com/docs/concepts/pricing/) can be
done within the template by utilizing [privileged
done within the template by using [privileged
transitions](https://www.sharetribe.com/docs/concepts/privileged-transitions/).

![default-purchase](./default-purchase.png)

### default-inquiry:

This is the default process that is created in our backend for new test marketplaces and used for free messaging. Its only function is to start a transaction so participants can send messages within the context of that transaction. The process does not use any payment, booking, or stock features.
This is a default process that is created in our backend for new test marketplaces and used for free messaging. Its only function is to start a transaction so participants can send messages within the context of that transaction. The process does not use any payment, booking, or stock features.

![default-inquiry](./default-inquiry.png)

### default-negotiation:

This is the default process that is created in our backend for new test
This is a default process that is created in our backend for new test
marketplaces and used for price negotiation. The process supports
transactions initiated by both the provider and the customer. This means
it enables both a regular or forward marketplace flow, where the
Expand All @@ -130,16 +130,19 @@ request loop after the item is delivered. In the change request loop,
the customer can request changes to the delivered product before accepting
the end result as successfully delivered.

As of October 2025, the **Sharetribe Web Template**
([web-template](https://github.com/sharetribe/web-template/)) supports
using the transaction process for reverse transactions. Support for a
forward price negotiation flow is on our roadmap, but it is currently
not supported by the template.

See the [negotiated process article](https://www.sharetribe.com/docs/concepts/negotiation-process/) for more details on the _default-negotiation_ process.

![default-negotiation](./default-negotiation.png)

### default-download

This is a default process that is created in our backend for new test
marketplaces and used for digital download sales. The process does not have any provider actions.

Once the customer successfully pays for the item, the transaction process reveals protected files from the listing to the transaction, so that the customer can then access them. The process also includes a path where the customer can report the transaction in case of an issue.

![default-download](./default-download.png)

### instant-booking:

This is an example of instant booking supporting both card and push payment methods.
Expand Down Expand Up @@ -177,4 +180,4 @@ This process makes it possible to create bookings for more than 90 days in the f

The [README.md](./automatic-off-session-payment/README.md) file in the process folder describes how to take the process into use in the Sharetribe Web Template.

![automatic-off-session-payment](./automatic-off-session-payment.png)
![automatic-off-session-payment](./automatic-off-session-payment.png)
Binary file added default-download.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
170 changes: 170 additions & 0 deletions default-download/process.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{:format :v3,
:transitions
[{:name :transition/inquire,
:actor :actor.role/customer,
:actions [{:name :action/update-protected-data}],
:to :state/inquiry}
{:name :transition/request-payment,
:actor :actor.role/customer,
:privileged? true,
:actions
[{:name :action/update-protected-data}
{:name :action/privileged-set-line-items}
{:name :action/stripe-create-payment-intent}],
:to :state/pending-payment}
{:name :transition/request-payment-after-inquiry,
:actor :actor.role/customer,
:privileged? true,
:actions
[{:name :action/update-protected-data}
{:name :action/privileged-set-line-items}
{:name :action/stripe-create-payment-intent}],
:from :state/inquiry,
:to :state/pending-payment}
{:name :transition/confirm-payment,
:actor :actor.role/customer,
:actions
[{:name :action/reveal-listing-protected-files}
{:name :action/stripe-confirm-payment-intent}
{:name :action/stripe-capture-payment-intent}],
:from :state/pending-payment,
:to :state/purchased}
{:name :transition/expire-payment,
:at
{:fn/plus
[{:fn/timepoint [:time/first-entered-state :state/pending-payment]}
{:fn/period ["P1D"]}]},
:actions
[{:name :action/calculate-full-refund}
{:name :action/stripe-refund-payment}],
:from :state/pending-payment,
:to :state/payment-expired}
{:name :transition/auto-complete,
:at
{:fn/plus
[{:fn/timepoint [:time/first-entered-state :state/purchased]}
{:fn/period ["P7D"]}]},
:actions [{:name :action/stripe-create-payout}],
:from :state/purchased,
:to :state/completed}
{:name :transition/operator-complete,
:actor :actor.role/operator,
:actions [{:name :action/stripe-create-payout}],
:from :state/purchased,
:to :state/completed}
{:name :transition/operator-report,
:actor :actor.role/operator,
:actions [],
:from :state/purchased,
:to :state/reported}
{:name :transition/report,
:actor :actor.role/customer,
:actions [],
:from :state/purchased,
:to :state/reported}
{:name :transition/operator-cancel,
:actor :actor.role/operator,
:actions
[{:name :action/calculate-full-refund}
{:name :action/stripe-refund-payment}],
:from :state/reported,
:to :state/canceled}
{:name :transition/auto-cancel,
:at
{:fn/plus
[{:fn/timepoint [:time/first-entered-state :state/reported]}
{:fn/period ["P60D"]}]},
:actions
[{:name :action/calculate-full-refund}
{:name :action/stripe-refund-payment}],
:from :state/reported,
:to :state/canceled}
{:name :transition/operator-complete-from-reported,
:actor :actor.role/operator,
:actions [{:name :action/stripe-create-payout}],
:from :state/reported,
:to :state/completed}
{:name :transition/review,
:actor :actor.role/customer,
:actions
[{:name :action/post-review-by-customer}
{:name :action/publish-reviews}],
:from :state/completed,
:to :state/reviewed}
{:name :transition/expire-review-period,
:at
{:fn/plus
[{:fn/timepoint [:time/first-entered-state :state/completed]}
{:fn/period ["P7D"]}]},
:actions [],
:from :state/completed,
:to :state/reviewed}],
:notifications
[{:name :notification/new-purchase,
:on :transition/confirm-payment,
:to :actor.role/provider,
:template :download-new-purchase}
{:name :notification/receipt,
:on :transition/confirm-payment,
:to :actor.role/customer,
:template :download-receipt}
{:name :notification/reported,
:on :transition/report,
:to :actor.role/provider,
:template :download-reported}
{:name :notification/operator-reported-to-customer,
:on :transition/operator-report,
:to :actor.role/customer,
:template :download-operator-reported}
{:name :notification/operator-reported-to-provider,
:on :transition/operator-report,
:to :actor.role/provider,
:template :download-reported}
{:name :notification/review-period-started,
:on :transition/auto-complete,
:to :actor.role/customer,
:template :download-review-period-started}
{:name :notification/payout-sent,
:on :transition/auto-complete,
:to :actor.role/provider,
:template :download-payout-sent}
{:name :notification/review-period-started-from-operator-completed,
:on :transition/operator-complete,
:to :actor.role/customer,
:template :download-review-period-started}
{:name :notification/payout-sent-from-operator-completed,
:on :transition/operator-complete,
:to :actor.role/provider,
:template :download-payout-sent}
{:name :notification/completed-from-reported-to-customer,
:on :transition/operator-complete-from-reported,
:to :actor.role/customer,
:template :download-completed-from-reported-to-customer}
{:name :notification/completed-from-reported-to-provider,
:on :transition/operator-complete-from-reported,
:to :actor.role/provider,
:template :download-completed-from-reported-to-provider}
{:name :notification/review-period-started-from-reported,
:on :transition/operator-complete-from-reported,
:to :actor.role/customer,
:template :download-review-period-started}
{:name :notification/auto-canceled-from-reported-to-customer,
:on :transition/auto-cancel,
:to :actor.role/customer,
:template :download-canceled-to-customer}
{:name :notification/auto-canceled-from-reported-to-provider,
:on :transition/auto-cancel,
:to :actor.role/provider,
:template :download-canceled-to-provider}
{:name :notification/operator-canceled-to-customer,
:on :transition/operator-cancel,
:to :actor.role/provider,
:template :download-canceled-to-customer}
{:name :notification/operator-canceled-to-provider,
:on :transition/operator-cancel,
:to :actor.role/provider,
:template :download-canceled-to-provider}
{:name :notification/new-review,
:on :transition/review,
:to :actor.role/provider,
:template :download-new-review}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
{{set-translations (asset "content/email-texts.json")}}
{{set-locale (asset "general/localization.json" "locale" "en_US")}}
{{set-timezone transaction.listing.availability-plan.timezone}}
<head>
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
</head>{{#with transaction}}
<table style="background-color:#FFF;margin:0 auto;padding:24px 12px 0;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif" align="center" border="0" cellPadding="0" cellSpacing="0" role="presentation" width="100%">
<tbody>
<tr>
<td>
<table align="center" role="presentation" cellSpacing="0" cellPadding="0" border="0" width="100%" style="max-width:600px;margin:0 auto">
<tr style="width:100%">
<td>
<h1 style="color:#484848;font-size:26px;line-height:1.3;font-weight:700">{{t "DownloadCanceledToCustomer.Title" "Your purchase of {listingTitle} has been refunded" listingTitle=transaction.listing.title }}</h1>
<p style="font-size:16px;line-height:1.4;margin:16px 0;color:#484848">
{{t "DownloadCanceledToCustomer.ContentParagraph1" "Your purchase of {listingTitle} was canceled. You've received a full refund of your purchase." listingTitle=transaction.listing.title }}</p>
<p style="font-size:16px;line-height:1.4;margin:16px 0;color:#484848">
<table style="padding:16px 0 0" align="center" border="0" cellPadding="0" cellSpacing="0" role="presentation" width="100%">
<tbody>
<tr>
<td><a href="{{marketplace.url}}/order/{{url-encode id}}/" target="_blank" style="color:#FFF;background-color:{{asset "design/branding.json" "marketplaceColors.notificationPrimaryButton" "#6938EF"}};border-radius:4px;font-size:15px;text-decoration:none;text-align:center;display:inline-block;min-width:210px;padding:0px 0px;line-height:100%;max-width:100%"><span><!--[if mso]><i style="letter-spacing: undefinedpx;mso-font-width:-100%;mso-text-raise:0" hidden>&nbsp;</i><![endif]--></span><span style="color:#FFF;background-color:{{asset "design/branding.json" "marketplaceColors.notificationPrimaryButton" "#6938EF"}};border-radius:4px;font-size:15px;text-decoration:none;text-align:center;display:inline-block;min-width:210px;padding:16px 32px;max-width:100%;line-height:120%;text-transform:none;mso-padding-alt:0px;mso-text-raise:0">{{t "DownloadCanceledToCustomer.Cta" "View details"}}</span><span><!--[if mso]><i style="letter-spacing: undefinedpx;mso-font-width:-100%" hidden>&nbsp;</i><![endif]--></span></a>
<div>
<p style="font-size:14px;line-height:1.5;margin:16px 0;color:#484848">{{t "TransactionEmails.AccessibleLinkText" "Can't click the button? Here's a link for your convenience:"}} <a target="_blank" style="color:{{asset "design/branding.json" "marketplaceColors.notificationPrimaryButton" "#6938EF"}};text-decoration:none" href="{{marketplace.url}}/order/{{url-encode id}}/">{{marketplace.url}}/order/{{url-encode id}}/</a></p>
</div>
</td>
</tr>
</tbody>
</table>
{{/with}}
<div>
<hr style="width:100%;border:none;border-top:1px solid #eaeaea;border-color:#E1E1E1;margin:20px 0" />
<p style="font-size:12px;line-height:15px;margin:0 auto;color:#b7b7b7;text-align:left;margin-bottom:50px">{{t "TransactionEmails.MembershipParagraph" "You have received this email notification because you are a member of {marketplaceName}. If you no longer wish to receive these emails, please contact the {marketplaceName} team." marketplaceName=marketplace.name }}</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{set-translations (asset "content/email-texts.json")}}{{t "DownloadCanceledToCustomer.Subject" "Your purchase of {listingTitle} has been refunded" listingTitle=transaction.listing.title }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
{{set-translations (asset "content/email-texts.json")}}
{{set-locale (asset "general/localization.json" "locale" "en_US")}}
{{set-timezone transaction.listing.availability-plan.timezone}}
<head>
<meta http-equiv="Content-Type" content="text/html charset=UTF-8" />
</head>{{#with transaction}}
<table style="background-color:#FFF;margin:0 auto;padding:24px 12px 0;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif" align="center" border="0" cellPadding="0" cellSpacing="0" role="presentation" width="100%">
<tbody>
<tr>
<td>
<table align="center" role="presentation" cellSpacing="0" cellPadding="0" border="0" width="100%" style="max-width:600px;margin:0 auto">
<tr style="width:100%">
<td>
<h1 style="color:#484848;font-size:26px;line-height:1.3;font-weight:700">{{t "DownloadCanceledToProvider.Title" "A purchase of {listingTitle} was refunded" listingTitle=transaction.listing.title }}</h1>
<p style="font-size:16px;line-height:1.4;margin:16px 0;color:#484848">
{{t "DownloadCanceledToProvider.ContentParagraph1" "A problem was reported with {customerDisplayName}'s purchase of {listingTitle}. We've reviewed the report and canceled the purchase. {customerDisplayName} has received a full refund." customerDisplayName=transaction.customer.display-name listingTitle=transaction.listing.title marketplaceName=marketplace.name }}</p>
<p style="font-size:16px;line-height:1.4;margin:16px 0;color:#484848">
{{t "DownloadCanceledToProvider.ContentParagraph2" "If you have any questions, please contact us." }}</p>
<table style="padding:16px 0 0" align="center" border="0" cellPadding="0" cellSpacing="0" role="presentation" width="100%">
<tbody>
<tr>
<td><a href="{{marketplace.url}}/sale/{{url-encode id}}/" target="_blank" style="color:#FFF;background-color:{{asset "design/branding.json" "marketplaceColors.notificationPrimaryButton" "#6938EF"}};border-radius:4px;font-size:15px;text-decoration:none;text-align:center;display:inline-block;min-width:210px;padding:0px 0px;line-height:100%;max-width:100%"><span><!--[if mso]><i style="letter-spacing: undefinedpx;mso-font-width:-100%;mso-text-raise:0" hidden>&nbsp;</i><![endif]--></span><span style="color:#FFF;background-color:{{asset "design/branding.json" "marketplaceColors.notificationPrimaryButton" "#6938EF"}};border-radius:4px;font-size:15px;text-decoration:none;text-align:center;display:inline-block;min-width:210px;padding:16px 32px;max-width:100%;line-height:120%;text-transform:none;mso-padding-alt:0px;mso-text-raise:0">{{t "DownloadCanceledToProvider.Cta" "View details"}}</span><span><!--[if mso]><i style="letter-spacing: undefinedpx;mso-font-width:-100%" hidden>&nbsp;</i><![endif]--></span></a>
<div>
<p style="font-size:14px;line-height:1.5;margin:16px 0;color:#484848">{{t "TransactionEmails.AccessibleLinkText" "Can't click the button? Here's a link for your convenience:"}} <a target="_blank" style="color:{{asset "design/branding.json" "marketplaceColors.notificationPrimaryButton" "#6938EF"}};text-decoration:none" href="{{marketplace.url}}/sale/{{url-encode id}}/">{{marketplace.url}}/sale/{{url-encode id}}/</a></p>
</div>
</td>
</tr>
</tbody>
</table>
{{/with}}
<div>
<hr style="width:100%;border:none;border-top:1px solid #eaeaea;border-color:#E1E1E1;margin:20px 0" />
<p style="font-size:12px;line-height:15px;margin:0 auto;color:#b7b7b7;text-align:left;margin-bottom:50px">{{t "TransactionEmails.MembershipParagraph" "You have received this email notification because you are a member of {marketplaceName}. If you no longer wish to receive these emails, please contact the {marketplaceName} team." marketplaceName=marketplace.name }}</p>
</div>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{set-translations (asset "content/email-texts.json")}}{{t "DownloadCanceledToProvider.Subject" "A purchase of {listingTitle} was refunded" listingTitle=transaction.listing.title }}
Loading