PHP code example of wexample / symfony-payment

1. Go to this page and download the library: Download wexample/symfony-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/ */

    

wexample / symfony-payment example snippets


$payment = $paymentService->getOrCreateForPayable($cart, 'card');   // reuses the open one, replaces it if the amount changed
$initiation = $paymentService->initiate($payment);                 // client secret or redirect; null for a zero amount