PHP code example of christianbraybrooke / stripe-laravel-payment-intents

1. Go to this page and download the library: Download christianbraybrooke/stripe-laravel-payment-intents 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/ */

    

christianbraybrooke / stripe-laravel-payment-intents example snippets


use ChrisBraybrooke\LaravelStripePaymentIntent\Facades\StripePaymentIntent;

/**
 * Bootstrap any application services.
 *
 * @return void
 */
public function boot()
{
    StripePaymentIntent::dontSavePaymentRecords();
}

@paymentFields([
  // Amount in lowest currency (pence, cents etc.).
  // Currency in valid currency code.
  // Success URL is the route we will post to completed form data to.
  'amount' =>  12500, 'currency' => 'GBP', 'successUrl' => route('payment.submit')
])
@endpaymentFields
  
// Somewhere towards the footer
@paymentScripts()
@endpaymentScripts

use ChrisBraybrooke\LaravelStripePaymentIntent\Facades\StripePaymentIntent;

/**
 * Bootstrap any application services.
 *
 * @return void
 */
public function boot()
{
  	// Will give the inputs on the payment form a class of: 'form-control'
    StripePaymentIntent::setInputClass('form-control');
    
  	// Will change the colour of elements like the submit button.
  	StripePaymentIntent::setThemeColor('#efefef');
}
sh
php artisan vendor:publish --tag="payment-migrations"

php artisan migrate