PHP code example of 42works / stripe

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

    

42works / stripe example snippets


composer dump-autoload

$data[0] = array('amount' => '123', 'currency' => 'USD', 'customer_id' => 'CUSTOMER_ID', 'image' => 'IMAGE_URL');
$data[1] = array('amount' => '12345', 'currency' => 'USD', 'customer_id' => 'CUSTOMER_ID', 'image' => 'IMAGE_URL');
$data[2] = array('amount' => '12345', 'currency' => 'USD', 'customer_id' => 'CUSTOMER_ID', 'image' => 'IMAGE_URL');


return $42stripeObject->makeStripeView_42( $data );

$data = array( 'email' => '[email protected]', 'description' => 'test description', 'source' => TOKEN_OF_STRIPE );

return $42stripeObject->makeStripeCustomer_42( $data );

$data = array( 'email' => '[email protected]', 'description' => 'test description updated', 'customer_id' => CUSTOMER_ID, 'source' => TOKEN_OF_STRIPE );

return $42stripeObject->updateStripeCustomer_42( $data );