Skip to content

Payment Gateway

First-Pass Node Dossier

This page is an evidence-backed node dossier generated from the domain hierarchy and node questionnaire.

What It Is

PaymentGateway is the configuration record that tells Pyle how a payment provider behaves for checkout, refunds, saved cards, and invoice-related operations.

Parent hierarchy:

  • Payments & Billing
  • Gateway Configuration And Checkout Entry
  • Payment Gateway

Primary implementation paths:

  • packages/framework/src/Models/PaymentGateway.php
  • packages/framework/src/Http/Controllers/Api/Admin/PaymentGatewaysController.php
  • packages/framework/src/Actions/Stripe
  • packages/framework/src/Http/Controllers/PaymentGateway/Stripe

What Users Can Do With It

Direct capabilities

Operators can:

  • list, create, show, update, and delete payment gateways through the admin API
  • configure whether a gateway allows refunds, partial refunds, saved cards, or invoice sending
  • associate orders and customers with a gateway indirectly through payment or card-session flows

Indirect capabilities

Other workflows use PaymentGateway to:

  • generate Stripe checkout sessions for orders
  • generate Stripe card-session URLs for customers
  • create or sync order payments
  • create gateway-specific refunds

Things users cannot do directly

This pass did not find a packaged admin Livewire page dedicated to gateway management. The shared package exposes gateway configuration mainly through API surfaces and downstream host-app settings screens.

Where It Is Managed

ChannelRoleNotes
Admin payment-gateways APIDirectMain packaged CRUD surface
Order checkout and payment flowsIndirectGateways are selected or used through order actions
Customer card-session flowsIndirectSaved-card onboarding depends on gateway support
Storefront payment methodsIndirectShopper card management only exists for gateway-backed cards

Sources:

  • packages/framework/src/Http/Controllers/Api/Admin/PaymentGatewaysController.php
  • packages/framework/src/Models/PaymentGateway.php
  • packages/framework/src/Actions/Stripe/CreateStripeCheckout.php
  • packages/framework/src/Actions/Stripe/CreateStripeCustomerCardSession.php

Channel-Level Field Coverage

Admin create and update flow

The packaged admin controller validates:

  • name
  • type
  • url
  • public_key
  • secret_key

The model also persists broader gateway fields such as:

  • endpoint_url
  • script_url
  • store_id
  • checkout_id
  • sandbox
  • allow_refund
  • allow_partial_refund
  • allow_saved_card
  • allow_send_invoice
  • synced_at

Sources:

  • packages/framework/src/Http/Controllers/Api/Admin/PaymentGatewaysController.php
  • packages/framework/src/Models/PaymentGateway.php

Configuration And Data Model

Key model characteristics:

  • soft-deletable
  • UUID-based
  • activity-logged
  • hides secret and provider-only credential fields in serialized output

Important relationships:

  • orders()
  • customers()

Source:

  • packages/framework/src/Models/PaymentGateway.php

Relationships

PaymentGateway directly connects:

  • checkout creation
  • customer saved-card enrollment
  • order payment records
  • refund capability rules

Practical dependents:

  • Stripe checkout redirect flows
  • admin order payment creation
  • customer card sync
  • refund automation

Rules And Downstream Effects

Gateway-type implementation gap

The shared package payment actions support multiple gateway types such as stripe, manual, credit_line, and shopify, but the packaged admin gateway CRUD currently validates type as stripe only.

Sources:

  • packages/framework/src/Http/Controllers/Api/Admin/PaymentGatewaysController.php
  • packages/framework/src/Actions/PaymentGateway/Manual/CreateOrderPayment.php
  • packages/framework/src/Actions/PaymentGateway/CreditLine/CreateOrderPayment.php
  • packages/framework/src/Models/OrderRefund.php

Stripe key validation

When a Stripe gateway is retrieved, the shared package validates that the configured public and secret keys match the current environment expectations.

Sources:

  • packages/framework/src/Models/PaymentGateway.php
  • packages/framework/src/Support/StripeEnvironmentKeyValidator.php

Stripe-only customer-card support

Customer-card session creation and customer lookup are implemented only for Stripe in the shared package.

Sources:

  • packages/framework/src/Models/PaymentGateway.php
  • packages/framework/src/Actions/Stripe/CreateStripeCustomer.php
  • packages/framework/src/Actions/Stripe/CreateStripeCustomerCardSession.php

Integrations And Automation

Checkout and saved-card flows

Payment gateways are the entry point for:

  • Stripe checkout sessions
  • Stripe customer creation
  • Stripe saved-card session URLs

Sources:

  • packages/framework/src/Actions/Stripe/CreateStripeCheckout.php
  • packages/framework/src/Actions/Stripe/CreateStripeCustomer.php
  • packages/framework/src/Actions/Stripe/CreateStripeCustomerCardSession.php

Refund and payment syncing

Gateways drive:

  • gateway-specific refund creation
  • payment import and sync
  • customer-card synchronization after checkout

Sources:

  • packages/framework/src/Actions/Stripe/CreateStripeOrderPaymentRefund.php
  • packages/framework/src/Actions/Stripe/ImportStripePaymentIntentToOrderPayment.php
  • packages/framework/src/Actions/Stripe/SyncStripeCheckoutToOrderPayment.php

Where It Appears To End Users

PaymentGateway is mostly an internal operator configuration concept.

Customers experience it indirectly through:

  • checkout redirects
  • saved-card management
  • refund behavior

Operators encounter it through setup work and order-payment workflows rather than a packaged shared management page.

Current Documentation Takeaways

  1. PaymentGateway is the capability switchboard for checkout, refunds, saved cards, and invoice-related behavior.
  2. The shared package model and actions support more gateway types than the packaged admin CRUD currently exposes.
  3. Gateway configuration is not a shopper concept, but it strongly shapes what payment and billing workflows can exist.

Open Questions

  • This first pass did not inspect host-app gateway-management screens that may wrap the shared admin API.