kowi / yii2-lemon
Yii2 LemonWay Payments 集成
dev-master
2020-08-04 10:47 UTC
Requires
- ext-json: *
- tigrov/intldata: ^1.1
- yii2mod/yii2-enum: ^1.7
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-httpclient: ^2.0
Requires (Dev)
- codeception/codeception: ^4.0
- codeception/module-asserts: ^1.1
- codeception/module-yii2: ^1.0
- codeception/specify: ^1.2
This package is not auto-updated.
Last update: 2024-09-25 05:56:10 UTC
README
Yii2 Lemon Way Payments 集成
安装
安装此扩展的首选方法是使用 composer。
可以运行
php composer.phar require --prefer-dist kowi/yii2-lemon "*"
或者添加
"kowi/yii2-lemon": "*"
到您的 composer.json
文件的 require 部分。
配置
安装扩展后,只需在您的应用程序中配置即可
<?php return [ 'components' => [ 'lemonway' => [ 'class' => 'kowi\lemon\Lemonway', 'apiBaseUrl' => 'https://sandbox-api.lemonway.fr/mb/kowi/dev/directkitrest', 'apiAuthUrl' => 'https://sandbox-api.lemonway.fr/oauth/api/v1/oauth/token', 'newApiKeyPath' => '@app/runtime/accessToken.json', 'apiKey' =>'0fab3b41-1234-abcd-xyz1-29660f5767a9', ], ] ];
使用方法
use kowi\lemon\objects\Adresse; use kowi\lemon\objects\Birth; use kowi\lemon\resources\AccountIndividual; $adresse = new Adresse(); $adresse->street = '26 rue de Paris'; $adresse->postCode = '93100'; $adresse->city = 'Montreuil'; $adresse->country = 'FRA'; $birth = new Birth(); $birth->date = '1985/03/21'; $birth->city = 'Montreuil'; $birth->Country = 'FRA'; $account = new AccountIndividual(); $account->accountId = '2'; $account->email = 'ymartinez@sicma21.com'; $account->title = 'M'; $account->firstName = 'Adrian'; $account->lastName = 'Martinez Duque'; $account->adresse = $adresse; $account->birth = $birth; $account->nationality = 'CUB'; $account->phoneNumber = '5342492852'; $account->mobileNumber = '5342492852'; $account->payerOrBeneficiary = 1; if ($account->save()) { // code is save } else { // code is not save }