achertovsky / paypal-yii2
Makes paypal for yii2 much easier
Installs: 1 261
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 1
Forks: 2
Open Issues: 1
Requires
- php: >=5.4.0
- paypal/merchant-sdk-php: 2.*
- yiisoft/yii2: >=2.0.4
This package is auto-updated.
Last update: 2022-06-19 19:49:08 UTC
README
Description
Module for easy yii2 payments
Features:
Express payment
Subscription (via express payment)
I hope it will be useful for you.
Installing
The preferred way to install this extension is through composer.
{
"require": {
"achertovsky/paypal-yii2": "@dev"
}
}
or
composer require achertovsky/paypal-yii2 "@dev"
update your db schema
php yii migrate/up --migrationPath=@vendor/achertovsky/paypal-yii2/migrations
Usage
Currently application is in sandbox. You can edit values in DB or using GUI in backend (if you have backend configured)
to start using it - please, add it to your modules section
you can use your attribute names.
fox example:
'payment' => [
'class' => 'achertovsky\paypal\Module',
],
EXPRESS PAYMENT HOW TO
SUBSCRIPTION VIA EXPRESS PAYMENT HOW TO
Configuration variables listing
//here is arrays like for Url::toRoute()
public $ipnUrl = ['/payment/payment/payment-notification'];
public $expressSuccessUrl = ['/payment/payment/express-payment'];
public $subscriptionExpressSuccessUrl = ['/payment/payment/subscription-express-confirm'];
public $cancelUrl = ['/', '#' => 'cancel'];
//default currency
public $currency = 'USD';
//models for this module
public $modelMap = [
'PaypalExpressPayment' => 'achertovsky\paypal\models\PaypalExpressPayment',
'PaypalSubscriptionExpress' => 'achertovsky\paypal\models\PaypalSubscriptionExpress',
];
//paypal express checkout version
public $ECVersion = '104.0';
//boolean which indicates is express payment is enabled in app
public $enableExpressPayment = true;
//boolean which indicates is subscription flow is enabled in app
public $enableSubscriptionExpress = true;
//getter to receive users name. it must be assigned to your option
public $subscriptionUsernameGetter = 'username';
//defines if user receive notifications via email when subscription status changed
public $subscriptionEmailNotification = false;