Файловый менеджер - Редактировать - /var/www/html/firstdata.zip
Ðазад
PK ! 3ٛ�� � src/GlobalGateway.phpnu �[��� <?php /** * First Data Global Gateway */ namespace Omnipay\FirstData; /** * First Data Global Gateway * * This gateway has been deprecated and is now called the "Payeezy" Gateway. */ class GlobalGateway extends PayeezyGateway { } PK ! ��{; ; src/WebserviceGateway.phpnu �[��� <?php /** * First Data Webservice Gateway */ namespace Omnipay\FirstData; use Omnipay\Common\AbstractGateway; /** * First Data Webservice Gateway * * The Webservice Gateway was originally called the LinkPoint Gateway but since First Data's * acquisition of LinkPoint it is now known as the First Data Global Gateway Web Service API. * As of this writing the Global Gateway Web Service API version 9.0 is supported. It is * referred to here as the "First Data Webservice" gateway. * * ### Quirks * * #### WSDL * * There is currently a roadblock with the implementation of this gateway in that the * WSDL is not recognised as valid by PHP's SOAP client. * * See this bug: https://bugs.php.net/bug.php?id=43868 * * PHP Fatal error: SOAP-ERROR: Parsing Schema: element * 'http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi:FDGGWSApiOrderRequest' * already defined in omnipay-firstdata/src/Soap/BaseSoapClient.php on line 121 * * In this gateway code we have ignored the SOAP thing completely and just constructed XML * messages to send to the gateway POST URL directly, using templates and lots of string * substitution. * * https://ws.firstdataglobalgateway.com:443/fdggwsapi/services * * Neither the native PHP SOAP client nor the BeSimple SOAP client work at all dealing * with the WSDL. * * In addition, sending a properly formed SOAP message with an XML header (of * the type <?xml ... ?>) throws an error message. The XML header must be * omitted. * * To be honest I have better things to spend my time on than dealing with such * nonsense. If people can't drag themselves out of the 19th century and use * REST APIs instead of SOAP then they can at least have the good grace and * common courtesy to get their XML handling and formatting correct. * * #### Transaction ID * * A user supplied transaction ID (transactionId parameter) must be supplied for each * purchase() or authorize() request. This is known as "OrderId" in the Webservice Gateway. * * The First Data Webservice Gateway Web Service API only accepts ASCII characters. The Order * ID cannot contain the following characters: &, %, /, or exceed 100 characters in length. * The Order ID will be restricted in such a way so that it can only accepts alpha numeric * (a-z, A-Z, 0-9) and some special characters for merchants convenience. * * #### Voids and Refunds * * Voids and Refunds require both the transactionId and the TDATE parameter returned * from the purchase (or capture) call. To make things cleaner for calling applicatons, * the transactionReference returned by getTransactionReference() after the purhcase * or capture call is the transactionId and the TDATE concatenated together and * separated by '::'. * * Refunds require an amount parameter. The amount parameter is ignored by the void * call. * * ### Authentication * * Within the SSL connection (see below), authentication is done via HTTP Basic Auth. * * First Data should provide you, as part of the connection package, a username and a * password. The username will be of the form WS*******._.1 and the password will be * a string containing letters and numbers. Provide these as the userName and password * parameters when initializing the gateway. * * ### SSL Connection Security * * The Web Service API requires an SSL connection with client and server exchanging * certificates to guarantee this level of security. The client and server certificates * each uniquely identify the party. * * First Data should provide you, as part of the connection package, at least the * following files: * * * WS____.pem (certificate file) * * WS____.key (key file) * * WS____.key.pw.txt (text file containing the password for the key) * * ... where WS___ is your username also provided by First Data (see above). * * You need to store the certificate file and the key file on disk somewhere and * pass the following parameters when initializing the gateway: * * * sslCertificate -- on disk location of the .pem certificate file. * * sslKey -- on disk location of the .key file. * * sslKeyPassword -- the password for the key (not the file name) * * In case First Data provide you with a .p12 (PKCS-12) file for the certificate * instead of a PEM file, you will need to convert the .p12 file to a .pem file * using this command: * * ``` * openssl pkcs12 -in WS____.p12 -out WS____.1.pem -clcerts -nokeys * ``` * * ### Test Accounts * * To obtain a test account, use this form: * http://www.firstdata.com/gg/apply_test_account.htm * * ### Example * * This is an example of a purchase request. * * <code> * // Create a gateway for the First Data Webservice Gateway * // (routes to GatewayFactory::create) * $gateway = Omnipay::create('FirstData_Webservice'); * * // Initialise the gateway * $gateway->initialize(array( * 'sslCertificate' => 'WS9999999._.1.pem', * 'sslKey' => 'WS9999999._.1.key', * 'sslKeyPassword' => 'sslKEYpassWORD', * 'userName' => 'WS9999999._.1', * 'password' => 'passWORD', * 'testMode' => true, * )); * * // Create a credit card object * $card = new CreditCard(array( * 'firstName' => 'Example', * 'lastName' => 'Customer', * 'number' => '4222222222222222', * 'expiryMonth' => '01', * 'expiryYear' => '2020', * 'cvv' => '123', * 'email' => 'customer@example.com', * 'billingAddress1' => '1 Scrubby Creek Road', * 'billingCountry' => 'AU', * 'billingCity' => 'Scrubby Creek', * 'billingPostcode' => '4999', * 'billingState' => 'QLD', * )); * * // Do a purchase transaction on the gateway * $transaction = $gateway->purchase(array( * 'accountId' => '12345', * 'amount' => '10.00', * 'currency' => 'USD', * 'description' => 'Super Deluxe Excellent Discount Package', * 'transactionId' => 12345, * 'clientIp' => $_SERVER['REMOTE_ADDR'], * 'card' => $card, * )); * $response = $transaction->send(); * if ($response->isSuccessful()) { * echo "Purchase transaction was successful!\n"; * $sale_id = $response->getTransactionReference(); * echo "Transaction reference = " . $sale_id . "\n"; * } * </code> * * @link https://www.firstdata.com/downloads/pdf/FDGG_Web_Service_API_v9.0.pdf */ class WebserviceGateway extends AbstractGateway { public function getName() { return 'First Data Webservice'; } public function getDefaultParameters() { return array( 'sslCertificate' => '', 'sslKey' => '', 'sslKeyPassword' => '', 'userName' => '', 'password' => '', 'testMode' => false, ); } /** * Get SSL Certificate file name * * You must establish a secure communication channel to send the HTTP request. * This ensures that the data sent between your client application and the First * Data Webservice Gateway Web Service API is encrypted and that both parties can * be sure they are communicating with each other and no one else. * * The Web Service API requires an SSL connection with client and server exchanging * certificates to guarantee this level of security. The client and server certificates * each uniquely identify the party. * * @return string */ public function getSslCertificate() { return $this->getParameter('sslCertificate'); } /** * Set SSL Certificate file name * * You must establish a secure communication channel to send the HTTP request. * This ensures that the data sent between your client application and the First * Data Webservice Gateway Web Service API is encrypted and that both parties can * be sure they are communicating with each other and no one else. * * The Web Service API requires an SSL connection with client and server exchanging * certificates to guarantee this level of security. The client and server certificates * each uniquely identify the party. * * @param string $value * @return WebserviceGateway provides a fluent interface. */ public function setSslCertificate($value) { return $this->setParameter('sslCertificate', $value); } /** * Get SSL Key file name * * You must establish a secure communication channel to send the HTTP request. * This ensures that the data sent between your client application and the First * Data Webservice Gateway Web Service API is encrypted and that both parties can * be sure they are communicating with each other and no one else. * * The Web Service API requires an SSL connection with client and server exchanging * certificates to guarantee this level of security. The client and server certificates * each uniquely identify the party. * * @return string */ public function getSslKey() { return $this->getParameter('sslKey'); } /** * Set SSL Key file name * * You must establish a secure communication channel to send the HTTP request. * This ensures that the data sent between your client application and the First * Data Webservice Gateway Web Service API is encrypted and that both parties can * be sure they are communicating with each other and no one else. * * The Web Service API requires an SSL connection with client and server exchanging * certificates to guarantee this level of security. The client and server certificates * each uniquely identify the party. * * @param string $value * @return WebserviceGateway provides a fluent interface. */ public function setSslKey($value) { return $this->setParameter('sslKey', $value); } /** * Get SSL Key password * * You must establish a secure communication channel to send the HTTP request. * This ensures that the data sent between your client application and the First * Data Global Gateway Web Service API is encrypted and that both parties can * be sure they are communicating with each other and no one else. * * The Web Service API requires an SSL connection with client and server exchanging * certificates to guarantee this level of security. The client and server certificates * each uniquely identify the party. * * @return string */ public function getSslKeyPassword() { return $this->getParameter('sslKeyPassword'); } /** * Set SSL Key password * * You must establish a secure communication channel to send the HTTP request. * This ensures that the data sent between your client application and the First * Data Global Gateway Web Service API is encrypted and that both parties can * be sure they are communicating with each other and no one else. * * The Web Service API requires an SSL connection with client and server exchanging * certificates to guarantee this level of security. The client and server certificates * each uniquely identify the party. * * @param string $value * @return WebserviceGateway provides a fluent interface. */ public function setSslKeyPassword($value) { return $this->setParameter('sslKeyPassword', $value); } /** * Get Username * * Calls to the Global Gateway API are secured with a username and * password sent via HTTP Basic Authentication. * * @return string */ public function getUserName() { return $this->getParameter('userName'); } /** * Set Username * * Calls to the Global Gateway API are secured with a username and * password sent via HTTP Basic Authentication. * * @param string $value * @return WebserviceGateway provides a fluent interface. */ public function setUserName($value) { return $this->setParameter('userName', $value); } /** * Get Password * * Calls to the Global Gateway API are secured with a username and * password sent via HTTP Basic Authentication. * * @return string */ public function getPassword() { return $this->getParameter('password'); } /** * Set Password * * Calls to the Global Gateway API are secured with a username and * password sent via HTTP Basic Authentication. * * @param string $value * @return WebserviceGateway provides a fluent interface. */ public function setPassword($value) { return $this->setParameter('password', $value); } /** * Create a purchase request. * * @param array $parameters * @return \Omnipay\FirstData\Message\WebservicePurchaseRequest */ public function purchase(array $parameters = array()) { return $this->createRequest('\Omnipay\FirstData\Message\WebservicePurchaseRequest', $parameters); } /** * Create an authorize request. * * @param array $parameters * @return \Omnipay\FirstData\Message\WebserviceAuthorizeRequest */ public function authorize(array $parameters = array()) { return $this->createRequest('\Omnipay\FirstData\Message\WebserviceAuthorizeRequest', $parameters); } /** * Create a capture request. * * @param array $parameters * @return \Omnipay\FirstData\Message\WebserviceCaptureRequest */ public function capture(array $parameters = array()) { return $this->createRequest('\Omnipay\FirstData\Message\WebserviceCaptureRequest', $parameters); } /** * Create a void request. * * @param array $parameters * @return \Omnipay\FirstData\Message\WebserviceVoidRequest */ public function void(array $parameters = array()) { return $this->createRequest('\Omnipay\FirstData\Message\WebserviceVoidRequest', $parameters); } /** * Create a refund request. * * @param array $parameters * @return \Omnipay\FirstData\Message\WebserviceRefundRequest */ public function refund(array $parameters = array()) { return $this->createRequest('\Omnipay\FirstData\Message\WebserviceRefundRequest', $parameters); } } PK ! ��b b src/ConnectGateway.phpnu �[��� <?php /** * First Data Connect Gateway */ namespace Omnipay\FirstData; use Omnipay\Common\AbstractGateway; /** * First Data Connect Gateway * * The First Data Global Gateway Connect 2.0 is a simple payment solution for connecting an * online store to the First Data Global Gateway. It is referred to here as the "First Data * Connect" gateway, currently at version 2.0. * * First Data Connect supports both a redirect method of payment and a direct post * method of payment. So far only the direct post method of payment is supported by * this gateway code. * * ### Form Hosting * * First Data Global Gateway Connect 2.0 allows two ways for collecting payment: * * * A redirect mode which uses the ready-made form pages for the payment process that * First Data provides. With this option, you forward your customers to First Data * for payment. They enter the cardholder data on First Data’s payment page. * Afterwards, Connect 2.0 redirects the customer back to your website and notifies * your website of the payment result. * * * You can create your own payment forms and host them on your server. Although your * server hosts the forms, your website sends the cardholder data directly from the * customer to the First Data Global Gateway * * ### Payment Modes * * First Data Global Gateway Connect 2.0 supports three different payment modes. * * * In PayOnly mode, First Data Global Gateway Connect 2.0 collects the minimum * information needed to process a transaction. * * * In PayPlus mode, First Data Global Gateway Connect 2.0 collects the same payment * information as in PayOnly mode plus a full set of billing information. * * * In FullPay mode, First Data Global Gateway Connect 2.0 collects the same payment * and billing information collected in PayPlus mode plus shipping information. * * ### Test Accounts * * You can apply for a test account at this URL: * * http://www.firstdata.com/product_solutions/ecommerce/global_gateway/index.htm * * There are some issues with obtaining shared secrets for testing Connect 2.0. * * ### Example * * <code> * // Create a gateway for the First Data Connect Gateway * // (routes to GatewayFactory::create) * $gateway = Omnipay::create('FirstData_Connect'); * * // Initialise the gateway * $gateway->initialize(array( * 'storeId' => '12341234', * 'sharedSecret' => 'IcantTELLyouITSaSECRET', * 'testMode' => true, // Or false when you are ready for live transactions * )); * * // Do a purchase transaction on the gateway * $transaction = $gateway->purchase(array( * 'description' => 'Your order for widgets', * 'amount' => '10.00', * 'transactionId' => 12345, * )); * $response = $transaction->send(); * if ($response->isSuccessful()) { * echo "Purchase transaction was successful!\n"; * $sale_id = $response->getTransactionReference(); * echo "Transaction reference = " . $sale_id . "\n"; * } * </code> * * @link https://www.firstdata.com/downloads/pdf/FDGG_Connect_2.0_Integration_Manual_v2.0.pdf */ class ConnectGateway extends AbstractGateway { public function getName() { return 'First Data Connect'; } public function getDefaultParameters() { return array( 'storeId' => '', 'sharedSecret' => '', 'testMode' => false, ); } /** * Set Store ID * * Calls to the Connect Gateway API are secured with a store ID and * shared secret. * * @return ConnectGateway provides a fluent interface */ public function setStoreId($value) { return $this->setParameter('storeId', $value); } /** * Get Store ID * * Calls to the Connect Gateway API are secured with a store ID and * shared secret. * * @return string */ public function getStoreId() { return $this->getParameter('storeId'); } /** * Set Shared Secret * * Calls to the Connect Gateway API are secured with a store ID and * shared secret. * * @return ConnectGateway provides a fluent interface */ public function setSharedSecret($value) { return $this->setParameter('sharedSecret', $value); } /** * Get Shared Secret * * Calls to the Connect Gateway API are secured with a store ID and * shared secret. * * @return string */ public function getSharedSecret() { return $this->getParameter('sharedSecret'); } /** * Create a purchase request. * * @param array $parameters * @return \Omnipay\FirstData\Message\PurchaseRequest */ public function purchase(array $parameters = array()) { return $this->createRequest('\Omnipay\FirstData\Message\PurchaseRequest', $parameters); } /** * Create a complete purchase request. * * @param array $parameters * @return \Omnipay\FirstData\Message\CompletePurchaseRequest */ public function completePurchase(array $parameters = array()) { return $this->createRequest('\Omnipay\FirstData\Message\CompletePurchaseRequest', $parameters); } } PK ! `B�Xi i % src/Message/WebserviceVoidRequest.phpnu �[��� <?php /** * First Data Webservice Void Request */ namespace Omnipay\FirstData\Message; /** * First Data Webservice Void Request * * ### Example * * <code> * // Create a gateway for the First Data Webservice Gateway * // (routes to GatewayFactory::create) * $gateway = Omnipay::create('FirstData_Webservice'); * * // Initialise the gateway * $gateway->initialize(array( * 'sslCertificate' => 'WS9999999._.1.pem', * 'sslKey' => 'WS9999999._.1.key', * 'sslKeyPassword' => 'sslKEYpassWORD', * 'userName' => 'WS9999999._.1', * 'password' => 'passWORD', * 'testMode' => true, * )); * * // Do a void transaction on the gateway. This assumes that a purchase * // request has been successful, and that the transactionReference from the * // purchase request is stored in $sale_id. * $transaction = $gateway->void(array( * 'transactionReference' => $sale_id, * )); * $response = $transaction->send(); * if ($response->isSuccessful()) { * echo "Void transaction was successful!\n"; * $sale_id = $response->getTransactionReference(); * echo "Transaction reference = " . $sale_id . "\n"; * } * </code> * * ### Quirks * * In the case of a captured authorization, the transaction reference passed * to void() must be the transaction reference returned from the capture() * request and not the transaction reference from the original authorize() * request. */ class WebserviceVoidRequest extends WebserviceAbstractRequest { /** @var string XML template for the void request */ protected $xmlTemplate = ' <fdggwsapi:FDGGWSApiOrderRequest xmlns:v1="http://secure.linkpt.net/fdggwsapi/schemas_us/v1" xmlns:fdggwsapi="http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi"> <v1:Transaction> <v1:CreditCardTxType> <v1:Type>%txn_type%</v1:Type> </v1:CreditCardTxType> <v1:TransactionDetails> <v1:OrderId>%reference_no%</v1:OrderId> <v1:TDate>%tdate%</v1:TDate> </v1:TransactionDetails> </v1:Transaction> </fdggwsapi:FDGGWSApiOrderRequest> '; /** @var string Transaction type */ protected $txn_type = 'void'; public function getData() { $data = parent::getData(); $data['txn_type'] = $this->txn_type; $this->validate('transactionReference'); // Fetch the original transaction reference and tdate from the // concatenated transactionReference returned by the purchase() // request. $transaction_reference = $this->getTransactionReference(); list($orderid, $tdate) = explode('::', $transaction_reference); $data['reference_no'] = $orderid; $data['tdate'] = $tdate; return $data; } } PK ! ��:� � src/Message/PayeezyResponse.phpnu �[��� <?php /** * First Data Payeezy Response */ namespace Omnipay\FirstData\Message; use Omnipay\Common\Message\AbstractResponse; use Omnipay\Common\Message\RequestInterface; /** * First Data Payeezy Response * * ### Quirks * * This gateway requires both a transaction reference (aka an authorization number) * and a transaction tag to implement either voids or refunds. These are referred * to in the documentation as "tagged refund" and "tagged voids". * * The transaction reference returned by this class' getTransactionReference is a * concatenated value of the authorization number and the transaction tag. */ class PayeezyResponse extends AbstractResponse { public function __construct(RequestInterface $request, $data) { $this->request = $request; $this->data = json_decode($data, true); } public function isSuccessful() { return ($this->data['transaction_approved'] == '1') ? true : false; } /** * Get an item from the internal data array * * This is a short cut function to ensure that we test that the item * exists in the data array before we try to retrieve it. * * @param $itemname * @return mixed|null */ public function getDataItem($itemname) { if (isset($this->data[$itemname])) { return $this->data[$itemname]; } return null; } /** * Get the authorization number * * This is the authorization number returned by the cardholder’s financial * institution when a transaction has been approved. This value overrides any * value sent for the Request Property of the same name. * * @return integer */ public function getAuthorizationNumber() { return $this->getDataItem('authorization_num'); } /** * Get the transaction tag. * * A unique identifier to associate with a tagged transaction. This value overrides * any value sent for the Request Property of the same name. * * @return string */ public function getTransactionTag() { return $this->getDataItem('transaction_tag'); } /** * Get the transaction reference * * Because refunding or voiding a transaction requires both the authorization number * and the transaction tag, we concatenate them together to make the transaction * reference. * * @return string */ public function getTransactionReference() { return $this->getAuthorizationNumber() . '::' . $this->getTransactionTag(); } /** * Get the transaction sequence number. * * A digit sequentially incremented number generated by Global Gateway e4 and passed * through to the financial institution. It is also passed back to the client in the * transaction response. This number can be used for tracking and audit purposes. * * @return string */ public function getSequenceNo() { return $this->getDataItem('sequence_no'); } /** * Get the credit card reference for a completed transaction. * * This is only provided if TransArmor processing is turned on for the gateway. * * @return string */ public function getCardReference() { return $this->getDataItem('transarmor_token'); } public function getMessage() { return $this->getDataItem('exact_message'); } /** * Get the error code. * * This property indicates the processing status of the transaction. Please refer * to the section on Exception Handling for further information. The Transaction_Error * property will return True if this property is not “00”. * * @return string */ public function getCode() { return $this->getDataItem('exact_resp_code'); } } PK ! GO�/ / ( src/Message/CompletePurchaseResponse.phpnu �[��� <?php /** * First Data Connect Complete Purchase Response */ namespace Omnipay\FirstData\Message; use Omnipay\Common\Message\AbstractResponse; /** * First Data Connect Complete Purchase Response */ class CompletePurchaseResponse extends AbstractResponse { public function isSuccessful() { return isset($this->data['status']) && $this->data['status'] == 'APPROVED'; } public function getTransactionId() { return isset($this->data['oid']) ? $this->data['oid'] : null; } public function getTransactionReference() { return isset($this->data['refnumber']) ? $this->data['refnumber'] : null; } public function getMessage() { return isset($this->data['status']) ? $this->data['status'] : null; } } PK ! � $c '