Payment integration example · PHP · Laravel

Put payments inside the business system people already use.

A payment button is only the visible step. Your application also has to tokenize card or check details, connect gateway customers to your records, manage saved payment methods, submit charges, track subscriptions, issue refunds, and handle failures. FoleyBridge built MiPaymentChoice Cashier to put those capabilities behind a consistent Laravel interface.

Public technical example

Inspect the source code, README, tests, change history, and MIT license on GitHub.

DemonstratesGateway integration inside a business application
TechnologyPHP 8.1+ and Laravel 10, 11, or 12 components
SourcePublic repository under the MIT license

The payment solution

Give each payment action a place in your existing customer and billing flow.

MiPaymentChoice Cashier translates supported gateway actions into Laravel services, models, traits, configuration, and database records that an application can use.

01

Accept a one-time payment

Create a short-lived token from supported card or check details, submit the charge, and return the result to the application without treating raw payment credentials as ordinary business data.

02

Save a payment method

Turn a supported token into a reusable payment method, retrieve saved methods, choose the default, and remove a method through the package interface.

03

Manage recurring billing

Create supported subscriptions, add a trial period, inspect subscription status, cancel at the end of a billing period or immediately, and resume an eligible subscription.

04

Issue a refund

Request a supported full or partial refund from the same application that holds the customer and billing context.

05

Connect customer records

Create or identify the gateway customer associated with an application user and retain the relationship needed for later payment actions.

06

Respond to failures

Distinguish supported validation, authentication, gateway, and payment failures so the application can show an appropriate response or send the item for follow-up.

FoleyBridge can turn a provider API into a reusable part of your business software.

The package demonstrates the engineering required between a gateway’s endpoints and the invoices, customers, subscriptions, and transactions your staff actually manages.

Provider API

Translate gateway actions

Wrap supported API requests in methods that use the terminology and records already present in the application.

Application data

Preserve the relationships

Connect the gateway’s customer, token, payment-method, subscription, and transaction identifiers to the correct application records.

Reusable code

Centralize payment behavior

Keep authentication, request handling, response parsing, and common billing actions in one maintained integration layer.

Failure paths

Expose usable errors

Convert provider and validation failures into exceptions the surrounding application can handle deliberately.

Installation

Supply the application pieces

Provide configuration, database migrations, models, services, and a Laravel trait instead of scattering gateway calls throughout the codebase.

Verification

Make the implementation inspectable

Publish source, tests, setup instructions, requirements, and license terms so developers can examine the integration before relying on it.

What your integration must handle

Design the entire payment flow, not just the gateway request.

Your payment solution has to connect money movement to the right customer, invoice, order, subscription, or account—and tell authorized people what happened.

  • Which people can charge, refund, change a payment method, or cancel a subscription
  • Which application record owns each gateway customer and transaction
  • Where tokens and non-sensitive payment references are stored
  • How successful, declined, invalid, refunded, cancelled, and interrupted transactions appear to customers and staff
  • How recurring charges, trials, cancellation dates, and subscription status affect access or service
  • How receipts, notices, account balances, and financial reports stay consistent
  • How provider credentials, logs, and diagnostic details are protected
  • How representative success and failure cases are tested before production use

Inside the Laravel application

Put the gateway behind application components your developers can maintain.

The public package shows the specific footprint FoleyBridge created for a Laravel application.

Configuration

Environment settings hold the MiPaymentChoice username, password, merchant key, and gateway address.

Database migrations

Published migrations create subscription and payment-method tables and add the gateway customer identifier to the application’s users table.

Billable model

A Laravel trait gives the application user supported customer, payment-method, charge, refund, and subscription functions.

Gateway services

Dedicated services handle supported QuickPayments, token, customer, and API requests without duplicating request code in every screen.

Local billing records

Application records preserve the payment-method and subscription information needed by the surrounding business logic.

Package exceptions

The application can catch supported API and payment failures and decide what the user should see next.

Built around your transaction

Your integration should match the way your business charges and serves customers.

FoleyBridge can build payment screens, provider connections, customer and transaction records, billing rules, permission checks, failure handling, and reporting into the business system you need.

Describe your payment flow

Important boundary

The integration is one part of accepting payments.

MiPaymentChoice Cashier does not provide a merchant account, set gateway pricing, or determine your legal, accounting, card-industry, refund, or customer-notice obligations. A production application also needs secure credential storage, appropriate access controls, logging, and testing against the provider environment.

Review before use. The official repository contains the current code, requirements, setup instructions, tests, and MIT license.

Your payment system

Which customer, billing, and payment steps need to connect?

Describe the application, payment provider, transaction types, recurring rules, and reports you need.