digistorm/omnipay-rdp
最新稳定版本:2.0.0
Composer 安装命令:
composer require digistorm/omnipay-rdp
包简介
Red Dot Payment driver for the Omnipay payment processing library
README 文档
README
RDP (Red Dot Payment) driver for the Omnipay PHP payment processing library
Currently only supports purchases with tokenized card. Available methods:
- createToken()
- purchase()
Usage
<?php use Omnipay\Omnipay; use Omnipay\Common\CreditCard; use Money\Currency; use Money\Money; // Create a gateway for the Rdp Gateway // (routes to GatewayFactory::create) /* @var \Omnipay\Rdp\Gateway $gateway */ $gateway = Omnipay::create('Rdp'); $gateway->setTestMode(true); $gateway->setEndpointBase('https://secure-dev.reddotpayment.com/'); $gateway->setMerchantId('merchantIdValue'); $gateway->setSecretKey('secretKeyValue'); // Tokenize a card /* @var \Omnipay\Rdp\Message\TokenResponse $response */ $response = $gateway->createToken([ 'card' => new CreditCard([ 'firstName' => 'John', 'lastName' => 'Doe', 'expiryMonth' => '09', 'expiryYear' => '2029', 'number' => '4444333322221111', 'cvv' => '123', ]), 'email' => 'john.doe@example.com', 'order_id' => 'cba', ])->send(); // Charge using a card /* @var \Omnipay\Rdp\Message\PurchaseResponse $response */ $response = $gateway->purchase([ 'card' => new CreditCard([ 'firstName' => 'John', 'lastName' => 'Doe', 'expiryMonth' => '09', 'expiryYear' => '2029', 'number' => '4444333322221111', 'cvv' => '123', ]), 'payer_id' => $response->payer_id, 'payer_name' => 'John Doe', 'payer_email' => 'john.doe@example.com', 'orderId' => 'abc', 'money' => new Money(100, new Currency('SGD')), ])->send();
统计信息
- 总下载量: 1.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-10-06