PHP code example of kksoftwareag / first-data-gateway
1. Go to this page and download the library: Download kksoftwareag/first-data-gateway library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kksoftwareag / first-data-gateway example snippets
namespace FirstData\FirstApi\Client\Simple;
class MerchantCredentials {
/**
* @param string $apiSecret
* @param string $apiKey
*/
public function __construct($apiSecret, $apiKey);
// ...
}
namespace FirstData\FirstApi\Client\Simple;
class ClientContext {
/**
* base path defaults to https://cert.api.firstdata.com/gateway
*
* @param MerchantCredentials $creds
* @param string $apiBasePath (optional)
* @param string $defaultRegion (optional)
* @param string $defaultStoreId (optional)
* @return ClientContext
*/
public static function create(MerchantCredentials $creds, $apiBasePath = ClientContext::DEFAULT_BASE_PATH, $defaultRegion = null, $defaultStoreId = null);
/**
* @return ClientFactory
*/
public function getFactory();
/**
* @param string $basePath
*/
public function setApiBasePath($basePath);
// ...
}
namespace FirstData\FirstApi\Client\Simple;
class ClientFactory {
/**
* @return AuthenticationApi
*/
public function getAuthenticationApi();
/**
* @return CardInfoLookupApi
*/
public function getCardInfoLookupApi();
/**
* @return CardVerificationApi
*/
public function getCardVerificationApi();
/**
* @return CurrencyConversionApi
*/
public function getCurrencyConversionApi();
/**
* @return FraudDetectApi
*/
public function getFraudDetectApi();
/**
* @return OrderApi
*/
public function getOrderApi();
/**
* @return PaymentApi
*/
public function getPaymentApi();
/**
* @return PaymentSchedulesApi
*/
public function getPaymentSchedulesApi();
/**
* @return PaymentTokenApi
*/
public function getPaymentTokenApi();
/**
* @return PaymentUrlApi
*/
public function getPaymentUrlApi();
// ...
}
namespace FirstData\FirstApi\Client\Simple;
use FirstData\FirstApi\Client\Model\AccessTokenResponse;
use FirstData\FirstApi\Client\Model\ErrorResponse;
class AuthenticationApi {
/**
* @return AccessTokenResponse|ErrorResponse
*/
public function authenticationAccessTokensPost();
// ...
}
namespace FirstData\FirstApi\Client\Simple;
use FirstData\FirstApi\Client\Model\CardInfoLookupRequest;
use FirstData\FirstApi\Client\Model\CardInfoLookupResponse;
use FirstData\FirstApi\Client\Model\ErrorResponse;
class CardInfoLookupApi {
/**
* @param CardInfoLookupRequest $payload
* @param string $region (optional)
* @return CardInfoLookupResponse|ErrorResponse
*/
public function cardInfoLookup(CardInfoLookupRequest $payload, $region = null);
// ...
}
namespace FirstData\FirstApi\Client\Simple;
use FirstData\FirstApi\Client\Model\CardVerificationRequest;
use FirstData\FirstApi\Client\Model\TransactionResponse;
use FirstData\FirstApi\Client\Model\ErrorResponse;
class CardVerificationApi {
/**
* @param CardVerificationRequest $payload
* @param string $region (optional)
* @return TransactionResponse|ErrorResponse
*/
public function verifyCard(CardVerificationRequest $payload, $region = null);
// ...
}
namespace FirstData\FirstApi\Client\Simple;
use FirstData\FirstApi\Client\Model\ExchangeRateRequest;
use FirstData\FirstApi\Client\Model\ExchangeRateResponse;
use FirstData\FirstApi\Client\Model\ErrorResponse;
class CurrencyConversionApi {
/**
* @param ExchangeRateRequest $payload
* @param string $region (optional)
* @return ExchangeRateResponse|ErrorResponse
*/
public function getExchangeRate(ExchangeRateRequest $payload, $region = null);
// ...
}
namespace FirstData\FirstApi\Client\Simple;
use FirstData\FirstApi\Client\Model\ScoreOnlyRequest;
use FirstData\FirstApi\Client\Model\ScoreOnlyResponse;
use FirstData\FirstApi\Client\Model\ClientRegistration;
use FirstData\FirstApi\Client\Model\PaymentRegistration;
use FirstData\FirstApi\Client\Model\FraudRegistrationResponse;
use FirstData\FirstApi\Client\Model\ErrorResponse;
class FraudDetectApi {
/**
* @param ScoreOnlyRequest $payload
* @param string $region (optional)
* @return ScoreOnlyResponse|ErrorResponse
*/
public function scoreOnly(ScoreOnlyRequest $payload, $region = null);
/**
* Operation Client Registration
*
* CLient Registration for fraud
*
* @param ClientRegistration $payload payload (onse
*/
public function fraudPaymentRegistrationPost(PaymentRegistration $payload,$region = null);
// ...
}
namespace FirstData\FirstApi\Client\Simple;
use FirstData\FirstApi\Client\Model\OrderResponse;
use FirstData\FirstApi\Client\Model\SecondaryTransaction;
use FirstData\FirstApi\Client\Model\TransactionResponse;
use FirstData\FirstApi\Client\Model\ErrorResponse;
class OrderApi {
/**
* @param string $orderId
* @param string $region (optional)
* @param string $storeId (optional)
* @return OrderResponse|ErrorResponse
*/
public function orderInquiry($orderId, $region = null, $storeId = null);
/**
* @param string $orderId
* @param SecondaryTransaction $payload
* @param string $region (optional)
* @param string $storeId (optional)
* @return TransactionResponse|ErrorResponse
*/
public function submitSecondaryTransaction($orderId, SecondaryTransaction $payload, $region = null, $storeId = null);
}
namespace FirstData\FirstApi\Client\Simple;
use FirstData\FirstApi\Client\Model\AuthenticationVerificationRequest;
use FirstData\FirstApi\Client\Model\PrimaryTransaction;
use FirstData\FirstApi\Client\Model\SecondaryTransaction;
use FirstData\FirstApi\Client\Model\TransactionResponse;
use FirstData\FirstApi\Client\Model\ErrorResponse;
class PaymentApi {
/**
* @param string $transactionId
* @param AuthenticationResponseVerificationRequest $payload
* @param string $region (optional)
* @return TransactionResponse|ErrorResponse
*/
public function finalizeSecureTransaction($transactionId, AuthenticationVerificationRequest $payload, $region = null);
/**
* @param PrimaryTransaction $payload
* @param string $region (optional)
* @return TransactionResponse|ErrorResponse
*/
public function primaryPaymentTransaction(PrimaryTransaction $payload, $region = null);
/**
* @param string $transactionId
* @param SecondaryTransaction $payload
* @param string $region (optional)
* @param string $storeId (optional)
* @return TransactionResponse|ErrorResponse
*/
public function secondaryPaymentTransaction($transactionId, SecondaryTransaction $payload, $region = null, $storeId = null);
/**
* @param string $transactionId
* @param string $region (optional)
* @param string $storeId (optional)
* @return TransactionResponse|ErrorResponse
*/
public function transactionInquiry($transactionId, $region = null, $storeId = null);
// ...
}
namespace FirstData\FirstApi\Client\Simple;
use FirstData\FirstApi\Client\Model\PaymentSchedulesRequest;
use FirstData\FirstApi\Client\Model\PaymentSchedulesResponse;
use FirstData\FirstApi\Client\Model\RecurringPaymentDetailsResponse;
use FirstData\FirstApi\Client\Model\ErrorResponse;
class PaymentSchedulesApi {
/**
* @param string $orderId
* @param string $region (optional)
* @param string $storeId (optional)
* @return PaymentSchedulesResponse|ErrorResponse
*/
public function cancelPaymentSchedule($orderId, $region = null, $storeId = null);
/**
* @param PaymentSchedulesRequest $payload
* @param string $region (optional)
* @return PaymentSchedulesResponse|ErrorResponse
*/
public function createPaymentSchedule(PaymentSchedulesRequest $payload, $region = null);
/**
* @param string $orderId
* @param string $region (optional)
* @param string $storeId (optional)
* @return RecurringPaymentDetailsResponse|ErrorResponse
*/
public function inquiryPaymentSchedule($orderId, $region = null, $storeId = null);
/**
* @param string $orderId
* @param PaymentSchedulesRequest $payload
* @param string $region (optional)
* @param string $storeId (optional)
* @return PaymentSchedulesResponse|ErrorResponse
*/
public function updatePaymentSchedule($orderId, PaymentSchedulesRequest $payload, $region = null, $storeId = null);
// ...
}