Sending Payment Obligations to Stripe
This tutorial shows you how to create a Stripe Action for any Smart Clause® that emits a Payment Obligation.
No programming skills are required for this tutorial, however you will need a Stripe account.
First, please complete the
Full Payment on Signature tutorial.
1. Add a Perishable Goods Smart Clause
Create a new contract and then add the Perishable Goods smart clause (one of the advanced clauses) to your contract. If you view the details of the template for the smart clause you will see that the logic for the template emits a Payment Obligation.
3. Add a Custom Stripe action
In the Action Type dropdown select the Custom option, then select Stripe as the Target.
Use the following Connection Configuration Transformation
4. Request Signatures and Trigger the Contract
You can now add signatories, sign the contract and then trigger the clause via an HTTP POST. Note that you can trigger the smart clause when the contract is in the DRAFTING state however payment obligations will only be sent to Stripe when the contract is in the RUNNING state.
You can view the JSON body for the HTTP POST for the smart clause by viewing the details for the clause in the Accord Project template library. You can navigate to the library by viewing the details of the smart clause and then pressing the View in Accord Project Template Library link.
Every time the smart clause is triggered with a org.accordproject.perishablegoods.ShipmentReceived transaction you will see a new payment (in the "Payments" tab on the left) in your Stripe Dashboard.