jybtx / cybersource

CyberSource PHP SOAP客户端

dev-master 2021-06-30 07:49 UTC

This package is auto-updated.

Last update: 2024-09-29 06:02:55 UTC


README

CyberSource PHP SOAP客户端。

安装

$ composer require jybtx/cybersource -vvv

用法

use CyberSource;

$request = CyberSource::createRequest();
// 银行卡信息
$card = new stdClass();
$card->accountNumber = '4622 9431 2701 3705';
$card->expirationMonth = '12';
$card->expirationYear = '22';
$request->card = $card;

$ccAuthService = new stdClass();
$ccAuthService->run = 'true';
$request->ccAuthService = $ccAuthService;

$ccCaptureService = new stdClass();
$ccCaptureService->run = 'true';
$request->ccCaptureService = $ccCaptureService;

// 个人信息
$billTo = new stdClass();
$billTo->firstName = 'first name';
$billTo->lastName = 'last name';
$billTo->street1 = '1295 Charleston Road';
$billTo->city = 'Mountain View';
$billTo->state = 'CA';
//        $billTo->postalCode = '838';
$billTo->country = 'CN';
$billTo->email = 'xx@xx.com';
$billTo->ipAddress = request()->ip();
$request->billTo = $billTo;
//
$purchaseTotals = new stdClass();
$purchaseTotals->currency = 'USD';
$purchaseTotals->grandTotalAmount = '0.1';
$request->purchaseTotals = $purchaseTotals;

$reply = CyberSource::runTransaction($request);
dd($reply);

贡献

你可以通过以下三种方式之一进行贡献

  1. 使用问题跟踪器提交错误报告。
  2. 问题跟踪器上回答问题或修复错误。
  3. 贡献新功能或更新wiki。

代码贡献过程并不非常正式。你只需要确保遵循PSR-0、PSR-1和PSR-2编码指南。任何新的代码贡献都必须附上适用的单元测试。

许可协议

MIT