PHP code example of astral-php / astral-payment

1. Go to this page and download the library: Download astral-php/astral-payment library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

astral-php / astral-payment example snippets


AstralPayment\PaymentServiceProvider::class,

use AstralPayment\PaymentService;

$data = $paymentService->createPaymentIntent(
    amountCents: 2999,
    currency: 'eur',
    metadata: ['order_id' => $orderId],
);
// $data['clientSecret'], $data['intentId']
bash
composer 
bash
php bin/console migrate

src/
  PaymentService.php
  PaymentServiceProvider.php
  Controllers/
  Dao/
  Events/
  Listeners/
  Middleware/
  Models/
stubs/
  .env.payment.example
  config/routes.payment.php
  database/migrations/
  views/payment/
  resources/js/