Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joni-jones/yii2-2checkout
2Checkout library extension for Yii2 framework
https://github.com/joni-jones/yii2-2checkout
2checkout-library yii2
Last synced: 4 days ago
JSON representation
2Checkout library extension for Yii2 framework
- Host: GitHub
- URL: https://github.com/joni-jones/yii2-2checkout
- Owner: joni-jones
- License: mit
- Created: 2014-05-17T07:52:53.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-20T19:11:58.000Z (over 8 years ago)
- Last Synced: 2024-09-26T08:57:33.907Z (about 2 months ago)
- Topics: 2checkout-library, yii2
- Language: PHP
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
2Checkout PHP library for Yii 2
=====================================Extension provides access for [2Checkout library](https://github.com/2Checkout/2checkout-php) methods from Yii2 framework.
[![Latest Stable Version](https://poser.pugx.org/joni-jones/yii2-2checkout/v/stable)](https://packagist.org/packages/joni-jones/yii2-2checkout)
[![Total Downloads](https://poser.pugx.org/joni-jones/yii2-2checkout/downloads)](https://packagist.org/packages/joni-jones/yii2-2checkout)
[![License](https://poser.pugx.org/joni-jones/yii2-2checkout/license)](https://packagist.org/packages/joni-jones/yii2-2checkout)How to install?
---------------Get it via [composer](http://getcomposer.org/) by adding the package to your `composer.json`:
```json
{
"require": {
"joni-jones/yii2-2checkout": "*"
}
}
```or run
```
php composer.phar require --prefer-dist joni-jones/yii2-2checkout "*"
```Usage
-----Once the extension is installed, simply modify your application configuration as follows:
```php
return [
'components' => [
'twocheckout' => [
'class' => 'yii\twocheckout\TwoCheckout',
'privateKey' => '',
'sellerId' => '',
'secretWord' => '', //by default is 'tango'
'username' => '', //required to Admin API call
'password' => '', //required to Admin API call
'sandbox' => true, //by default false,
]
],
// ...
];
```The `Charge` class usage example (equal to `Twocheckout_Charge::form()`):
```php
$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);
```Full documentation you can find on [2Checkout](https://www.2checkout.com/documentation/libraries/php) site.