承接 yzh52521/think-omnipay 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yzh52521/think-omnipay

最新稳定版本:v1.0.5

Composer 安装命令:

composer require yzh52521/think-omnipay

包简介

Integrates Omnipay with thinkphp and provides an easy configuration.

README 文档

README

Total Downloads Latest Version

Integrates the Omnipay PHP library with Laravel to make Configuring multiple payment tunnels a breeze!

Installation

Include the laravel-omnipay package as a dependency in your composer.json:

composer require yzh52521/think-omnipay

Note: You don't need to include the omnipay/common in your composer.json - it has already been included think-omnipay.

Install Required Providers

Now just include each gateway as you require, to included PayPal for example:

composer require omnipay/paypal "3.*"

Alternatively you can include every gateway by the following:

composer require omnipay/omnipay "3.*"

Note: this requires a large amount of composer work as it needs to fetch each seperate repository. This is not recommended.

Configuration

PayPal Express Example

Here is an example of how to configure password, username and, signature with paypal express checkout driver

...
'gateways' => [
    'paypal' => [
        'driver'  => 'PayPal_Express',
        'options' => [
            'username'  => 'coolusername',
            'password'  => 'strongpassword',
            'signature' => '',
            'solutionType' => '',
            'landingPage'    => '',
            'headerImageUrl' => '',
            'brandName' =>  'Your app name',
            'testMode' => true
        ]
    ],
]
...

Usage

$cardInput = [
	'number'      => '4444333322221111',
	'firstName'   => 'MR. WALTER WHITE',
	'expiryMonth' => '03',
	'expiryYear'  => '16',
	'cvv'         => '333',
];

$card = \ThinkOmnipay\Facade::creditCard($cardInput);

$response = \ThinkOmnipay\Facade::purchase([
	'amount'    => '100.00',
	'returnUrl' => 'http://bobjones.com/payment/return',
	'cancelUrl' => 'http://bobjones.com/payment/cancel',
	'card'      => $cardInput
])->send();

dd($response->getMessage());

This will use the gateway specified in the config as default.

However, you can also specify a gateway to use.

\ThinkOmnipay\Facade::setGateway('paypal');

$response = \ThinkOmnipay\Facade::purchase([
	'amount' => '100.00',
	'card'   => $cardInput
])->send();

dd($response->getMessage());

In addition you can make an instance of the gateway.

$gateway = \ThinkOmnipay\Facade::gateway('paypal');

License

This package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固