PHP code example of scribe / stripe-bundle

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

    

scribe / stripe-bundle example snippets


$charge = $container->get('scribe.stripe.charge');

try {
	$charge
		->setAmount(10, 00)
		->setCardNumber('4242424242424242')
		->setCardExperation(01, 16)
		->setCardCvc('000')
		->charge()
	;
} catch(\Scribe\StripeBundle\Exception\StripeException $e) {
	// handle exception
}

$response = $charge->getResponse();

$charge = $container->get('scribe.stripe.charge');

try {
    $charge
        ->setAmount(10, 20)
        ->setCardNumber('4242424242424242')
        ->setCardExperation(1, 2016)
        ->setCardCvc('000')
        ->setName('First Last')
        ->setAddressLine01('123 Address Ln.')
        ->setAddressLine02('Suite 666')
        ->setCity('City')
        ->setState('State')
        ->setZip('12345')
        ->setCountry('USA')
        ->setMetadata([
            'my_client_id'   => '123456',
            'something_else' => 'more info about the customer',
        ])
        ->setDescription('A test Stripe charge!')
        ->setStatementDescription('TEST CHARGE')
        ->setReceiptEmail('[email protected]')
        ->charge()
    ;
} catch(\Scribe\StripeBundle\Exception\StripeException $e) {
    // handle exception
}

$response = $charge->getResponse();