39.1 Checkout Workflow Overview

AIUNIFY Funnels can process supported Product checkout requests directly from a Landing Page.

The checkout workflow identifies:

  1. The selected payment method.
  2. The Product being purchased.
  3. The Landing Page generating the Order.
  4. Any additional customer fields submitted by the checkout form.
  5. The visitor's browser, OS, and device classification.

39.2 Public Order Submission

The public Landing Page checkout submits to the application's Order-submission workflow using the Landing Page's unique code.

The confirmed order-submission route is throttled to 60 requests per minute.

39.3 Two Payment-Selection Patterns

The checkout controller recognizes two supported request patterns.

Form checkout using paymentmethod Accepts PayPal, Bank Transfer, or Stripe.
Checkout button using _type Accepts PayPal, Stripe, or COD.

39.4 Allowed Form Checkout Payment Methods

When the request contains paymentmethod, the supported values are:

  1. paypal
  2. banktransfer
  3. stripe

39.5 Allowed Checkout Button Types

When the request contains _type, the supported values are:

  1. paypal
  2. stripe
  3. cod

39.6 Invalid Payment Type

If a submitted payment type is not among the accepted values for the applicable checkout pattern, the workflow returns:

Not found type payment

39.7 Missing Payment Method

If neither a valid paymentmethod nor _type is supplied, the workflow returns:

Not found payment method or type

39.8 Product Lookup

The checkout request includes an internal Product identifier.

AIUNIFY Funnels looks up that Product before creating the Order.

If the Product cannot be found, checkout returns:

Not found products

39.9 Landing Page Lookup

The controller also finds the Landing Page using the unique code supplied in the Order-submission route.

If the Landing Page cannot be found, the workflow returns:

Not found LandingPage

39.10 Payment Credential Checks

Before creating a gateway request, AIUNIFY Funnels checks the Landing Page owner's Account Settings when PayPal or Stripe is selected.

PayPal Requires Client ID and Secret.
Stripe Requires Publishable key and Secret key.

39.11 Checkout Customer Fields

The Order workflow can collect additional submitted checkout fields.

Before creating the Order, the application removes these technical request fields from the customer field collection:

  1. _type
  2. _productid
  3. _token
  4. paymentmethod

The remaining submitted keys and values are stored as the Order's customer field_values.

39.12 What Is Stored When an Order Is Created

The confirmed checkout workflow creates an Order with:

User ID The owner of the Landing Page.
Landing Page ID The Landing Page that produced the checkout.
Product Name Copied from the Product at checkout time.
Gateway The selected payment method.
Total Copied from the Product Price.
Field Values Additional customer information submitted by the checkout.
Paid Initially false when the Order is created.
Browser The detected browser family.
OS The detected platform family.
Device The application's detected device classification.
Currency Copied from the Product.

39.13 Initial Order Status

The Order database structure gives new Orders the default status:

OPEN

Order status and payment status are separate and are managed independently.

39.14 Every Supported Checkout Creates the Order Before Gateway Branching

The confirmed workflow creates the Order record before it branches into Stripe, PayPal, COD, or Bank Transfer handling.

This is important when reviewing Orders after an incomplete or unpaid checkout: an Order record can exist even when the payment has not become Paid.

39.15 Stripe Checkout Processing

For Stripe, AIUNIFY Funnels creates a Stripe Checkout Session with:

  1. Card as the supported payment-method type.
  2. The Order Product Name.
  3. The Order Currency.
  4. The Order Total converted to the gateway's expected smallest currency unit where applicable.
  5. A quantity of 1.
  6. Payment mode.
  7. A success return URL.
  8. A cancel URL.

39.16 Zero-Decimal Currency Handling for Stripe

The Order model contains specific handling for currencies that do not use the normal two-decimal conversion.

For other currencies, the Order total is multiplied by 100 when producing the Stripe smallest-unit amount.

Users should still verify that the intended currency is supported by their Stripe account.

39.17 Stripe Successful Return

When the Stripe return workflow retrieves a Checkout Session whose payment status is paid, AIUNIFY Funnels:

  1. Saves the Stripe session identifier as the Order reference.
  2. Sets the Order to Paid.
  3. Saves the Order.
  4. Determines the Landing Page payment-success destination.
  5. Redirects the customer to that destination.

39.18 PayPal Checkout Processing

For PayPal, AIUNIFY Funnels initializes the PayPal REST gateway using the Landing Page owner's:

  1. Client ID.
  2. Secret.
  3. Sandbox/Live environment.
  4. User name as brand name.

The PayPal purchase request uses the Order Total, Currency, Product Name, cancel URL, return URL, and notification URL.

39.19 PayPal Redirect and Completion

If PayPal requests an offsite redirect, AIUNIFY Funnels returns the PayPal redirect URL to the Landing Page checkout.

After the customer returns with the required PayPal identifiers, the application completes the purchase.

When PayPal reports success, the Order reference is stored, the Order is marked Paid, and the visitor is sent to the configured payment-success destination.

39.20 COD and Bank Transfer

COD and Bank Transfer follow a different confirmed application path from Stripe and PayPal.

For those two methods, the Order is created with Paid = false, and the application returns the configured Landing Page payment-success destination without an external card-gateway confirmation step in this controller.

The Order can later be reviewed and its payment status managed through the Orders workspace as appropriate to the business transaction.

39.21 Payment Success Destination

After the applicable successful gateway workflow—or immediately after the supported COD/Bank Transfer order creation path—the application determines where the visitor should go.

If the Landing Page payment-success type is URL, it uses the configured Payment Redirect URL.

Otherwise it uses:

[Landing Page URL]/thank-you

39.22 Canceling a Gateway Checkout

The general Order gateway-cancel workflow returns the visitor to the associated Landing Page when that Landing Page can be found.

A canceled checkout should not be interpreted as proof of payment.

39.23 Order Status and Paid Status Are Independent

An Order has both:

Operational Status OPEN, COMPLETED, or CANCELED.
Payment Status Paid or Not paid.

For example, an Order can remain OPEN while already Paid, or an offline-payment Order can remain Not paid until payment is verified manually.

39.24 Recommended Checkout Test

  1. Create or verify the Product.
  2. Confirm Name, Gross Price, and Currency.
  3. Configure PayPal or Stripe credentials when using those gateways.
  4. Configure the Landing Page payment-success action.
  5. Publish and open the real Landing Page.
  6. Enter controlled customer checkout information.
  7. Select the intended payment method.
  8. Complete the gateway workflow when using PayPal or Stripe.
  9. Verify the expected success destination.
  10. Open Orders.
  11. Confirm Product, Customer Info, Gateway, Total context, Status, and payment state.

Operating principle: Order creation and successful payment are not the same event. AIUNIFY Funnels creates the Order first and updates Paid status only according to the applicable payment workflow.

Write Your Comment