承接 karan-darji/omnipay-paysera 相关项目开发

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

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

karan-darji/omnipay-paysera

最新稳定版本:v1.0.0

Composer 安装命令:

composer require karan-darji/omnipay-paysera

包简介

Paysera gateway for Omnipay payment processing library

README 文档

README

Paysera gateway driver for the Omnipay PHP payment processing library

Packagist Version Software License

Installation

Omnipay is installed via Composer. To install, require league/omnipay and karan-darji/omnipay-paysera with Composer:

composer require league/omnipay karan-darji/omnipay-paysera

For general usage instructions, please see the main Omnipay repository.

Requirements

  • PHP 7.0+
  • Omnipay v3+
  • ext-openssl

Basic Usage

The following gateways are provided by this package:

  • Paysera

For general usage instructions, please see the main Omnipay repository.

Code Example

use Omnipay\Omnipay;

// Setup payment gateway
$gateway = Omnipay::create('Paysersa');
$gateway->setProjectId('123456');
$gateway->setPassword('abcde12345');

// Optionally to determine which order has been paid
$orderId = 1;

// Example card (actually customer) data
$card = [
    'email' => 'john.doe@example.com',
    'billingFirstName' => 'John',
    'billingLastName' => 'Doe',
    'billingPhone' => '+372 12345678',
    'billingCompany' => 'Good Workers Ltd.',
    'billingAddress1' => 'Viru valjak 24',
    'billingCity' => 'Tallinn',
    'billingPostcode' => '123456',
    'billingCountry' => 'EE',
];

// Send purchase request
$response = $gateway->purchase(
    [
        'language' => 'ENG',
        'transactionId' => $orderId,
        // 'paymentMethod' => 10,
        'amount' => '10.00',
        'currency' => 'EUR',
        'returnUrl' => "https://example.com/paysera/return/{$orderId}",
        'cancelUrl' => "https://example.com/paysera/cancel/{$orderId}",
        'notifyUrl' => "https://example.com/paysera/notify/{$orderId}",
        'card' => $card,
    ]
)->send();

if ($response->isRedirect()) {
    return $response->redirect();
}

You should also implement method for notifyUrl. After successful charging, Paysera sends a request to this URL.

use Omnipay\Omnipay;

// Setup payment gateway
$gateway = Omnipay::create('Paysersa');
$gateway->setProjectId('123456');
$gateway->setPassword('abcde12345');

// Accept the notification
$response = $gateway->acceptNotification()
    ->send();
    
if ($response->isSuccessful()) {
    // Mark the order as paid

    return true;
}

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-04-30