PHPackages                             minic/lunar-hosted-payment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. minic/lunar-hosted-payment

ActiveLibrary[Payment Processing](/categories/payments)

minic/lunar-hosted-payment
==========================

Flexible payment integration for Laravel, lunarphp, supporting multiple payment providers.

v2.0.0(2mo ago)04.4k↓40%MITPHPPHP ^8.2

Since Apr 14Pushed 2mo agoCompare

[ Source](https://github.com/minicstudio/lunar-hosted-payment)[ Packagist](https://packagist.org/packages/minic/lunar-hosted-payment)[ RSS](/packages/minic-lunar-hosted-payment/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (18)Used By (0)

Lunar Hosted Payment Integration
================================

[](#lunar-hosted-payment-integration)

Introduction
------------

[](#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
--------

[](#features)

- Stripe payment gateway integration
- Support for card payments
- Easy configuration and setup
- Extensible architecture for additional payment methods

Minimum requirements
--------------------

[](#minimum-requirements)

- Lunar 1.x
- A Stripe account with secret and public keys

Setting Up Your Stripe Account
------------------------------

[](#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:

1. **Create a Stripe Account**
    If you don't already have a Stripe account, sign up at .
2. **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**.
3. **Set Up Your Environment Variables**
    Add the following keys to your `.env` file:

    ```
    STRIPE_PUBLIC_KEY=your-publishable-key
    STRIPE_SECRET_KEY=your-secret-key

    ```

Installation
------------

[](#installation)

### Install the Package

[](#install-the-package)

Install the package via Composer:

```
composer require minic/lunar-hosted-payment
```

### Publish the Configuration

[](#publish-the-configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=hosted-payments-config
```

### Register the Service Provider (if not auto-discovered)

[](#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`:

```
'providers' => [
    Minic\LunarHostedPayment\HostedPaymentServiceProvider::class,
];
```

### Add your payment provider credentials

[](#add-your-payment-provider-credentials)

Make sure you have the provider credentials set in `config/lunar-hosted-payment/payment.php`. E.g.:

```
return [
    'default' => env('PAYMENT_PROVIDER', 'stripe'),
    'providers' => [
        'stripe' => [
            'driver_class' => Minic\LunarHostedPayment\Drivers\StripeDriver::class,
            'secret_key' => env('STRIPE_SECRET_KEY'),
            'public_key' => env('STRIPE_PUBLIC_KEY'),
        ]
    ]
];
```

### Lunar payments configuration file

[](#lunar-payments-configuration-file)

Your lunar payments.php config file should look like this:

```
