定制 stanley89/spayd-php 二次开发

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

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

stanley89/spayd-php

Composer 安装命令:

composer require stanley89/spayd-php

包简介

PHP implementation of SmartPaymentDescriptor Generator.

README 文档

README

SmartPaymentDescriptor is a lightweight format for exchanging a payment information. A vCard for payment instead of contacts, if you will..

This PHP library simplifies adding the support for generating/validating the SmartPaymentDescriptor (both file and QR code generation) to any PHP application.

Original Java implementation: https://github.com/spayd/spayd-java

Installation

Use Composer to install the library.

$ composer require stanley89/spayd-php

Basic usage

use Spayd\String\SpaydPaymentAttributes;
use Spayd\String\SpaydExtendedPaymentAttributeMap;
use Spayd\String\SpaydPayment;
use Spayd\Model\Account\CzechBankAccount;
use Spayd\Utilities\SpaydQRUtils;

$parameters = new SpaydPaymentAttributes();
$parameters->setBankAccount(new CzechBankAccount("19", "123", "0800"));

$parameters->setAmount("1");
$parameters->setCurrency("CZK");
$parameters->setDate(new \DateTime("2018-12-06"));
$parameters->setRecipientName("Jan Novák");
$parameters->setMessage("Příliš žluťoučký kůň úpěl ďábelské ódy.");
$extendedParameters = new SpaydExtendedPaymentAttributeMap(["VS" => 123, "SS" => 456, "KS" => 558]);
$transliterateParams = true;
$result = SpaydPayment::paymentStringFromAccount($parameters, $extendedParameters, $transliterateParams);

$qrCode = SpaydQRUtils::getQRCode(null,  $result, true);
$qrCode->writeFile(__DIR__.'/qrcode.png');

License

The sources are available under Apache 2.0 License

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-10-31