Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/md-aamroni/aamarpay

AamarPay API Payment in Laravel
https://github.com/md-aamroni/aamarpay

aamarpay aamarpay-payment-gateway payment-gateway

Last synced: 9 days ago
JSON representation

AamarPay API Payment in Laravel

Awesome Lists containing this project

README

        

### Composer Install
```shell
composer require aamroni/aamarpay
```

### Publish Config
```shell
php artisan vendor:publish --tag=aamroni-aamarpay
```

### Usage Example
```php
use Aamroni\Aamarpay\AamarpayPaymentManager;
use Aamroni\Aamarpay\Entities\CustomerPayload;
use Aamroni\Aamarpay\Entities\PurchasePayload;
use Aamroni\Aamarpay\Facades\Aamarpay;

// @step01: Create a customer instance
$customer = CustomerPayload::instance(
name: 'Kabir Khan',
email: '[email protected]',
phone: '+8801645770422',
street1: 'House B-158 Road 22',
street2: 'Baridhara DOHS',
city: 'Dhaka',
state: 'Dhaka',
country: 'Bangladesh'
);

// @step02: Create a products instance
$purchase = PurchasePayload::instance(
invoice: 'INV-00001',
amount: 10.0,
detail: 'Something about service or product'
);

// @step03: Process the checkout
$response = Aamarpay::checkout(purchase: $purchase, customer: $customer);
// or using facade
$response = AamarpayPaymentManager::instance()->checkout(purchase: $purchase, customer: $customer);

dd($response);
```