PHP code example of kevinem / wepay-laravel

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

    

kevinem / wepay-laravel example snippets


'providers' => [
    // Other service providers...

    KevinEm\WePay\Laravel\Providers\WePayServiceProvider::class,
],


'aliases' => [
    // Other facades...
    
    'WePayLaravel' => KevinEm\WePay\Laravel\Facades\WePayLaravel::class,
],

$ php artisan vendor:publish


$account = [
    'name' => 'some account name',
    'description' => 'a description',
    'type' => 'personal',
    'image_uri' => 'https://someurl.com',
    'gaq_domains' => [],
    'mcc' => 7299,
    'country' => 'US',
    'currencies' => ['USD']
];

\WePayLaravel::account()->create($account);

$membership = [
    'account_id' => 'some_account_id',
    'member_access_token' => 'access_token',
    'role' => 'admin',
    'admin_context' => [
        'reason' => 'beneficiary'
    ]
];

\WePayLaravel::accountMembership()->create($membership);

// assuming user access token is stored
$user_access_token = $user->getAccessToken();
\WePayLaravel::account($user_access_token)->modify([
    'name' => 'updated account name'
]);