承接 pay-now/omnipay-paynow 相关项目开发

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

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

pay-now/omnipay-paynow

最新稳定版本:1.0.3

Composer 安装命令:

composer require pay-now/omnipay-paynow

包简介

Paynow gateway for Omnipay payment processing library

README 文档

README

Build Status Latest Version Software License

Paynow driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP. This package implements paynow support for Omnipay.

Installation

Omnipay is installed via Composer. To install, simply require league/omnipay and pay-now/omnipay-paynow with Composer:

composer require league/omnipay pay-now/omnipay-paynow

Basic Usage

Making a payment:

use Omnipay\Omnipay;

$gateway = Omnipay::create('Paynow');
$gateway->setApiKey('api-key');
$gateway->setSignatureKey('signature-key');

$buyer = [
    'email' => 'jan.nowak@melements.pl', 
    'firstName' => 'Jan', 
    'lastName' => 'Nowak', 
    'phone' => [
        'number' => '123123123', 
        'prefix' => '+48'
    ], 
    'locale'=> 'en-EN'
];

$items[] = [
    'name' => 'itemName', 
    'quantity' => '12', 
    'category' => 'toys', 
    'price' => '123'
];

$paymentData = [
    'amount' => '10000', 
    'description' => 'PLN', 
    'returnUrl' => 'https://paynow.pl', 
    'transactionId' => '123',   
    'buyer' => $buyer, 
    'items' => $items
];

try {
    $response = $gateway->purchase($paymentData)->send();
} catch (\Exception $e) {
    // catch errors
}

Handling notification with current payment status:

use Omnipay\Omnipay;

$gateway = Omnipay::create('Paynow');
$gateway->setApiKey('api-key');
$gateway->setSignatureKey('signature-key');

try {
    $response = $gateway->acceptNotification();
} catch (\Exception $e) {
    header('HTTP/1.1 400 Bad Request', true, 400);
}

header('HTTP/1.1 202 Accepted', true, 202);

Making a payment's refund

use Omnipay\Omnipay;

$gateway = Omnipay::create('Paynow');
$gateway->setApiKey('api-key');
$gateway->setSignatureKey('signature-key');

$refundData = [
    'amount' => '1000000', 
    'transactionReference' => 'NOW8-CK5-C3E-ZDM', 
    'reason' => 'RMA'
];

try {
    $response = $gateway->refund($refundData)->send();
} catch (\Exception $e) {
    // catch errors
}

Retrieving available payment methods

use Omnipay\Omnipay;

$gateway = Omnipay::create('Paynow');
$gateway->setApiKey('api-key');
$gateway->setSignatureKey('signature-key');

$requestData = [
    'amount'=>'1000', 
    'currency'=> 'PLN'
];

try {
    $response = $gateway->fetchPaymentMethods($requestData)->send();
} catch (\Exception $e) {
    // catch errors
}

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

Support

If you have any questions or issues regarding paynow, please contact our support at support@paynow.pl.

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固