Omnipay는 PHP 용 결제 처리 라이브러리입니다. Active Merchant의 아이디어와 [CI Merchant]를 위한 수십 개의 게이트웨이 구현 경험을 바탕으로 설계되었습니다. 명확하고 일관된 API를 가지고 있으며, 완전히 단위 테스트를 거쳤으며, 시작하는 데 도움이 되는 예제 애플리케이션도 함께 제공됩니다.
https://omnipay.thephpleague.com/
https://github.com/thephpleague/omnipay
use Omnipay\Omnipay; $gateway = Omnipay::create('Stripe'); $gateway->setApiKey('abc123'); $formData = array('number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2030', 'cvv' => '123'); $response = $gateway->purchase(array('amount' => '10.00', 'currency' => 'USD', 'card' => $formData))->send(); if ($response->isRedirect()) { // redirect to offsite payment gateway $response->redirect(); } elseif ($response->isSuccessful()) { // payment was successful: update database print_r($response); } else { // payment failed: display message to customer echo $response->getMessage(); }
등록된 댓글이 없습니다.