jybtx / cybersource
CyberSource PHP SOAP client
dev-master
2021-06-30 07:49 UTC
Requires
- php: >=7.1
- ext-curl: *
- ext-openssl: *
- ext-soap: *
This package is auto-updated.
Last update: 2025-03-29 00:49:06 UTC
README
CyberSource PHP SOAP client.
Installing
$ composer require jybtx/cybersource -vvv
Usage
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);
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT