# Payments Flows
- UML diagrams
```sequence
BU->Payment: Create Payment Intent
Note right of BU: User/Order/Amount information
Payment->Payment: Create a Payment Intent
Payment->BU: Success
BU->Payment: GET Payment Options
Payment->BU: Return Supported Payment Options
Note left of BU: Provide Payment options to users
BU->Payment: GET Payment Methods for {USERID}
Payment->BU: Return Saved Payment Methods for User
Note left of BU: Provide Saved Cards to User
BU->Payment: Update Payment Intent Method
Payment->Payment: Update PIM
Payment->BU: Success
BU->Payment: COMMIT Payment Intent
Payment->Payment: External Calls to PSP (Optional)
Payment->BU: Success
BU->Payment: AUTHORIZE Payment Intent (only for a 2 step CC)
Payment->Payment: External Calls to PSP (Optional)
Payment->BU: Success
BU->Payment: CHARGE Payment Intent (only for a 2 step CC)
Payment->Payment: External Calls to PSP
Payment->BU: Success
BU->Payment: REFUND/REVERSE Payment Intent (only for a 2 step CC)
Payment->Payment: External Calls to PSP
Payment->BU: Success
BU->Payment: GET Payment Intent Status
Payment->BU: Payment Intent Details
```
Payment Intent -> Core Payments
Payment Intent Method -> Create/Update
Update Payment Intent Method??
Payment Option -> Credit Card (Ext. OR CMR), Debit Card, Wallet
Payment Method -> Saved card or gift card or wallet ID
e.g. Visa card ending with 1234 belongs to patty
PSP -> Fpay, Quickpay, Transbank, RTL, Servipag
Land on payments page -> Create Payment Intent
GET Payment Options -> Allows to create tabs/sections
GET Payment Method -> Allows you to show saved cards
Select a payment option -> Create/Update Payment Intent Method (payment option - CMR CC)
Choosing a add a CMR CC -> Request for Card capture -> render URL -> user enters card information goes directly to Fpay -> PSP saves this information & sends a token -> Catalyst will treat the token as the card number -> Create a payment method
Attach Payment Method (CMR CC for Patty) to Payment Intent Method
CMR Price
CMR + Instalments
Commerce - ID
Payment Intent->Payment Intent Method (gift Card) + Payment Intent Method (CMR CC) -> Payment Method
Tenant COnfiguration -> Tenant ID (FACL), Payment Option (CMR CC), Channel (WEB), Site (Falabella), Fpay
Commit -> user click the "pay" button -> Status is "COMMITTED"
Cancel
Authorize -> "blocks" amount on user's card, returns an approval code -> Status is "AUTHORIZED"
Refund
Charge -> Marks the "blocked" money to "ready for settlement" -> Status is "CHARGED"
Refund -> Status is "REFUNDED"
Primary - Gift Card, CMR points, Wallet Balance
Secondary : CMR CC, EXt CC, Debit
###### tags: `PaymentsFlow`