Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Xenopay Laravel Package

laraditz/xenopay

Laravel SDK for Xenopay payments. Authenticate via facade/container, create and view bills with access tokens, optional default credentials via .env, plus included migration. Returns XenopayResponse with helpers for status, message, data, and errors.

View on GitHub
Deep Wiki
Context7

Xenopay

Latest Stable Version Total Downloads License StyleCI

Xenopay SDK for Laravel.

Installation

Via Composer

$ composer require laraditz/xenopay

Configuration

Edit the config/app.php file and add the following line to register the service provider:

'providers' => [
    ...
    Laraditz\Xenopay\XenopayServiceProvider::class,
    ...
],

Tip: If you're on Laravel version 5.5 or higher, you can skip this part of the setup in favour of the Auto-Discovery feature.

You can set default Xenopay account in your .env so that you do not need to pass it everytime you login.

...
XENOPAY_EMAIL=
XENOPAY_PASSWORD=
...

Getting started

Execute migration file:

php artisan migrate

Usage

Example usage as below snippet:

// using Facade
$response = \Xenopay::auth()->login(['email' => 'test@mail.com', 'password' => 'password']);

// using Service Container
$response = app('Xenopay')->auth()->login(['email' => 'test@mail.com', 'password' => 'password']);

// login
$response = \Xenopay::auth()->login(); // if u have set default account in .env, do not need to pass anything

// create bill
$response = \Xenopay::bill()->withToken($access_token)->create([
    'ref_no' => 'youruniquereferenceno',
    'amount' => 1,
    'description' => 'your description here.',
    'contact' => '0121234567',
    'redirect_url' => 'https://yourapp.com',
]);

// view bill
$response = \Xenopay::bill()->withToken($access_token)->view($id);

The request returns an instance of Laraditz\Xenopay\XenopayResponse, which provides a variety of methods that may be used to inspect the response:

$response->isSuccess() : bool; // true or false

$response->status() : int; // http status code. e.g. 200, 400, 500 etc.

$response->message() : string; // message for the response. e.g. "Invalid data".

$response->data() : mixed; // response content

$response->errors() : array; // usually contain validation errors

Change log

Please see the changelog for more information on what has changed recently.

Credits

License

MIT. Please see the license file for more information.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky