PHP Integration Guide
Install with composer:
1composer require coinpay/laravel-integration
Publish Vendor Files:
1php artisan vendor:publish --tag=coinpay-config
Configuration
In config/coinpay.php file you can change your api_key:
1'api_key' => env('COINPAY_API_KEY'),
Usage
1try {
2 $coinPayGateway = CoinPay::request(
3 1, // The amount to be paid (in Dollar)
4 'https://your-callback.url', // The URL the user will be redirected to after payment
5 'ref123456', // A unique reference ID for tracking the transaction
6 'payer@example.com', // The identity of the payer (email or phone number)
7 'Alimo', // Full name of the payer
8 'Test Payment', // Description of the payment (e.g. 'Payment for order #123')
9 '1234567890' // National identification code of the payer
10 );
11 $url = $coinPayGateway->url;
12 //$transactionId = $coinPayGateway->transactionId; // Store this ID if you need it later
13
14 return response("<a style='word-break: break-all' href=$url > $url </a>");
15
16} catch (Exception $exception){
17 return $exception->getMessage();
18}