定制 digitickets/omnipay-savvy-gift-card 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

digitickets/omnipay-savvy-gift-card

最新稳定版本:v1.0.0

Composer 安装命令:

composer require digitickets/omnipay-savvy-gift-card

包简介

Savvy Gift Card driver for the Omnipay payment processing library

README 文档

README

Savvy Gift Card redemptions driver for the Omnipay PHP payment processing library

Omnipay implementation of Savvy Gift Card redemption. Obviously it's not a payment gateway, but it behaves in a similar way.

See their technical documentation for more details.

Build Status Latest Stable Version Total Downloads

Installation

Important: Driver requires PHP's Intl extension to be installed.

The Savvy Gift Card Omnipay driver is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "digitickets/omnipay-savvy-gift-card": "^1.0"
    }
}

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

What's Included

The driver for Savvy Gift Cards. It allows you to validate and redeem a card, and reverse a previous redemption.

It supports making requests with and without a PIN.

It can automatically revert a redemption where there were insufficient funds.

What's Not Included

This driver does not handle any of the other card management operations, such as loading a card, unfreezing, unloading, doing an ad hoc refund, etc.

Basic Usage

For the driver in this repo, there are voucher-type requests, namely validate, redeem and unredeem, and there is a subset of the normal "Omnipay" requests, namely authorize, purchase and refund.

Use the voucher-type requests when you're treating the vouchers as vouchers; use the "Omnipay" requests when you are treating them as payments.

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

Running with/without a PIN

By default, the driver assumes that you are using PINs; it will call the endpoints that require a PIN.

There is a parameter, usePIN. If true, it assumes you are using PINs. If false, it assumes you are not using PINs and will call the "*nopin" endpoints where necessary. It defaults to true.

Handling redemptions with insufficient funds

If you attempt to redeem a gift card where the redemption amount is greater than the current balance on the card, the API will reduce the current balance to zero and return a response code of "30".

This is not ideal as money has been taken off the card, but the API returns an error.

There is therefore a parameter, failOnInsufficientFunds to say what to do. If true, it will immediately revert the redemption (so the card ends up with the balance that it started with) and will return the original, error, response.

If set to false, it will simply adjust the response to have a response code of "0" and an amount equal to the actual amount taken off the card, and do nothing else. In this case, it's up to the merchant to compare the requested amount with the response amount to detect if there were insufficient funds.

Support

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 believe you have found a bug in this driver, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-15