Create sequence diagrams with simple online tool

Swimlanes.io is a free webapp for making sequence diagrams. You simply edit the text on the left and the diagram is updated in real time. You can download your sequence diagrams as images or distribute with a link.

Title: Braintree Venmo Flow note: Deposits/payments are via Braintree SDK while Withdrawals/payouts are via the PayPal Payouts API =: Player logs into their merchant account If: First time deposit flow Player -> Merchant Cashier: Player chooses to make a Deposit with Venmo Merchant Cashier -> Braintree Client SDK: Render Payment Experience and Initialize component note Client (Player), RMG Merchant Server:* [Venmo Overview](https://developers.braintreepayments.com/guides/venmo/overview) * Use [Tokenization key](https://developer.paypal.com/braintree/docs/guides/authorization/tokenization-key/javascript/v3) to initiate the JS SDK * Merchant will be using [JS SDK](https://developers.braintreepayments.com/guides/venmo/client-side/javascript/v3#custom-integration) to render Venmo button on Desktop and Mobile Web flows * Merchant will be using JS SDK with Webviews to render Venmo button in MerchantĀ“s iOS & Android apps. Make sure to use pop-up bridge option for webviews to work as expected. * [PopupBridge iOS](https://github.com/braintree/popup-bridge-ios) * [PopupBridge Android](https://github.com/braintree/popup-bridge-android) **Note:** * VenmoPaymentMethodUsage option has to be set to [MultiUse](https://developer.paypal.com/braintree/docs/guides/venmo/client-side#payment-method-usage) on the client side (available in v3.77.0+). * Also make sure to collect device data using [Device Data collector component](https://developers.braintreepayments.com/guides/premium-fraud-management-tools/device-data-collection/javascript/v3) _: Player Clicks on Venmo button and authorizes Merchant for payment Braintree Client SDK --> Merchant Cashier: Fetch Payload containing Nonce, First & Last name, Phone number, email, external id & Venmo username Merchant Cashier -> PXP: Send Nonce, Device Data & Player Details note: [VenmoEnrollment request] * MerchantID * clientSystemUserEnrollmentid * type = account.venmo * userId * accountNumber (nonce) PXP -> Braintree: Create Customer note: [createCustomer Mutation](https://graphql.braintreepayments.com/reference/#Mutation--createCustomer) * PXP to pass all available customer information ( first name, last name, device data, email, phone number & nonce ) * PXP to include Player ID to maintain the same player ID mapped to the customer id in Braintree vault Braintree --> PXP: Create Customer Response note: [createCustomer Payload](https://graphql.braintreepayments.com/reference/#object--createcustomerpayload) * PXP to store Customer ID and use it in the Vault Payment Method Mutation PXP -> Braintree: Vault Payment Method note: [VaultPaymentMethod Mutation](https://graphql.braintreepayments.com/reference/#Mutation--vaultPaymentMethod) * PXP to pass Customer ID & Payment Method Nonce Braintree --> PXP: Vault Payment Method Response note:[vaultPaymentMethod Payload](https://graphql.braintreepayments.com/reference/#object--vaultpaymentmethodpayload) **PXP to store Payment method token and Venmo User ID (used for withdrawals) in the Payment Account** * The PXP payment account is used for the Venmo deposit (Payment Method Token is sent in the AuthorizeVenmoAccount Mutation) + The PXP payment account is used for the Venmo Withdrawal (payout is sent to VenmoUserID) PXP --> Merchant Cashier: Send Venmo User ID to Merchant Merchant Cashier -> Merchant Cashier: Merchant runs risk checks using Venmo User ID and the data fetched from payload If: If risk check successful Merchant Cashier -> PXP: If risk check successful, proceed with payment/deposit: send initiatePayment for VenmoDeposit note: [initiatePayment for VenmoDeposit] * MerchantID, shopID, merchantTransactionID * paymentMethodId * Amount, currency * UserID, userIP, userSessionID * CreationType * specificPaymentData: CollectedDeviceData - device data hash collected from device data component on client side * PaymentAccountID PXP -> Braintree: Authorize Venmo Transaction note: [AuthorizeVenmoAccount Mutation](https://graphql.braintreepayments.com/reference/#Mutation--authorizeVenmoAccount) * Merchant Account ID * paymentMethodId * Amount * Order ID - ProviderExternalID * Device Data * Profile ID - Unique ID for each state Braintree --> PXP: authorizeVenmoAccount Response note: [authorizeVenmoAccount Payload](https://graphql.braintreepayments.com/reference/#object--transactionpayload) PXP -> Merchant Cashier: initiatePaymentResponse Merchant Cashier -> PXP: executePaymentActionRequest PXP -> Braintree: Capture Transaction note: [CaptureTransaction Mutation](https://graphql.braintreepayments.com/reference/#Mutation--captureTransaction) * Transaction ID Braintree --> PXP: Capture Transaction Payload note: [CaptureTransaction Payload](https://graphql.braintreepayments.com/reference/#object--transactionpayload) * Update the transaction status in MerchantĀ“s systems and complete the deposit PXP --> Merchant Cashier: executePaymentActionResponse Merchant Cashier --> Player: Show deposit confirmation page to the player Else: If risk check fails Merchant Cashier --> Player: Show deposit failed message to the player end end