gawel1 / payline-zf2
此软件包最新版本(dev-master)没有可用的许可证信息。
使用 Payline SDK 的 ZF2 模块
dev-master
2014-09-22 13:31 UTC
This package is not auto-updated.
Last update: 2024-09-24 06:56:50 UTC
README
基于 Payline SDK,Payline-zf2 允许您在 zf2 服务中使用它。Payline 是一种在线进行信用卡支付的方式。
安装
此软件包可通过 Composer 以 gawel1/payline-zf2 的方式安装。
使用方法
基本使用
首先,将应用配置中的 payline.local.php.dist 复制到您的应用中,并使用您自己的配置设置文件。然后,您可以使用以下代码获取 payline 服务:
$this->getServiceLocator()->get('payline');
进行网络支付
$uri = $this->getRequest()->getUri(); $base = sprintf('%s://%s', $uri->getScheme(), $uri->getHost()); $response = $this->getServiceLocator->get('payline')->doWebPayment([ 'returnURL' => $base . $this->url()->fromRoute('home'), 'cancelURL' => $base . $this->url()->fromRoute('home'), 'payment' => [ 'amount' => 100, 'action' => 101, 'currency' => 978, 'mode' => PaylineService::CASH_PAYMENT, 'contractNumber' => $this->getServiceLocator()->get('config')['payline']['contractNumber'] ], 'order' => [ 'amount' => 100, 'ref' => 1, 'currency' => 978 ] ]);
Payline 网络服务信息
要了解更多关于 Payline 和 API 的信息,请下载 此文档。
要了解更多关于 Payline SDK 的信息,请下载 此文档