globalpayments / payment-gateway-provider
1.0.0
2021-05-18 12:24 UTC
Requires
- globalpayments/php-sdk: ^2.2
Requires (Dev)
- phpstan/phpstan: ^0.12.69
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
README
Installation
composer require globalpayments/payment-gateway-provider
Examples
use GlobalPayments\PaymentGatewayProvider\Data\Order; use GlobalPayments\PaymentGatewayProvider\Gateways\TransitGateway; $gateway = new TransitGateway(); // configure gateway settings $gateway->merchantId = ''; $gateway->userId = ''; $gateway->password = ''; $gateway->deviceId = ''; $gateway->tsepDeviceId = ''; $gateway->transactionKey = ''; $gateway->isProduction = false; $gateway->developerId = ''; $gateway->paymentAction = TransitGateway::TXN_TYPE_AUTHORIZE; // admin $gateway->getFrontendGatewayOptions(); $gateway->getBackendGatewayOptions(); $gateway->getFirstLineSupportEmail(); $gateway->securePaymentFieldsConfiguration(); $gateway->securePaymentFieldHtmlFormat(); // order information $order = new Order(); $order->amount = ''; // total / original amount $order->authorizationAmount = ''; // new authorization amount for reversals $order->billingAddress = array(); $order->cardData = array(); $order->cardHolderName = ''; $order->currency = ''; $order->description = ''; $order->requestMultiUseToken = false; $order->shippingAddress = array(); // submitting requests $response = $gateway->createTransactionKey(); $response = $gateway->createManifest(); $response = $gateway->processPayment($order); $response = $gateway->addPaymentMethod($order); $response = $gateway->processRefund($order); $response = $gateway->getTransactionDetails($order);