{
    "componentChunkName": "component---src-templates-article-page-template-js",
    "path": "/tutorial/create-transaction-process/",
    "result": {"data":{"markdownRemark":{"frontmatter":{"title":"Create a new transaction process","slug":"create-transaction-process","updated":"2021-12-16T00:00:00.000Z","category":"tutorial-transaction-process","ingress":"This guide describes how to create a new transaction process and how to take it into use on the FTW-daily template.","skills":null},"htmlAst":{"type":"root","children":[{"type":"element","tagName":"h2","properties":{"id":"create-a-transaction-process","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#create-a-transaction-process","ariaLabel":"create a transaction process permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Create a transaction process"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In this tutorial, we'll create a new transaction process for the\nCottageDays marketplace. It will be a daily booking process in contrast\nto the default nightly process. We make this for demonstration purpose\nsince it might not be a smart move for an actual cottage-rental\nmarketplace."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In addition, we also add a new decline transition for the operator and\nupdate the client app so that it uses the new process."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"clone-flex-example-processes-repository","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#clone-flex-example-processes-repository","ariaLabel":"clone flex example processes repository permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Clone Flex example processes repository"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Writing "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"process.edn"}]},{"type":"text","value":" file and email templates from scratch is a bit\ntedious task. We'll make our life a bit easier by cloning Flex example\nprocesses repository:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"git"}]},{"type":"text","value":" clone https://github.com/sharetribe/example-processes.git"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"And then we move to that directory:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","builtin","class-name"]},"children":[{"type":"text","value":"cd"}]},{"type":"text","value":" example-processes/"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"There are several processes listed in\n"},{"type":"element","tagName":"a","properties":{"href":"https://github.com/sharetribe/example-processes","target":"_blank","rel":["noopener","noreferrer"]},"children":[{"type":"text","value":"that directory"}]},{"type":"text","value":". The\none we are going to use as a basis for our new process is\n"},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"flex-default-process"}]},{"type":"text","value":". It has privileged transitions in use and it is\ntherefore compatible with FTW-daily v8.0.0 or later."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"extrainfo","properties":{"title":"What's the preauth-daily-booking example process?"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In the example processes repository, there's another process that\nspecifically named as daily booking ("},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"preauth-daily-booking"}]},{"type":"text","value":"). It's an\nold process (created before privilege transitions feature) and its\nspeciality was about how it counted total price with\n:action/calculate-tx-daily-total-price. However, with privileged\ntransitions, the pricing is set on the client app - so, there is no need\nfor process changes between nightly and daily booking."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"create-a-new-process","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#create-a-new-process","ariaLabel":"create a new process permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Create a new process"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"To get up and running with Flex CLI, see the\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/introduction/getting-started-with-flex-cli/"},"children":[{"type":"text","value":"Getting started with Flex CLI"}]},{"type":"text","value":"\nguide in Flex Docs."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Let's see what the subcommand "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"help"}]},{"type":"text","value":" gives us about "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"process create"}]},{"type":"text","value":":"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"$ flex-cli "},{"type":"element","tagName":"span","properties":{"className":["token","builtin","class-name"]},"children":[{"type":"text","value":"help"}]},{"type":"text","value":" process create\ncreate a new transaction process\n\nUSAGE\n  $ flex-cli process create\n\nOPTIONS\n  --path"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"LOCAL_PROCESS_DIR          path to the directory where the process.edn "},{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"file"}]},{"type":"text","value":" is\n  --process"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"PROCESS_NAME            name "},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"for"}]},{"type":"text","value":" the new process that is created\n  -m, --marketplace"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"MARKETPLACE_ID  marketplace identifier"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"So, if we would like to create a new process, we need to specify a path\nto the local directory. That directory should contain process definition\n(process.edn file) and templates subdirectory containing correct email\ntemplates for the email notifications defined in that process. We\nalready have those since we cloned the "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"example-processes"}]},{"type":"text","value":" repository."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Then we just need to define a name to that process and specify the\nmarketplace environment, where the new process should be created. We'll\nuse "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"\"cottagedays-daily-booking\""}]},{"type":"text","value":". Our final command for the\n"},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"cottagedays-dev"}]},{"type":"text","value":" marketplace would look like this:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"flex-cli process create --path"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"./flex-default-process --process"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-daily-booking --marketplace"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-dev"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"blockquote","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Note"}]},{"type":"text","value":": you need to modify the command to use your own dev\nmarketplace ID, which you can find from the Flex Console."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"After executing that command, you can go to the Flex Console (Build ->\nTransaction processes tab) and see that the\n"},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"\"cottagedays-daily-booking\""}]},{"type":"text","value":" process is there."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-wrapper"],"style":"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 635px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"a","properties":{"className":["gatsby-resp-image-link"],"href":"/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/be489/cottagedays-daily-booking-process.png","style":"display: block","target":"_blank","rel":["noopener"]},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 81.76100628930817%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAACXBIWXMAABYlAAAWJQFJUiTwAAAB8ElEQVQ4y61T22oUQRDtf/H64gV8MJoHb5hEkSgoCj4J+k8iooiJBEkQ9F/ckDW7MhvJzLjJ3Gd2uqe7j3TNJTOzREVsOFRP1anTVV09DAC01qhXUUiyPJ/hXxZb2/qCtxuf8ObDFuHV+494vb6Jl+82YGJrm5+xTrbcd+082Jmrd3Dp9iMsPX6OWw+fYenJCyzee4rTV1Zw8eYDnF28C8M5f30V566t4sKN+4RTCyvkqzknLi/j5MIy2NedXew7U0RxiiCMEUQJDrwAw7GF3e8TDEdWg+1vYwyGI2wPRxjsGDsmGN+g8jHTd5almE6nhMD34R0eIkli2ptYmiRI0+Tv7lApBc/zYFkWJpMJbMfB3t4P2LZD3/u2Dcd14bouOOdQSsPkmOEJIcC5oH1RFJBSgZkJS1lOtra/W4bffhXmkCzLMMtz8rOaoKSE1qpJKNH9RiOkG5TimionQVNm2cb/AeOigIFUQCE1zLueh27hOF4ZZ4IuVJKglBpStXFEpHjDQY93BFaTKbFOqlC0kpM0hagOrrmdgyp0BXswfi4kkjgqr0VwEj9ObE6wX53SwCznCAIfOZcIwwBRFKGT08ubE2xXl6QZQvM7+h48z0cc+hCFoiHIajB/rLDfrhEIwxAH05/Uunn8hVRN2/3OfgGC7qc/lA83DQAAAABJRU5ErkJggg=='); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"picture","properties":{},"children":[{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/82e29/cottagedays-daily-booking-process.webp 159w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/ef33f/cottagedays-daily-booking-process.webp 318w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/f1837/cottagedays-daily-booking-process.webp 635w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/29549/cottagedays-daily-booking-process.webp 953w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/c5420/cottagedays-daily-booking-process.webp 1270w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/97edb/cottagedays-daily-booking-process.webp 1660w"],"sizes":"(max-width: 635px) 100vw, 635px","type":"image/webp"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/8b9b5/cottagedays-daily-booking-process.png 159w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/fa108/cottagedays-daily-booking-process.png 318w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/53fb6/cottagedays-daily-booking-process.png 635w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/5a426/cottagedays-daily-booking-process.png 953w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/91155/cottagedays-daily-booking-process.png 1270w","/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/be489/cottagedays-daily-booking-process.png 1660w"],"sizes":"(max-width: 635px) 100vw, 635px","type":"image/png"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"src":"/docs/legacy/static/19d065a1769ca6308044f9035e0362b0/53fb6/cottagedays-daily-booking-process.png","alt":"CottageDays daily booking process created.","title":"CottageDays daily booking process created.","loading":"lazy","decoding":"async","style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;"},"children":[]},{"type":"text","value":"\n        "}]},{"type":"text","value":"\n  "}]},{"type":"text","value":"\n    "}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"create-process-alias","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#create-process-alias","ariaLabel":"create process alias permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Create process alias"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The process is created, but we still can't reference that process from\nour client app, since it doesn't have process alias set. We can create\nan alias for our new process with Flex CLI command:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"flex-cli process create-alias --process"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-daily-booking --version"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"element","tagName":"span","properties":{"className":["token","number"]},"children":[{"type":"text","value":"1"}]},{"type":"text","value":" --alias"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"release-1 --marketplace"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-dev"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"With that command, we are creating a new alias "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"\"release-1\""}]},{"type":"text","value":" and point\nit to the previously created process and its version 1."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"After that you should see the alias in the Console:"},{"type":"element","tagName":"br","properties":{},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"cottagedays-daily-booking/release-1"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"At this point, we have essentially just copied the default process under\na different name."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"modify-transaction-process","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#modify-transaction-process","ariaLabel":"modify transaction process permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Modify transaction process"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"One transition that should be considered carefully, is the operator's\nability to cancel a transaction. If the operator needs to cancel a\ntransaction in a certain state, there needs to be a transition defined\nfor it in the transaction process. Let's add a new operator transition\nto the process."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"pull-the-existing-transaction-process","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#pull-the-existing-transaction-process","ariaLabel":"pull the existing transaction process permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Pull the existing transaction process"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Before we modify our transaction process, it's better to ensure that we\nhave most the up-to-date version of the process. You can fetch any\nprocess version with flex-cli:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"flex-cli process pull --process"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-daily-booking --alias"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"release-1 --path"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"./cottagedays-daily-booking --marketplace"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-dev"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Now, we can open the "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"process.edn"}]},{"type":"text","value":" file from the new directory with a\ntext editor and inspect it a bit. You can get familiar with edn format\nby reading our\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/references/transaction-process-format/#the-edn-format"},"children":[{"type":"text","value":"reference document"}]},{"type":"text","value":"\nabout it."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"There's one existing cancel transition defined for operator in that\nfile. That cancel transition can be called when the transaction is in\nthe state: "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"accepted"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"clojure"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-clojure"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-clojure"]},"children":[{"type":"text","value":"  "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"{"}]},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":name"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":transition/cancel"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":actor"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":actor.role/operator"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":actions"}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"["}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"{"}]},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":name"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":action/cancel-booking"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"}"}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"{"}]},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":name"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":action/calculate-full-refund"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"}"}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"{"}]},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":name"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":action/stripe-refund-payment"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"}"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"]"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":from"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":state/accepted"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":to"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":state/cancelled"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"}"}]},{"type":"text","value":"\n"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Let's add another similar transition there:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"clojure"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-clojure"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-clojure"]},"children":[{"type":"text","value":"  "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"{"}]},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":name"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":transition/decline-preauthorized-by-operator"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":actor"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":actor.role/operator"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":actions"}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"["}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"{"}]},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":name"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":action/decline-booking"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"}"}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"{"}]},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":name"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":action/calculate-full-refund"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"}"}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"{"}]},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":name"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":action/stripe-refund-payment"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"}"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"]"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":from"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":state/preauthorized"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n   "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":to"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","symbol"]},"children":[{"type":"text","value":":state/declined-by-operator"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"}"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"With this configuration, we are creating a new transition called\n"},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":":transition/decline-preauthorized-by-operator"}]},{"type":"text","value":" for the operator.\nBecause it's called before the provider has accepted the booking, it's\nusing "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":":action/decline-booking"}]},{"type":"text","value":" instead of "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":":action/cancel-booking"}]},{"type":"text","value":".\nOtherwise, the actions are the same as in "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":":transition/cancel"}]},{"type":"text","value":". We\ncalculate refunds and refund the payment through Stripe. If you want to\ncheck all the possible actions, you should read this document:\n"},{"type":"element","tagName":"a","properties":{"href":"/docs/legacy/references/transaction-process-actions/"},"children":[{"type":"text","value":"Transaction process actions"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"extrainfo","properties":{"title":"What happens to the money in refunds?","id":"refund-extra-info"},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In the preauthorized state, the money hasn't left the customer's bank\naccount. There is just a cover reservation made for the future capture\nof the payment. This is done to avoid insufficient funds error. Stripe\ncan hold this preauthorization for 7 days and, therefore, we have an\nautomatic expiration in the preauthorized state."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In these declines and expire transitions,\n"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":":action/stripe-refund-payment"}]},{"type":"text","value":" will release the cover reservation,\nbut if it's called after the payment is captured, it will refund the\npayment. And to be more specific, then both transfers are reversed:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ol","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Commission (aka application fee) is returned from platform account to\nthe provider."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"Then full payment is returned from the provider's account to the\ncustomer."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The operator can call this transition from Console (from transaction\ncard's "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"Timeline"}]},{"type":"text","value":" column) or alternatively through Integration API. This\ntransition is only possible when a transaction is in the\n"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"preauthorized"}]},{"type":"text","value":" state. The last line\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":":to :state/declined-by-operator}"}]},{"type":"text","value":", creates actually a new state called\n"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"declined-by-operator"}]},{"type":"text","value":". It is going to be one of the final states for\nany transactions since there's no transition away from that state."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"push-a-new-transaction-process","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#push-a-new-transaction-process","ariaLabel":"push a new transaction process permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Push a new transaction process"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Updating a transaction process is a similar process than creating a new\none. This time we use "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"push"}]},{"type":"text","value":" command:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"flex-cli process push --process"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-daily-booking --path"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"./cottagedays-daily-booking --marketplace"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-dev"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"And if you go to Console, you notice that there's a new version (2)\ncreated of the "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"cottagedays-daily-booking"}]},{"type":"text","value":" process. However, the alias\nis still pointing to the first version. We need to update the alias too:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"flex-cli process update-alias --alias"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"release-1 --process"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-daily-booking --version"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"element","tagName":"span","properties":{"className":["token","number"]},"children":[{"type":"text","value":"2"}]},{"type":"text","value":" --marketplace"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"cottagedays-dev"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Now, if you open the process graph from the Flex Console, you'll see\nthat the new transition and state are visible in the updated version of\nthe process."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-wrapper"],"style":"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 635px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"a","properties":{"className":["gatsby-resp-image-link"],"href":"/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/a6db1/updated-process.png","style":"display: block","target":"_blank","rel":["noopener"]},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 61.63522012578617%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAMCAYAAABiDJ37AAAACXBIWXMAABYlAAAWJQFJUiTwAAABTUlEQVQoz51S2W6EMAzk/3+zUheCIQk5yTWVQym7VXer9sFMFAd7ZuyhVCCXBsYGwFoLpRRKbf3+zJ34Wwznw5QrrNmQUkKtDTXH3uAvxa6CDfA+YHx/w54KrI/YtMS2GcQ9/4/hnhKsMQdTF6CVhNb67wV92CFmwkwLaJ56LESI3jxI/h7Pmgz3A3HOYxYjiAS0Vsg5I5fa87UdbxhfMR74w7I247BKBWbMslMuyDkhp4gcfbfDGAdr/UumvaDzAdMkQMuKEPeLRT2x9VUicYOUGqUAtT4yPfEo6DyU1j2cC5dvn7uYQsMmLeSqsBmDsEeE/VBy7/GDh/dx3oWQIGeN6AtolFhJd2u48W28YSbCJASk0n2obN3wdIp9NyMkaaRSEEPCIi5LOMc2SLXCGNv390vyT+y4G+8jSepn/oHl8pkLOh+ht2NQjKf8DyuRrC6A2cv6AAAAAElFTkSuQmCC'); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"picture","properties":{},"children":[{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/82e29/updated-process.webp 159w","/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/ef33f/updated-process.webp 318w","/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/f1837/updated-process.webp 635w","/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/29549/updated-process.webp 953w","/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/254eb/updated-process.webp 1040w"],"sizes":"(max-width: 635px) 100vw, 635px","type":"image/webp"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/8b9b5/updated-process.png 159w","/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/fa108/updated-process.png 318w","/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/53fb6/updated-process.png 635w","/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/5a426/updated-process.png 953w","/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/a6db1/updated-process.png 1040w"],"sizes":"(max-width: 635px) 100vw, 635px","type":"image/png"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"src":"/docs/legacy/static/7e5225317ba58327a2a3dd198c5d0888/53fb6/updated-process.png","alt":"Updated process.","title":"Updated process.","loading":"lazy","decoding":"async","style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;"},"children":[]},{"type":"text","value":"\n        "}]},{"type":"text","value":"\n  "}]},{"type":"text","value":"\n    "}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Here's a screenshot of the transaction card in the Flex Console. It\nshows a transaction in the preauthorized state - the decline link for\nthe marketplace operator is on the right-side column."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-wrapper"],"style":"position: relative; display: block; margin-left: auto; margin-right: auto; max-width: 635px; "},"children":[{"type":"text","value":"\n      "},{"type":"element","tagName":"a","properties":{"className":["gatsby-resp-image-link"],"href":"/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/91155/decline-preauthorized-by-operator.png","style":"display: block","target":"_blank","rel":["noopener"]},"children":[{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["gatsby-resp-image-background-image"],"style":"padding-bottom: 77.9874213836478%; position: relative; bottom: 0; left: 0; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAACXBIWXMAABYlAAAWJQFJUiTwAAABsElEQVQ4y4VUi27DIAzM///mpE1tE/IiAdvATXZCmnbZhnQCWuPc2QdNjBEhBBARdJRSDHXUdUoJ67pabM75JfZ8pmFmVJwTvCfUJJpMUX8rO7a4LbYZhgHjOL4G/jKnDLAkqKoYA4TjDjpSN23bQqEM3ukf+51C3veRE+4joZ0YXz3tawFJeUo+M3yXXjY9m8RSICmBJGFYGB9tQO/ZPqLsjeHtdjPZCuecJb8quiZUliqZiUD0lExWhohGuysi25dFjO25i++d1//0oMZejcb75UdnL9mdEqp9qoUqqv2aUwr8Ncq5hiKHih8M3TDDDROmeQVJBhuKrSNvkPR0XEoZ8zzDe7/bZ4OWzmp4HxkK5wXDkmzuvZgNbiMbpjW9mFdvjTK8QsO0QgwBHNd/JaecjV1tXk2us92Uxxjx6QJ0vo8R3SwHY10ru1xeLpnVUIRtJrMPHZ1vrFakdtkOprzVj1Oxeuq+dlhLMswrnOvQ9z26rjs8ezSlfdzR9hMevce4CALlS7nKTJMzi0lelsXmapv6uJixlVHgAh8TAv/+NCnrNRDC7kH14vmV0jp+A9LP6qhitHNZAAAAAElFTkSuQmCC'); background-size: cover; display: block;"},"children":[]},{"type":"text","value":"\n  "},{"type":"element","tagName":"picture","properties":{},"children":[{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/82e29/decline-preauthorized-by-operator.webp 159w","/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/ef33f/decline-preauthorized-by-operator.webp 318w","/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/f1837/decline-preauthorized-by-operator.webp 635w","/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/29549/decline-preauthorized-by-operator.webp 953w","/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/c5420/decline-preauthorized-by-operator.webp 1270w"],"sizes":"(max-width: 635px) 100vw, 635px","type":"image/webp"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"source","properties":{"srcSet":["/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/8b9b5/decline-preauthorized-by-operator.png 159w","/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/fa108/decline-preauthorized-by-operator.png 318w","/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/53fb6/decline-preauthorized-by-operator.png 635w","/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/5a426/decline-preauthorized-by-operator.png 953w","/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/91155/decline-preauthorized-by-operator.png 1270w"],"sizes":"(max-width: 635px) 100vw, 635px","type":"image/png"},"children":[]},{"type":"text","value":"\n          "},{"type":"element","tagName":"img","properties":{"className":["gatsby-resp-image-image"],"src":"/docs/legacy/static/243e67b5fdaa3dd1e1a5d3b74a26b7fc/53fb6/decline-preauthorized-by-operator.png","alt":"Operator's decline transition in Console.","title":"Operator's decline transition in Console.","loading":"lazy","decoding":"async","style":"width:100%;height:100%;margin:0;vertical-align:middle;position:absolute;top:0;left:0;"},"children":[]},{"type":"text","value":"\n        "}]},{"type":"text","value":"\n  "}]},{"type":"text","value":"\n    "}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h2","properties":{"id":"update-client-app","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#update-client-app","ariaLabel":"update client app permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Update client app"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"After we have changed the transaction process, we also need to take the\nnew process into use in our client app."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In this tutorial, we assume that we don't need to care about ongoing\ntransactions. It is important to consider this before taking a new\nprocess version into use. When a transaction is created, it is tied to\nthe version of the process that was in use at that time. Therefore, you\nmight need to update your client app, so that it supports several\ndifferent process versions."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"extrainfo","properties":{"title":"FTW-product has different transaction process, configs, and dir structure."},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"FTW-product's config.js has been moved into "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"src/config/config.js"}]},{"type":"text","value":" and\nsome of the process related configs have been changed. E.g.\nbookingProcessAlias is renamed as "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"transactionProcessAlias"}]},{"type":"text","value":" and\nbookingUnitType is renamed as "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"lineItemUnitType"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"FTW-product has a different transaction process graph compared to\nFTW-daily. This means that rest of this tutorial is not really\napplicable on top of FTW-product."}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"update-configjs","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#update-configjs","ariaLabel":"update configjs permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Update config.js"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"└── src\n    └── config.js"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Since we have created a new process, we need to update\n"},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"bookingProcessAlias"}]},{"type":"text","value":" variable in config.js. This variable defines\nwhat transaction process is used when a new transaction is created from\nthe web app."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"js"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" bookingProcessAlias "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"'cottagedays-daily-booking/release-1'"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In the same file, we need to also update variable: "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"bookingUnitType"}]},{"type":"text","value":".\nIt defines some UI changes (mostly about microcopy) - i.e. is this\nbooking about "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"nights"}]},{"type":"text","value":", "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"days"}]},{"type":"text","value":", or some other "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"units"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"js"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" bookingUnitType "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"'line-item/day'"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"update-transactionjs","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#update-transactionjs","ariaLabel":"update transactionjs permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Update transaction.js"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The web app needs to understand how the connected transaction process\nworks and, therefore, the process graph is actually duplicated in the\ncurrent versions of FTW templates."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"└── src\n    └── util\n        └── transaction.js"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"So, we need to make the transaction process change also there."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Step 1"}]},{"type":"text","value":": Create a new transition variable:\n"},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"TRANSITION_DECLINE_BY_OPERATOR"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"js"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","comment"]},"children":[{"type":"text","value":"// When the provider accepts or declines a transaction from the"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","comment"]},"children":[{"type":"text","value":"// SalePage, it is transitioned with the accept or decline transition."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"export"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_ACCEPT"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"'transition/accept'"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"export"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_DECLINE"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"'transition/decline'"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]},{"type":"text","value":"\n\n"},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"export"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_DECLINE_BY_OPERATOR"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":"\n  "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"'transition/decline-preauthorized-by-operator'"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Step 2"}]},{"type":"text","value":": Create a new state variable: "},{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"STATE_DECLINED_BY_OPERATOR"}]},{"type":"text","value":"."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"js"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"STATE_DECLINED"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"'declined'"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"STATE_DECLINED_BY_OPERATOR"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"'declined-by-operator'"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Step 3"}]},{"type":"text","value":": Update the process graph."},{"type":"element","tagName":"br","properties":{},"children":[]},{"type":"text","value":" Variable "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"stateDescription"}]},{"type":"text","value":"\ncontains the same process graph in "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"Xstate"}]},{"type":"text","value":" format. As a first thing,\nyou could also update the id of the graph."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The mandatory change is that we need to add the new state and transition\ninto that process description:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"diff"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-diff"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-diff"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","unchanged"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","prefix","unchanged"]},"children":[{"type":"text","value":" "}]},{"type":"text","value":"   [STATE_PREAUTHORIZED]: {\n"},{"type":"element","tagName":"span","properties":{"className":["token","prefix","unchanged"]},"children":[{"type":"text","value":" "}]},{"type":"text","value":"     on: {\n"},{"type":"element","tagName":"span","properties":{"className":["token","prefix","unchanged"]},"children":[{"type":"text","value":" "}]},{"type":"text","value":"       [TRANSITION_DECLINE]: STATE_DECLINED,\n"}]},{"type":"element","tagName":"span","properties":{"className":["token","inserted-sign","inserted"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","prefix","inserted"]},"children":[{"type":"text","value":"+"}]},{"type":"text","value":"       [TRANSITION_DECLINE_BY_OPERATOR]: STATE_DECLINED_BY_OPERATOR,\n"}]},{"type":"element","tagName":"span","properties":{"className":["token","unchanged"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","prefix","unchanged"]},"children":[{"type":"text","value":" "}]},{"type":"text","value":"       [TRANSITION_EXPIRE]: STATE_DECLINED,\n"},{"type":"element","tagName":"span","properties":{"className":["token","prefix","unchanged"]},"children":[{"type":"text","value":" "}]},{"type":"text","value":"       [TRANSITION_ACCEPT]: STATE_ACCEPTED,\n"},{"type":"element","tagName":"span","properties":{"className":["token","prefix","unchanged"]},"children":[{"type":"text","value":" "}]},{"type":"text","value":"     },\n"},{"type":"element","tagName":"span","properties":{"className":["token","prefix","unchanged"]},"children":[{"type":"text","value":" "}]},{"type":"text","value":"   },\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","unchanged"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","prefix","unchanged"]},"children":[{"type":"text","value":" "}]},{"type":"text","value":"   [STATE_DECLINED]: {},\n"}]},{"type":"element","tagName":"span","properties":{"className":["token","inserted-sign","inserted"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","prefix","inserted"]},"children":[{"type":"text","value":"+"}]},{"type":"text","value":"   [STATE_DECLINED_BY_OPERATOR]: {},"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"Step 4"}]},{"type":"text","value":": Update relevant helper functions."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"txIsDeclined"}]},{"type":"text","value":" needs to be updated"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"js"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" transitionsToDeclined "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"["}]},{"type":"text","value":"\n  "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"..."}]},{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"getTransitionsToState"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"("}]},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"STATE_DECLINED"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":")"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n  "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"..."}]},{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"getTransitionsToState"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"("}]},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"STATE_DECLINED_BY_OPERATOR"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":")"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"]"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"export"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","function-variable","function"]},"children":[{"type":"text","value":"txIsDeclined"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","parameter"]},"children":[{"type":"text","value":"tx"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"=>"}]},{"type":"text","value":"\n  transitionsToDeclined"},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"."}]},{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"includes"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"("}]},{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"txLastTransition"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"("}]},{"type":"text","value":"tx"},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":")"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":")"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"isRelevantPastTransition"}]},{"type":"text","value":" needs to be updated too"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"js"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","comment"]},"children":[{"type":"text","value":"// Check if a transition is the kind that should be rendered"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","comment"]},"children":[{"type":"text","value":"// when showing transition history (e.g. ActivityFeed)"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","comment"]},"children":[{"type":"text","value":"// The first transition and most of the expiration transitions made by system are not relevant"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"export"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","function-variable","function"]},"children":[{"type":"text","value":"isRelevantPastTransition"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","parameter"]},"children":[{"type":"text","value":"transition"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"=>"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"{"}]},{"type":"text","value":"\n  "},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"return"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"["}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_ACCEPT"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_CANCEL"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_COMPLETE"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_CONFIRM_PAYMENT"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_DECLINE"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_DECLINE_BY_OPERATOR"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_EXPIRE"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_REVIEW_1_BY_CUSTOMER"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_REVIEW_1_BY_PROVIDER"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_REVIEW_2_BY_CUSTOMER"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n    "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_REVIEW_2_BY_PROVIDER"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]},{"type":"text","value":"\n  "},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"]"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"."}]},{"type":"element","tagName":"span","properties":{"className":["token","function"]},"children":[{"type":"text","value":"includes"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"("}]},{"type":"text","value":"transition"},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":")"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":"}"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"update-components","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#update-components","ariaLabel":"update components permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Update components"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Now, the last and most important step is to go through all the\ncomponents that import 'util/transaction'. I.e. we need to figure out if\nthose components need to be updated so that they can handle the changed\nprocess."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"In this tutorial, we'll just update "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"ActivityFeed"}]},{"type":"text","value":" component, which is\nshown on the transaction page."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"└── src\n    └── components\n        └── ActivityFeed\n            └── ActivityFeed.js"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The new transition needs to be "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"imported"}]},{"type":"text","value":" there and then a new microcopy\nkey should be added into "},{"type":"element","tagName":"strong","properties":{},"children":[{"type":"text","value":"resolveTransitionMessage"}]},{"type":"text","value":" function:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"js"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-js"]},"children":[{"type":"text","value":"    "},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"case"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","constant"]},"children":[{"type":"text","value":"TRANSITION_DECLINE_BY_OPERATOR"}]},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":":"}]},{"type":"text","value":"\n      "},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"return"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"<"}]},{"type":"text","value":"FormattedMessage id"},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"\"ActivityFeed.operatorDecline\""}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"/"}]},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":">"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"We'll add the microcopy key and value to "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"src/translations/en.json"}]},{"type":"text","value":"\nfile:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"json"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-json"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-json"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","property"]},"children":[{"type":"text","value":"\"ActivityFeed.operatorDecline\""}]},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":":"}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"\"The booking was cancelled.\""}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":","}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"h3","properties":{"id":"update-pricing-on-server","style":"position:relative;"},"children":[{"type":"element","tagName":"a","properties":{"href":"#update-pricing-on-server","ariaLabel":"update pricing on server permalink","className":["anchor","before"]},"children":[{"type":"element","tagName":"svg","properties":{"ariaHidden":"true","focusable":"false","height":"16","version":"1.1","viewBox":"0 0 16 16","width":"16"},"children":[{"type":"element","tagName":"path","properties":{"fillRule":"evenodd","d":"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"},"children":[]}]}]},{"type":"text","value":"Update pricing on server"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"When privileged transitions are used, the pricing changes should be made\nfrom a trusted environment. In FTW-daily template, that means the\nincluded server."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"shell"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-shell"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-shell"]},"children":[{"type":"text","value":"└── server\n    └── api-util\n        └── lineItems.js"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"Our changes didn't bring any new line-items, but it changed the existing\nbooking unit type from "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"night"}]},{"type":"text","value":" to "},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"day"}]},{"type":"text","value":". Therefore, we need to update\n"},{"type":"element","tagName":"em","properties":{},"children":[{"type":"text","value":"bookingUnitType"}]},{"type":"text","value":" there too:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"js"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-js"]},"children":[{"type":"element","tagName":"span","properties":{"className":["token","comment"]},"children":[{"type":"text","value":"// This bookingUnitType needs to be one of the following:"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","comment"]},"children":[{"type":"text","value":"// line-item/night, line-item/day or line-item/units"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"span","properties":{"className":["token","keyword"]},"children":[{"type":"text","value":"const"}]},{"type":"text","value":" bookingUnitType "},{"type":"element","tagName":"span","properties":{"className":["token","operator"]},"children":[{"type":"text","value":"="}]},{"type":"text","value":" "},{"type":"element","tagName":"span","properties":{"className":["token","string"]},"children":[{"type":"text","value":"'line-item/day'"}]},{"type":"element","tagName":"span","properties":{"className":["token","punctuation"]},"children":[{"type":"text","value":";"}]}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"extrainfo","properties":{"title":"Update your email notifications"},"children":[{"type":"text","value":"\nTo keep showing the line items on your email notifications, you will need to replace\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"html"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-html"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-html"]},"children":[{"type":"text","value":"{{#eq \"line-item/night\" code}}"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"with"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"div","properties":{"className":["gatsby-highlight"],"dataLanguage":"html"},"children":[{"type":"element","tagName":"pre","properties":{"className":["language-html"]},"children":[{"type":"element","tagName":"code","properties":{"className":["language-html"]},"children":[{"type":"text","value":"{{#eq \"line-item/day\" code}}"}]}]}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"in your email notification templates. The next step in the tutorial\ndeals with updating email notifications."}]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"The email templates that list the full line items in the default\ntransaction process are"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"ul","properties":{},"children":[{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"new-booking-request"}]},{"type":"text","value":" (to provider)"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"booking-request-accepted"}]},{"type":"text","value":" (to customer)"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"li","properties":{},"children":[{"type":"element","tagName":"code","properties":{},"children":[{"type":"text","value":"money-paid"}]},{"type":"text","value":" (to provider)"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"}]},{"type":"text","value":"\n"},{"type":"element","tagName":"hr","properties":{},"children":[]},{"type":"text","value":"\n"},{"type":"element","tagName":"p","properties":{},"children":[{"type":"text","value":"And that's it. We have created a new process, added a new transition\nthere and modified our client app to work with the new process."}]}],"data":{"quirksMode":false}},"headings":[{"value":"Create a transaction process","depth":2},{"value":"Clone Flex example processes repository","depth":3},{"value":"Create a new process","depth":3},{"value":"Create process alias","depth":3},{"value":"Modify transaction process","depth":2},{"value":"Pull the existing transaction process","depth":3},{"value":"Push a new transaction process","depth":3},{"value":"Update client app","depth":2},{"value":"Update config.js","depth":3},{"value":"Update transaction.js","depth":3},{"value":"Update components","depth":3},{"value":"Update pricing on server","depth":3}]}},"pageContext":{"slug":"create-transaction-process","category":"tutorial-transaction-process"}},
    "staticQueryHashes": ["3794076007","439097193","717698143"]}