How to implement 'Pay based on usage' payment method to your product's check out page

1. Download DePlan logo to place it on your product's check out page

2. Name a new payment method 'DePlan' or 'Pay based on usage'

Add DePlan logo and add text below:

Deposit monthly fee into smart-contract escrow.

Use the product and control usage.

Get refunded at the end of the month depending on usage.

View examples bellow

3. Go to https://product.deplan.xyz and create an account on DePlan Connect. This will be your personal account as a developer.

Creating an accout on DePlan Connect

Watch video below how to create account on DePlan Connect

4. While in your account add your Product

  • Create ID of your product (product_username)

  • Add Product Name

  • Add Product Logo

  • Add website with info about the product

  • Provide price per month

  • Provide the link to the product itself

Make sure you provided the link to the product and website with the product's info

When you’re done press ‘Next’

Creating a Product on DePlan Connect

Watch video below how to add you product on DePlan Connect

5. Now your project is on blockchain. It has its own wallet that is connected to your personal developer’s account wallet on blockchain.

Your product on DePlan. Product's wallet and your developer's account wallet

6. Come up with events relevant to your product that will be used to calculate intensity of usage of your product

Examples:

  • Upload data

  • Download data

  • Play content

  • Save content

  • Export file

  • Import file

  • View content

  • Open project

  • Create project

  • AI request

  • Time

or others

  1. Provide us with a webhook url that will be called once user confirmes subscription, the endpoint has to accept POST requests with "application/json" content type. It will be passed your custom data and "deplanUserWallet" string in the body

  2. When user chooses DePlan as a subscription method, you should navigate them to https://deplan.app?orgId=&redirectUrl=&data=

    Params

    orgWallet - wallet address of your organization from step 6

    redirectUrl - where to redirect a user once they have confirmed subscription in DePlan

    data - custom key/value pairs data as JSON string, that will be passed to your webhook, e.g. a user id in your system, so that you can identify the user and set their "deplanUserWallet"

  3. Now your user is connected with their account in DePlan and you can save events by making a POST request to https://deplan-560eb4c67350.herokuapp.com/events

    Request body

    orgWallet - wallet address of your organization from step 6

    userWallet - deplanUserWallet string

    typeEvent - event name string

Last updated