Process Flow

    sequenceDiagram

    autonumber
    
    actor m as Merchant
    participant l as Liberis
    participant p as Payment Processor

    m ->> l : Signs contract
    l -->>l: Create MPA (if necessary)
    l -->>l: Add split Payment Method to the MPA
    l -)+ p : Validate action required
    p ->> p : Checks that they can apply the split
    p --)- l : Validate action successful
    l -->>l: Complete pre-funding checks
    l ->> m : Funds disbursed
    Note over l,m: Pay with Liberis would<br>go to the shop instead
    l -)+ p : Start action required
    p ->> p : Stores split % and accountId<br> against this merchant
    p --)- l : Start action successful
		loop Daily Settlements
    	p -->>+ p : Start merchant settlement process
      p -->> l : Get balance
    	p -->> p : Calculate split amount
    	p ->> l : Pay split amount to Liberis
    	p ->> m : Pay remainder directly to Merchant
    	p -->> l : Submit settlement amounts to Settlement API 
      p -->>- p : Merchant settlement complete
    end
    l -->> l : Contract amount fully paid
    l -)+ p : Finish action required
    p ->> p : Remove split
    p --)- l: Finish action successful