GithubHelp home page GithubHelp logo

isabella232 / subscription-workflow-project-template-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from temporalio/subscription-workflow-project-template-php

0.0 0.0 0.0 16.16 MB

Subscription Workflow Project Template for PHP

PHP 100.00%

subscription-workflow-project-template-php's Introduction

Subscription Workflow Project Template in PHP

This project template illustrates the design pattern for subscription style business logic.

Setup

Run the Temporal Server:

git clone https://github.com/temporalio/docker-compose.git
cd docker-compose
docker-compose up

Start the RoadRunner Server:

composer install
./rr serve

Start

Start the Workflow Execution for a single customer with the Id of "Id-0".

php app.php subscription

Get billing info

You can Query the Workflow Execution for the customer's billing information. The current billing period and the charge amount will be returned.

php app.php querybillinginfo  

Run this multiple times to see the billing period number and charge amount change over the course of the Workflow Execution.

Update billing

You can also send a Signal to the Workflow Execution to update the billing cycle cost to 300.

php app.php updatecharge

Cancel subscription

You can send a Signal to the Workflow Execution to cancel the subscription. The Workflow Execution will complete after the current billing period.

php app.php cancelsubscription

After running this, check out the Temporal Web UI to see that the Workflow Execution has a "Completed" status.

subscription-workflow-project-template-php's People

Contributors

flossypurse avatar tsurdilo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.