PHP code example of znatali / yii2-braintree

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

    

znatali / yii2-braintree example snippets


public function actionSale() {
    $model = new BraintreeForm();
    $model->setScenario('sale');
    if ($model->load(Yii::$app->request->post()) && $model->send()) {
        // do something
    }
    return $this->render('purchase', ['model' => $model]);
}

 $form = \tuyakhov\braintree\ActiveForm::begin(); 

php composer.phar