PHP Classes

File: README.md

Recommend this page to a friend!
  Packages of Daryl Legion   PayRex Laravel   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PayRex Laravel
Request payments using the PayRex service
Author: By
Last change:
Date: 13 days ago
Size: 3,159 bytes
 

Contents

Class file image Download

PayRex for Laravel

Latest Version on Packagist GitHub Tests Action Status PHPStan Code Coverage GitHub Code Style Action Status Total Downloads

Unofficial Laravel package for PayRex payment platform. Easily accept payments via credit/debit cards, GCash, Maya, BillEase, QR Ph and more.

Documentation

You'll find full documentation on the docs site.

Basic Usage

use LegionHQ\LaravelPayrex\Facades\Payrex;

// Create a payment intent
$paymentIntent = Payrex::paymentIntents()->create([
    'amount' => 10000, // ?100.00 in cents
    'currency' => 'PHP',
    'payment_methods' => ['card', 'gcash', 'maya'],
    'description' => 'Order #1234',
]);

// Create a checkout session
$session = Payrex::checkoutSessions()->create([
    'currency' => 'PHP',
    'line_items' => [
        ['name' => 'Premium Plan', 'amount' => 99900, 'quantity' => 1],
    ],
    'payment_methods' => ['card', 'gcash'],
    'success_url' => route('checkout.success'),
    'cancel_url' => route('checkout.cancel'),
]);

return redirect()->away($session->url);

Installation

You can install the package via composer:

composer require legionhq/laravel-payrex

Publish the config file:

php artisan vendor:publish --tag="payrex-config"

Add your API keys to .env:

PAYREX_PUBLIC_KEY=your_public_key
PAYREX_SECRET_KEY=your_secret_key
PAYREX_WEBHOOK_SECRET=your_webhook_secret

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.