Download the PHP package minic/lunar-hosted-payment without Composer
On this page you can find all versions of the php package minic/lunar-hosted-payment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package lunar-hosted-payment
Lunar Hosted Payment Integration
Introduction
This package provides hosted payment gateway integration for Lunar PHP. It allows you to handle payments seamlessly using payment APIs like Stripe, including creating payment intents and managing transactions.
Features
- Stripe payment gateway integration
- Support for card payments
- Easy configuration and setup
- Extensible architecture for additional payment methods
Minimum requirements
- Lunar 1.x
- A Stripe account with secret and public keys
Setting Up Your Stripe Account
To use this package, you need to have a Stripe account properly configured. Follow these steps to set up your Stripe account:
-
Create a Stripe Account
If you don't already have a Stripe account, sign up at https://stripe.com. -
Obtain API Keys
- Log in to your Stripe Dashboard.
- Navigate to the Developers section and select API Keys.
- Copy your Publishable Key and Secret Key.
- Set Up Your Environment Variables
Add the following keys to your.env
file: bash composer require minic/lunar-hosted-payment bash php artisan vendor:publish --tag=hosted-payments-config
Register the Service Provider (if not auto-discovered)
If your Laravel project does not support package auto-discovery, add the service provider manually in config/app.php
:
Add your payment provider credentials
Make sure you have the provider credentials set in config/lunar-hosted-payment/payment.php
. E.g.:
Lunar payments configuration file
Your lunar payments.php config file should look like this:
Usage
Create a Payment
This method will create a payment session and return the created payment session. You can then redirect the user to the provider's payment page:
Note: The user will be redirected to the provider's payment page for completing the transaction.
Authorize a Payment (create order)
Following the lunarphp's pattern of authorizing the payment you can create the actual order by calling the driver's authorize method. This will return the newly created order id.
Contributing
- Fork the repository
- Create a new branch (
feature/new-payment-driver
) - Commit your changes
- Push to the branch and submit a Pull Request
License
This package is open-source and available under the MIT license.