PHP code example of joni-jones / yii2-2checkout

1. Go to this page and download the library: Download joni-jones/yii2-2checkout 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/ */

    

joni-jones / yii2-2checkout example snippets


return [
    'components' => [
        'twocheckout' => [
            'class' => 'yii\twocheckout\TwoCheckout',
            'privateKey' => '',
            'sellerId' => '',
            'secretWord' => '', //by default is 'tango'
            'username' => '', //

$product['currency_code'] = 'USD';
$product['mode'] = '2CO';
$product['li_0_price'] = '0.01';
$product['merchant_order_id'] = '1122312';
$product['li_0_name'] = 'Credit';
$product['li_0_quantity'] = '1';
$product['li_0_type'] = 'product';
$product['li_0_tangible'] = 'N';
$product['li_0_product_id'] = '43242342';
$product['sid'] = Yii::$app->twocheckout->sellerId;
$product['demo'] = Yii::$app->twocheckout->demo;
$product['key'] = md5($product['merchant_order_id'].$product['li_0_product_id']);
Yii::$app->twocheckout->charge->form($product);

php composer.phar