Overview of Payments in Fluent
Author:
Matt Salmon
Changed on:
9 Dec 2024
Overview
- Fluent Order Management enables the management of payments throughout the lifecycle of an Order.
- Build custom payment logic into the Order workflow using the OMX Workflow Framework and provided entities.
- This document provides an overview of the Payment Data Model and GraphQL API capabilities and does not include any reference Rules, Workflows, or UX Components.
Key points
- Pre-requistes
- Data Model
- Entities
- Explanation of the Entity Relationships through an Example
- Relationship details
- GraphQL queries required for Payments
Pre-requisites
You must have knowledge of how the Workflow Framework works.
Data Model
The following data model is the global entity data model which shows where the Payments solution sits in the Fluent platform.
The following data model outlines the entities available to manage payments.
Entities
These are the entities involved in the Payment orchestration domain.
Entity | Description |
| Represents the sales order for a customer |
| A pool of funds available in order to pay for an order |
| A plan to move items in order to deliver on a promise made to a customer |
| Represents the process of capturing or refunding part or all of a financial transaction |
| A log of activities that have occurred whilst processing a payment through its lifecycle |
| The source of record for a group of financial operations relating to a customer |
| The document representing the itemised charge to a customer for the supply of goods |
| A memorandum issued to indicate a change in an orders sale price |
Explanation of the Entity Relationships through an Example
The following use case explains the relationship between different entities in the Payments domain.
High-level example
This example serves as a practical walkthrough of how the entities related to payments are intended to be used to capture funds throughout the lifecycle of an order.
- A customer ordered 3 items from an electronic store. The items are a Laptop for $1500, a TV for $1000 and a Speaker for $500. A total of $3000.
- The order was paid for with 2 transactions. $500 via gift voucher and the remaining $2500 with a credit card.
- The order was then split and fulfilled at 2 separate locations which means 2 shipments were sent to the customer's delivery address.
Entity relationships for the above example
- When an is created using the
`Order`
query, 2`createOrder`
are created with the status`FinancialTransactions`
. 1 with the`CREATED`
"CREDITCARD" and another with "GIFTVOUCHER".`paymentMethod`
- Given the order needs to be split, two should then be created by the
`Fulfilments`
query.`createFulfilment`
- Fulfillments are processed which includes picking and packing of fulfillment items.
- Payments are captured once corresponding fulfillments are shipped.
- contains a TV that is $1000 and is paid through a CREDITCARD (Payment 1) using the
`Fulfilment 1`
query.`createPayment`
- The status of the with the
`FinancialTransaction`
CREDITCARD changes to`paymentMethod`
by`PARTIALLY_CAPTURED`
query to reflect the fact the remaining funds have not been captured yet.`updateFinacialTransaction`
- The status of the
- contains a Laptop and a Speaker for $2000 and is partially paid with the remaining authorised funds on the
`Fulfilment 2`
with`FinancialTransaction`
CREDITCARD (Payment 2) and the remaining outstanding amount via the other`paymentMethod`
where the`FinancialTransaction`
is GIFTVOUCHER (Payment 3) using`paymentMethod`
query.`createPayment`
- The status of both FinancialTransaction becomes at this point using the updateFinancialTransaction query.
`CAPTURED`
- The status of both FinancialTransaction becomes
- Multiple will be created for each
`PaymentTransactions`
using the`payment`
query containing the`createPaymentTransaction`
log for each payment. For example, credit card`status`
, or credit card`PENDING`
.`CAPTURED`
- Once all the payments are captured, 1 invoice is generated using the query for each
`createInvoice`
and is sent to the customer.`fulfilment`
Relationship details
Entity relationships related to payments are documented below.
Name | Relationship Type | Comment |
Customer_Order | Zero-Many | A customer can place many orders at different times, so one
|
Customer_BillingAccount | Zero-Many | A customer can create many accounts each having its own account details so, one
|
Order_Fulfilment | Zero-Many | An Order can be split into many fulfillments due to different fulfilments being fulfilled from different locations or at different times, so 1
|
Order_BillingAddress | Zero-One | A customer can optionally add a billing address while ordering items from a store, so an
|
Order_Invoice | Zero-Many | An Order can have many invoices through the relationship of a fulfillment. An order can have multiple fulfillments and each fulfillment will have an invoice, so one
|
BillingAccount_BillingAddress | Zero-One | A customer can have one address per account so, a
|
FinancialTransaction_Payment | Zero-Many | A financial transaction can have multiple payment methods such as a Credit Card and a Gift Card, so a
|
Fulfilment_Payment | Zero-Many | A customer can pay for fulfillment through multiple payment methods such as a gift card and a credit card, so a
|
Payment_PaymentTransaction | One-Many | A payment will go through different stages such as authorised, captured, failure etc. Each stage is recorded as a payment transaction so, 1
|
Order_ReturnOrder | Zero-Many | A customer may want to return different items of order at different times hence creating multiple return orders for each item, so 1
|
ReturnOrder_CreditMemo | One-One | When an order is returned, or exchange happens, a credit memo is generated for the return order, so 1
|
BillingAcount_CreditMemo | Zero-Many | There can be multiple transactions, adjustments or refunds involved with a customer’s billing account. Each transaction or adjustment generates a new credit memo so, 1
|
CreditMemo_Payment | Zero-Many | If the initial payment was made by a credit card and PayPal account by a customer, the respective amount will be paid back to each of the payment methods so, one
|
GraphQL queries required for Payments
The following queries are required to build a Payment solution:
Query | Description |
| Creates a new
|
| Creates a new
|
| Creates a new
|
| Creates a new
(Financial Transactions can also be created here using
|
| Creates a
|
| Creates a
|
| Updates the status of the
|
| Creates a new
|
| Updates a
|
| Creates a
|
| Creates a new
|
| Creates a new
|
| Creates a new
|
You can find all the GraphQL queries related to Payments here(deprecated).