diff --git a/Block/Customer/CardRenderer.php b/Block/Customer/CardRenderer.php index b9d52cd..adb4599 100644 --- a/Block/Customer/CardRenderer.php +++ b/Block/Customer/CardRenderer.php @@ -1,6 +1,6 @@ getPaymentMethodCode() === \PMNTS\Gateway\Helper\Data::METHOD_CODE; + return $token->getPaymentMethodCode() === \FatZebra\Gateway\Helper\Data::METHOD_CODE; } /** diff --git a/Gateway/AbstractCommand.php b/Gateway/AbstractCommand.php index c0dfc79..8ac94b5 100644 --- a/Gateway/AbstractCommand.php +++ b/Gateway/AbstractCommand.php @@ -1,16 +1,16 @@ scopeConfig = $scopeConfig; - $this->pmntsHelper = $pmntsHelper; + $this->fatzebraHelper = $fatzebraHelper; $this->gatewayFactory = $gatewayFactory; $this->logger = $logger; } /** * @param $storeId - * @return \Pmnts\Gateway\Model\Gateway + * @return \FatZebra\Gateway\Model\Gateway */ public function getGateway($storeId) { $username = $this->scopeConfig->getValue( - \PMNTS\Gateway\Helper\Data::CONFIG_PATH_PMNTS_USERNAME, + \FatZebra\Gateway\Helper\Data::CONFIG_PATH_FATZEBRA_USERNAME, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId ); $token = $this->scopeConfig->getValue( - \PMNTS\Gateway\Helper\Data::CONFIG_PATH_PMNTS_TOKEN, + \FatZebra\Gateway\Helper\Data::CONFIG_PATH_FATZEBRA_TOKEN, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId ); $sandbox = (bool)$this->scopeConfig->getValue( - \PMNTS\Gateway\Helper\Data::CONFIG_PATH_PMNTS_SANDBOX, + \FatZebra\Gateway\Helper\Data::CONFIG_PATH_FATZEBRA_SANDBOX, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId ); diff --git a/Gateway/CaptureCommand.php b/Gateway/CaptureCommand.php index 66d6023..4d64f29 100644 --- a/Gateway/CaptureCommand.php +++ b/Gateway/CaptureCommand.php @@ -2,12 +2,12 @@ /** * Capture command (with tokenization if opted-in by customer) * - * @category PMNTS - * @package PMNTS_Gateway - * @copyright PMNTS (http://PMNTS.io) + * @category Fat Zebra + * @package FatZebra_Gateway + * @copyright Fat Zebra (https://www.fatzebra.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace PMNTS\Gateway\Gateway; +namespace FatZebra\Gateway\Gateway; class CaptureCommand extends AbstractCommand { @@ -37,8 +37,8 @@ class CaptureCommand extends AbstractCommand /** * CaptureCommand constructor. * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \PMNTS\Gateway\Helper\Data $pmntsHelper - * @param \PMNTS\Gateway\Model\GatewayFactory $gatewayFactory + * @param \FatZebra\Gateway\Helper\Data $fatzebraHelper + * @param \FatZebra\Gateway\Model\GatewayFactory $gatewayFactory * @param \Psr\Log\LoggerInterface $logger * @param \Magento\Vault\Model\PaymentTokenFactory $paymentTokenFactory * @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository @@ -48,8 +48,8 @@ class CaptureCommand extends AbstractCommand */ public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \PMNTS\Gateway\Helper\Data $pmntsHelper, - \PMNTS\Gateway\Model\GatewayFactory $gatewayFactory, + \FatZebra\Gateway\Helper\Data $fatzebraHelper, + \FatZebra\Gateway\Model\GatewayFactory $gatewayFactory, \Psr\Log\LoggerInterface $logger, \Magento\Vault\Model\PaymentTokenFactory $paymentTokenFactory, \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, @@ -57,7 +57,7 @@ public function __construct( \Magento\Framework\Serialize\Serializer\Json $json, \Magento\Sales\Api\Data\OrderPaymentExtensionInterfaceFactory $paymentExtensionInterfaceFactory ) { - parent::__construct($scopeConfig, $pmntsHelper, $gatewayFactory, $logger); + parent::__construct($scopeConfig, $fatzebraHelper, $gatewayFactory, $logger); $this->paymentTokenFactory = $paymentTokenFactory; $this->customerRepository = $customerRepository; $this->paymentTokenRepository = $paymentTokenRepository; @@ -77,16 +77,16 @@ public function execute(array $commandSubject) /** @var \Magento\Sales\Model\Order $order */ $order = $payment->getOrder(); - $pmntsToken = $payment->getAdditionalInformation('pmnts_token'); + $fatzebraToken = $payment->getAdditionalInformation('fatzebra_token'); - /** @var \PMNTS\Gateway\Model\Gateway $gateway */ + /** @var \FatZebra\Gateway\Model\Gateway $gateway */ $gateway = $this->getGateway($order->getStoreId()); - $reference = $this->pmntsHelper->getOrderReference($order); - $fraudData = $this->pmntsHelper->buildFraudPayload($order); + $reference = $this->fatzebraHelper->getOrderReference($order); + $fraudData = $this->fatzebraHelper->buildFraudPayload($order); /** @var array $result */ - $result = $gateway->token_purchase($pmntsToken, $commandSubject['amount'], $reference, null, $fraudData); + $result = $gateway->token_purchase($fatzebraToken, $commandSubject['amount'], $reference, null, $fraudData); if ($result && isset($result['response'])) { if ($result['response']['successful'] === false) { @@ -102,7 +102,7 @@ public function execute(array $commandSubject) throw new \Magento\Framework\Validator\Exception(__('Payment gateway error, please contact customer service.')); } - if ($payment->getAdditionalInformation('pmnts_save_token') && $order->getCustomerId()) { + if ($payment->getAdditionalInformation('fatzebra_save_token') && $order->getCustomerId()) { try { $paymentTokenDetails = $this->getTokenDetails($result['response']); } catch (\Exception $ex) { @@ -115,14 +115,14 @@ public function execute(array $commandSubject) $paymentToken->setType(\Magento\Vault\Api\Data\PaymentTokenFactoryInterface::TOKEN_TYPE_CREDIT_CARD); $paymentToken->setTokenDetails($this->json->serialize($paymentTokenDetails)); $paymentToken->setExpiresAt(new \DateTime($result['response']['card_expiry'])); - $paymentToken->setGatewayToken($pmntsToken); + $paymentToken->setGatewayToken($fatzebraToken); /** @var \Magento\Sales\Api\Data\OrderPaymentExtension $extension */ $paymentExtension = $this->paymentExtensionInterfaceFactory->create(); $paymentExtension->setVaultPaymentToken($paymentToken); $payment->setExtensionAttributes($paymentExtension); } else { // If the customer has not opted into the token storage, do not persist it to the database - $payment->unsAdditionalInformation('pmnts_token'); + $payment->unsAdditionalInformation('fatzebra_token'); } } diff --git a/Gateway/RefundCommand.php b/Gateway/RefundCommand.php index 185c953..84743f6 100644 --- a/Gateway/RefundCommand.php +++ b/Gateway/RefundCommand.php @@ -2,12 +2,12 @@ /** * Refund command * - * @category PMNTS - * @package PMNTS_Gateway - * @copyright PMNTS (http://PMNTS.io) + * @category Fat Zebra + * @package FatZebra_Gateway + * @copyright Fat Zebra (https://www.fatzebra.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace PMNTS\Gateway\Gateway; +namespace FatZebra\Gateway\Gateway; class RefundCommand extends AbstractCommand { @@ -20,11 +20,11 @@ public function execute(array $commandSubject) { /** @var \Magento\Sales\Model\Order\Payment $payment */ $payment = $commandSubject['payment']->getPayment(); - /** @var \PMNTS\Gateway\Model\Gateway $gateway */ + /** @var \FatZebra\Gateway\Model\Gateway $gateway */ $gateway = $this->getGateway($payment->getOrder()->getStoreId()); // At this point, we don't have a CreditMemo increment ID, so append a timestamp to ensure uniqueness in the event // of multiple refunds against a single invoice. - $reference = $this->pmntsHelper->getOrderReference($payment->getOrder()) . '-R-' . (new \DateTime())->format('ymdhi'); + $reference = $this->fatzebaHelper->getOrderReference($payment->getOrder()) . '-R-' . (new \DateTime())->format('ymdhi'); $response = $gateway->refund($payment->getLastTransId(), $commandSubject['amount'], $reference); if (is_array($response) && array_key_exists('successful', $response)) { if ($response['successful'] === true) { diff --git a/Gateway/VaultCaptureCommand.php b/Gateway/VaultCaptureCommand.php index 26b59ba..a19a52e 100644 --- a/Gateway/VaultCaptureCommand.php +++ b/Gateway/VaultCaptureCommand.php @@ -2,12 +2,12 @@ /** * Vault capture command * - * @category PMNTS - * @package PMNTS_Gateway - * @copyright PMNTS (http://PMNTS.io) + * @category Fat Zebra + * @package FatZebra_Gateway + * @copyright Fat Zebra (https://www.fatzebra.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace PMNTS\Gateway\Gateway; +namespace FatZebra\Gateway\Gateway; use Psr\Log\LoggerInterface; @@ -22,19 +22,19 @@ class VaultCaptureCommand extends AbstractCommand /** * VaultCaptureCommand constructor. * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @param \PMNTS\Gateway\Helper\Data $pmntsHelper - * @param \PMNTS\Gateway\Model\GatewayFactory $gatewayFactory + * @param \FatZebra\Gateway\Helper\Data $fatzebraHelper + * @param \FatZebra\Gateway\Model\GatewayFactory $gatewayFactory * @param LoggerInterface $logger * @param \Magento\Vault\Api\PaymentTokenManagementInterface $tokenManagement */ public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, - \PMNTS\Gateway\Helper\Data $pmntsHelper, - \PMNTS\Gateway\Model\GatewayFactory $gatewayFactory, + \FatZebra\Gateway\Helper\Data $fatzebraHelper, + \FatZebra\Gateway\Model\GatewayFactory $gatewayFactory, \Psr\Log\LoggerInterface $logger, \Magento\Vault\Api\PaymentTokenManagementInterface $tokenManagement ) { - parent::__construct($scopeConfig, $pmntsHelper, $gatewayFactory, $logger); + parent::__construct($scopeConfig, $fatzebraHelper, $gatewayFactory, $logger); $this->tokenManagement = $tokenManagement; } @@ -63,14 +63,14 @@ public function execute(array $commandSubject) ); if ($token) { - /** @var \PMNTS\Gateway\Model\Gateway $gateway */ + /** @var \FatZebra\Gateway\Model\Gateway $gateway */ $gateway = $this->getGateway($storeId); - $fraudData = $this->pmntsHelper->buildFraudPayload($order); + $fraudData = $this->fatzebraHelper->buildFraudPayload($order); $result = $gateway->token_purchase( $token->getGatewayToken(), $commandSubject['amount'], - $this->pmntsHelper->getOrderReference($order), + $this->fatzebraHelper->getOrderReference($order), null, $fraudData ); diff --git a/Helper/Data.php b/Helper/Data.php index 4f25427..00bc086 100755 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -1,14 +1,14 @@ $this->cleanForFraud($customerId, self::RE_ANS, 16), "post_code" => $this->cleanForFraud($billing->getPostcode(), self::RE_AN, 9) ], - "device_id" => $payment->getAdditionalInformation('pmnts_device_id'), + "device_id" => $payment->getAdditionalInformation('pmmts_device_id'), "items" => $orderItems, "recipients" => [ [ @@ -252,6 +252,6 @@ public function getFraudShippingMethod($order) protected function getConfigData($field, $storeId = 0) { - return $this->scopeConfig->getValue('payment/pmnts_gateway/' . $field, 'stores', $storeId); + return $this->scopeConfig->getValue('payment/fatzebra_gateway/' . $field, 'stores', $storeId); } } diff --git a/Model/Config/PmntsConfigProvider.php b/Model/Config/PmntsConfigProvider.php index 03ade05..65d8fa5 100644 --- a/Model/Config/PmntsConfigProvider.php +++ b/Model/Config/PmntsConfigProvider.php @@ -1,14 +1,14 @@ [ - 'pmntsGateway' => [ + 'FatZebraGateway' => [ 'iframeSrc' => $this->getIframeSrc(), 'fraudFingerprintSrc' => $this->getFraudFingerprintSource(), 'isSandbox' => $this->getIsSandbox(), 'canSaveCard' => $this->canSaveCard(), 'customerHasSavedCC' => $this->customerHasSavedCC(), - 'ccVaultCode' => \PMNTS\Gateway\Helper\Data::VAULT_METHOD_CODE + 'ccVaultCode' => \FatZebra\Gateway\Helper\Data::VAULT_METHOD_CODE ] ] ]; @@ -71,9 +71,9 @@ private function getFraudFingerprintSource() $is_sandbox = $this->getConfigValue("sandbox_mode"); $username = $this->getConfigValue("username"); if ($is_sandbox) { - return "https://gateway.pmnts-sandbox.io/fraud/fingerprint/{$username}.js"; + return "https://gateway.FatZebra-sandbox.io/fraud/fingerprint/{$username}.js"; } else { - return "https://gateway.pmnts.io/fraud/fingerprint/{$username}.js"; + return "https://gateway.FatZebra.io/fraud/fingerprint/{$username}.js"; } } @@ -86,9 +86,9 @@ private function getIframeSrc() $hash_payload = "{$nonce}:1.0:AUD"; $hash = hash_hmac("md5", $hash_payload, $shared_secret); - $base_url = "https://paynow.pmnts.io"; + $base_url = "https://paynow.FatZebra.io"; if ($is_sandbox) { - $base_url = "https://paynow.pmnts-sandbox.io"; + $base_url = "https://paynow.FatZebra-sandbox.io"; } $url = "{$base_url}/v2/{$username}/{$nonce}/AUD/1.0/{$hash}?show_extras=false&show_email=false&iframe=true&paypal=false&tokenize_only=true&masterpass=false&visacheckout=false&hide_button=true&postmessage=true&return_target=_self&ajax=true"; @@ -113,7 +113,7 @@ private function getIsSandbox() private function canSaveCard() { $customer = $this->currentCustomer->getCustomerId(); - return !is_null($customer) && $this->scopeConfig->getValue('payment/pmnts_gateway_vault/active', 'stores'); + return !is_null($customer) && $this->scopeConfig->getValue('payment/fatzebra_gateway_vault/active', 'stores'); } private function customerHasSavedCC() @@ -129,7 +129,7 @@ private function customerHasSavedCC() } $tokens = $this->paymentTokenManagement->getVisibleAvailableTokens($customerId); foreach ($tokens as $token) { - if ($token->getPaymentMethodCode() === \PMNTS\Gateway\Helper\Data::METHOD_CODE) { + if ($token->getPaymentMethodCode() === \FatZebra\Gateway\Helper\Data::METHOD_CODE) { return true; } } diff --git a/Model/Config/Source/Order/Status/Pendingpayment.php b/Model/Config/Source/Order/Status/Pendingpayment.php index e940da5..a2d3152 100755 --- a/Model/Config/Source/Order/Status/Pendingpayment.php +++ b/Model/Config/Source/Order/Status/Pendingpayment.php @@ -1,6 +1,6 @@ componentFactory->create( [ 'config' => [ - 'code' => \PMNTS\Gateway\Helper\Data::VAULT_METHOD_CODE, + 'code' => \FatZebra\Gateway\Helper\Data::VAULT_METHOD_CODE, TokenUiComponentProviderInterface::COMPONENT_DETAILS => $jsonDetails, TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH => $paymentToken->getPublicHash() ], - 'name' => 'PMNTS_Gateway/js/view/payment/method-renderer/vault' + 'name' => 'FatZebra_Gateway/js/view/payment/method-renderer/vault' ] ); diff --git a/Observer/AssignDataObserver.php b/Observer/AssignDataObserver.php index e10e41b..0f6f1a0 100644 --- a/Observer/AssignDataObserver.php +++ b/Observer/AssignDataObserver.php @@ -1,6 +1,6 @@ setAdditionalInformation('pmnts_save_token', $additionalData['cc_save']); + $paymentInfo->setAdditionalInformation('fatzebra_save_token', $additionalData['cc_save']); } if (array_key_exists('cc_token', $additionalData)) { - $paymentInfo->setAdditionalInformation('pmnts_token', $additionalData['cc_token']); + $paymentInfo->setAdditionalInformation('fatzebra_token', $additionalData['cc_token']); } if (isset($additionalData['pmnts_id']) && !empty($additionalData['pmnts_id'])) { - $paymentInfo->setAdditionalInformation('pmnts_device_id', $additionalData['pmnts_id']); + $paymentInfo->setAdditionalInformation('fatzebra_device_id', $additionalData['pmnts_id']); } } } \ No newline at end of file diff --git a/README.md b/README.md index 3642b3b..839c683 100755 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -PMNTS Magento 2 Module +Fat Zebra Magento 2 Module ====================== Overview -------- -The PMNTS Magento 2 module provides a simple integration method for Magento 2.x with the Fat Zebra, Cloud Payments and PMNTS gateway services. This module includes support for the following functionality: +The Fat Zebra Magento 2 module provides a simple integration method for Magento 2.x with the Fat Zebra gateway services. This module includes support for the following functionality: * IFRAME card details capture for de-scoping of PCI requirements * Card tokenization and one-click saved card payment using the Magento Vault @@ -26,16 +26,16 @@ Installation using Composer 1. Under the Magento root folder run the following command to setup the repository: ``` -composer config repositories.pmnts git https://github.com/PMNTS/magento2-pmnts.git +composer config repositories.fatzebra git https://github.com/fatzebra/magento2-fatzebra.git ``` 2. Then run the following command to add the module: ``` -composer require pmnts/magento2-pmnts:dev-master +composer require fatzebra/magento2-fatzebra:dev-master ``` 3. Following this the dependencies will be fetched or updated where required – this may take a few minutes. 4. Once all dependencies have installed the module needs to be enabled using the following commands: ``` -php bin/magento module:enable PMNTS_Gateway --clear-static-content && php bin/magento setup:upgrade +php bin/magento module:enable FatZebra_Gateway --clear-static-content && php bin/magento setup:upgrade ``` 5. Once the setup:upgrade command completes the module will be available within the Store Admin to configure. @@ -43,11 +43,11 @@ php bin/magento module:enable PMNTS_Gateway --clear-static-content && php bin/ma Manual Installation ------------------- -1. Download the latest archive of the module from https://github.com/PMNTS/magento2-pmnts/archive/master.zip +1. Download the latest archive of the module from https://github.com/fatzebra/magento2-fatzebra/archive/master.zip 2. Copy the archive to the server and extract – the files should be extracted into the Magento root folder, or copied over ensuring directories are included/preserved. 3. Run enable the module by running the following commands: ``` -php bin/magento module:enable PMNTS_Gateway --clear-static-content && php bin/magento setup:upgrade +php bin/magento module:enable FatZebra_Gateway --clear-static-content && php bin/magento setup:upgrade ``` 4. Once the setup:upgrade command completed the module will be available within the Store Admin to configure @@ -59,7 +59,7 @@ To configure the module the following steps should be taken: 1. Login to the Magento Admin area (this is commonly at https://www.yoursite.com/admin, however it may be different) 2. From the menu on the left hand side select Stores and then Configuration 3. Under the Configuration menu select Sales and then Payment Methods -4. Under the PMNTS payment method set the configuration details as required +4. Under the Fat Zebra payment method set the configuration details as required 5. Once the configuration has been entered click Save Config – this will commit the changes to the database. The payment method can now be tested. Notes on Fraud Shipping Maps diff --git a/composer.json b/composer.json index 4951a06..6e35468 100755 --- a/composer.json +++ b/composer.json @@ -1,19 +1,19 @@ { - "description": "PMNTS Payment Gateway integration for Magento 2", + "description": "Fat Zebra Payment Gateway integration for Magento 2", "license": [ "OSL-3.0" ], - "name": "pmnts/magento2-pmnts", + "name": "fatzebra/magento2-fatzebra", "require": { }, "type": "magento2-module", - "version": "dev-master", + "version": "1.0.0", "autoload": { "files": [ "registration.php" ], "psr-4": { - "PMNTS\\Gateway\\": "" + "FatZebra\\Gateway\\": "" } } } diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index eb191e4..ed225d6 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,19 +1,19 @@
- - + + Magento\Config\Model\Config\Source\Yesno @@ -47,14 +47,14 @@ - PMNTS\Gateway\Model\Config\Source\Order\Status\Pendingpayment + FatZebra\Gateway\Model\Config\Source\Order\Status\Pendingpayment - PMNTS\Gateway\Model\Source\Action + FatZebra\Gateway\Model\Source\Action @@ -66,7 +66,7 @@ - PMNTS\Gateway\Model\Source\Cctype + FatZebra\Gateway\Model\Source\Cctype @@ -88,7 +88,7 @@ Magento\Config\Model\Config\Source\Yesno Allow customers credit card tokens to be saved for future use. - payment/pmnts_gateway_vault/active + payment/fatzebra_gateway_vault/active @@ -97,42 +97,42 @@ - PMNTS\Gateway\Model\Source\EnabledMethods + FatZebra\Gateway\Model\Source\EnabledMethods 1 - PMNTS\Gateway\Model\Source\EnabledMethods + FatZebra\Gateway\Model\Source\EnabledMethods 1 - PMNTS\Gateway\Model\Source\EnabledMethods + FatZebra\Gateway\Model\Source\EnabledMethods 1 - PMNTS\Gateway\Model\Source\EnabledMethods + FatZebra\Gateway\Model\Source\EnabledMethods 1 - PMNTS\Gateway\Model\Source\EnabledMethods + FatZebra\Gateway\Model\Source\EnabledMethods 1 - PMNTS\Gateway\Model\Source\EnabledMethods + FatZebra\Gateway\Model\Source\EnabledMethods 1 diff --git a/etc/config.xml b/etc/config.xml index 0a22b04..801bb9f 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -1,20 +1,20 @@ - + 0 - PmntsPayment + FatZebraPayment authorize_capture Credit Card processing @@ -30,11 +30,11 @@ https://pmnts-resources.s3.amazonaws.com/magento2/magento2-iframe.css 1 - - - PmntsVaultProvider + + + FatZebraVaultProvider My Saved Cards - + diff --git a/etc/di.xml b/etc/di.xml index e855ce1..f95e61d 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -1,119 +1,119 @@ - + - PMNTS\Gateway\Helper\Data::METHOD_CODE + FatZebra\Gateway\Helper\Data::METHOD_CODE Magento\Payment\Block\Info Magento\Payment\Block\Form\Cc - PmntsValueHandlerPool - - PmntsCommandPool + FatZebraValueHandlerPool + + FatZebraCommandPool - + - PMNTS\Gateway\Gateway\CaptureCommand - PMNTS\Gateway\Gateway\VaultCaptureCommand - PMNTS\Gateway\Gateway\RefundCommand + FatZebra\Gateway\Gateway\CaptureCommand + FatZebra\Gateway\Gateway\VaultCaptureCommand + FatZebra\Gateway\Gateway\RefundCommand - + - PmntsValueHandler - PmntsVaultValueHandler + FatZebraValueHandler + FatZebraVaultValueHandler - + - PmntsPaymentConfig + FatZebraPaymentConfig - + - PMNTS\Gateway\Helper\Data::METHOD_CODE + FatZebra\Gateway\Helper\Data::METHOD_CODE - + - PmntsVaultPaymentConfig + FatZebraVaultPaymentConfig - + - PmntsVaultValueHandler + FatZebraVaultValueHandler - + - PMNTS\Gateway\Helper\Data::VAULT_METHOD_CODE + FatZebra\Gateway\Helper\Data::VAULT_METHOD_CODE - + - PmntsVaultPaymentConfig - PmntsPayment - PMNTS\Gateway\Helper\Data::VAULT_METHOD_CODE + FatZebraVaultPaymentConfig + FatZebraPayment + FatZebra\Gateway\Helper\Data::VAULT_METHOD_CODE - PmntsCommandManager + FatZebraCommandManager - + - PmntsCommandPool + FatZebraCommandPool - + - /var/log/pmnts_gateway.log + /var/log/fatzebra_gateway.log - + - pmnts_gateway + fatzebra_gateway - PmntsGatewayLoggerHandler + FatZebraGatewayLoggerHandler - + - PmntsGatewayLogger + FatZebraGatewayLogger - + - PmntsGatewayLogger + FatZebraGatewayLogger - + - PmntsGatewayLogger + FatZebraGatewayLogger \ No newline at end of file diff --git a/etc/events.xml b/etc/events.xml index 6462ae9..3f02deb 100644 --- a/etc/events.xml +++ b/etc/events.xml @@ -1,6 +1,6 @@ - - + + diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index cfa8d9d..bb54b41 100755 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -1,20 +1,20 @@ - + - PMNTS\Gateway\Helper\Data::METHOD_CODE + FatZebra\Gateway\Helper\Data::METHOD_CODE @@ -22,8 +22,8 @@ - PMNTS\Gateway\Model\ConfigProvider - PMNTS\Gateway\Model\Config\PmntsConfigProvider + FatZebra\Gateway\Model\ConfigProvider + FatZebra\Gateway\Model\Config\FatZebraConfigProvider @@ -31,7 +31,7 @@ - PMNTS\Gateway\Model\Ui\TokenUiComponentProvider + FatZebra\Gateway\Model\Ui\TokenUiComponentProvider diff --git a/etc/module.xml b/etc/module.xml index a9b54bf..bc1fd4a 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,16 +1,16 @@ - + diff --git a/etc/payment.xml b/etc/payment.xml index 849f198..cbb6e0f 100755 --- a/etc/payment.xml +++ b/etc/payment.xml @@ -1,17 +1,17 @@ - + 1 diff --git a/registration.php b/registration.php index 53b1323..6a47487 100755 --- a/registration.php +++ b/registration.php @@ -2,6 +2,6 @@ \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, - 'PMNTS_Gateway', + 'FatZebra_Gateway', __DIR__ ); diff --git a/view/frontend/layout/checkout_index_index.xml b/view/frontend/layout/checkout_index_index.xml index 8f1a42b..45c3e52 100755 --- a/view/frontend/layout/checkout_index_index.xml +++ b/view/frontend/layout/checkout_index_index.xml @@ -1,11 +1,11 @@ @@ -27,10 +27,10 @@ - - PMNTS_Gateway/js/view/payment/pmnts-payments + + FatZebra_Gateway/js/view/payment/fatzebra-payments - + true diff --git a/view/frontend/layout/vault_cards_listaction.xml b/view/frontend/layout/vault_cards_listaction.xml index 6a8abd6..adb5a58 100644 --- a/view/frontend/layout/vault_cards_listaction.xml +++ b/view/frontend/layout/vault_cards_listaction.xml @@ -4,7 +4,7 @@ - + diff --git a/view/frontend/web/js/view/payment/pmnts-payments.js b/view/frontend/web/js/view/payment/fatzebra-payments.js similarity index 62% rename from view/frontend/web/js/view/payment/pmnts-payments.js rename to view/frontend/web/js/view/payment/fatzebra-payments.js index e3457dc..6c0df23 100755 --- a/view/frontend/web/js/view/payment/pmnts-payments.js +++ b/view/frontend/web/js/view/payment/fatzebra-payments.js @@ -1,9 +1,9 @@ /** - * PMNTS_Gateway Magento JS component + * FatZebra_Gateway Magento JS component * - * @category PMNTS - * @package PMNTS_Gateway - * @copyright PMNTS (http://PMNTS.io) + * @category Fat Zebra + * @package FatZebra_Gateway + * @copyright Fat Zebra (https://www.fatzebra.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /*browser:true*/ @@ -20,8 +20,8 @@ define( 'use strict'; rendererList.push( { - type: 'pmnts_gateway', - component: 'PMNTS_Gateway/js/view/payment/method-renderer/pmnts-method' + type: 'fatzebra_gateway', + component: 'FatZebra_Gateway/js/view/payment/method-renderer/fatzebra-method' } ); /** Add view logic here if needed */ diff --git a/view/frontend/web/js/view/payment/method-renderer/pmnts-method.js b/view/frontend/web/js/view/payment/method-renderer/fatzebra-method.js similarity index 59% rename from view/frontend/web/js/view/payment/method-renderer/pmnts-method.js rename to view/frontend/web/js/view/payment/method-renderer/fatzebra-method.js index 94bc6aa..b16526b 100755 --- a/view/frontend/web/js/view/payment/method-renderer/pmnts-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/fatzebra-method.js @@ -1,9 +1,9 @@ /** - * PMNTS_Gateway Magento JS component + * FatZebra_Gateway Magento JS component * - * @category PMNTS - * @package PMNTS_Gateway - * @copyright PMNTS (http://PMNTS.io) + * @category Fat Zebra + * @package FatZebra_Gateway + * @copyright Fat Zebra (https://www.fatzebra.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ /*browser:true*/ @@ -20,12 +20,12 @@ define( function (Component, $, validator, messageList, fullScreenLoader, VaultEnabler) { 'use strict'; - window.pmntsGateway.messageList = messageList; - window.pmntsGateway.fullScreenLoader = fullScreenLoader; + window.fatzebraGateway.messageList = messageList; + window.fatzebraGateway.fullScreenLoader = fullScreenLoader; return Component.extend({ defaults: { - template: 'PMNTS_Gateway/payment/pmnts-form' + template: 'FatZebra_Gateway/payment/fatzebra-form' }, initialize: function() { @@ -38,11 +38,11 @@ define( * @returns {String} */ getVaultCode: function () { - return window.checkoutConfig.payment['pmntsGateway'].ccVaultCode; + return window.checkoutConfig.payment['fatzebraGateway'].ccVaultCode; }, getCode: function() { - return 'pmnts_gateway'; + return 'fatzebra_gateway'; }, isActive: function() { @@ -50,27 +50,27 @@ define( }, getIframeUrl: function() { - return window.checkoutConfig.payment.pmntsGateway.iframeSrc; + return window.checkoutConfig.payment.fatzebraGateway.iframeSrc; }, canSaveCard: function() { - return window.checkoutConfig.payment.pmntsGateway.canSaveCard; + return window.checkoutConfig.payment.fatzebraGateway.canSaveCard; }, customerHasSavedCC: function() { - return window.checkoutConfig.payment.pmntsGateway.customerHasSavedCC; + return window.checkoutConfig.payment.fatzebraGateway.customerHasSavedCC; }, - pmntsPlaceOrder: function() { - window.pmntsGateway.processIframeOrder(); + fatzebraPlaceOrder: function() { + window.fatzebraGateway.processIframeOrder(); }, getData: function() { var data = { 'method': this.item.method, 'additional_data': { - "cc_token": jQuery('#pmnts_gateway-token').val(), - "cc_save": jQuery("#pmnts_gateway_cc_save").is(':checked') + "cc_token": jQuery('#fatzebra_gateway-token').val(), + "cc_save": jQuery("#fatzebra_gateway_cc_save").is(':checked') } }; @@ -83,17 +83,17 @@ define( setTimeout(function() { var s = document.createElement( 'script' ); - s.setAttribute( 'src', window.checkoutConfig.payment.pmntsGateway.fraudFingerprintSrc ); + s.setAttribute( 'src', window.checkoutConfig.payment.fatzebraGateway.fraudFingerprintSrc ); document.body.appendChild( s ); }, 1000); -window.pmntsGateway = { +window.fatzebraGateway = { attachEvents: function() { // Clear existing events... - window.removeEventListener ? window.removeEventListener("message", window.pmntsGateway.receiveMessage, false) : window.detatchEvent("onmessage", window.pmntsGateway.receiveMessage); + window.removeEventListener ? window.removeEventListener("message", window.fatzebraGateway.receiveMessage, false) : window.detatchEvent("onmessage", window.fatzebraGateway.receiveMessage); // And add... - window.addEventListener ? window.addEventListener("message", window.pmntsGateway.receiveMessage, false) : window.attachEvent("onmessage", window.pmntsGateway.receiveMessage); + window.addEventListener ? window.addEventListener("message", window.fatzebraGateway.receiveMessage, false) : window.attachEvent("onmessage", window.fatzebraGateway.receiveMessage); }, processIframeOrder: function() { // PostMessage @@ -102,18 +102,18 @@ window.pmntsGateway = { // Trigger the iframe var iframe = document.getElementById("checkout-iframe"); - window.pmntsGateway.fullScreenLoader.startLoader(); + window.fatzebraGateway.fullScreenLoader.startLoader(); iframe.contentWindow.postMessage('doCheckout', '*'); }, receiveMessage: function(event) { if (event.origin.indexOf("paynow") === -1) return; - window.pmntsGateway.fullScreenLoader.stopLoader(); + window.fatzebraGateway.fullScreenLoader.stopLoader(); var payload = event.data; if (typeof event.data == 'string') { if (/\[object/i.test(event.data)) { - window.pmntsGateway.messageList.addErrorMessage({message: "Sorry, it looks like there has been a problem communicating with your browsers..."}); + window.fatzebraGateway.messageList.addErrorMessage({message: "Sorry, it looks like there has been a problem communicating with your browsers..."}); } var pairs = payload.split("&"); payload = {}; @@ -126,27 +126,27 @@ window.pmntsGateway = { if ('data' in payload) { if (payload.data.message == "form.invalid") { - window.pmntsGateway.messageList.addErrorMessage({message: "Validation error: " + payload.data.errors}); + window.fatzebraGateway.messageList.addErrorMessage({message: "Validation error: " + payload.data.errors}); return; } // Modern browser // Use payload.data.x - window.pmntsGateway.fillInPaymentForm(payload.data); + window.fatzebraGateway.fillInPaymentForm(payload.data); } else { // Old browser don't use payload.data.x if (payload.message == "form.invalid") { - window.pmntsGateway.messageList.addErrorMessage({message: "Validation error: " + payload.errors}); + window.fatzebraGateway.messageList.addErrorMessage({message: "Validation error: " + payload.errors}); return; } - window.pmntsGateway.fillInPaymentForm(payload); + window.fatzebraGateway.fillInPaymentForm(payload); } }, fillInPaymentForm: function(data) { - jQuery("#pmnts_gateway-token").val(data.token); - jQuery('#pmnts-place-token-order').click(); + jQuery("#fatzebra_gateway-token").val(data.token); + jQuery('#fatzebra-place-token-order').click(); }, messageList: null, fullScreenLoader: null }; -window.pmntsGateway.attachEvents(); +window.fatzebraGateway.attachEvents(); diff --git a/view/frontend/web/js/view/payment/method-renderer/vault.js b/view/frontend/web/js/view/payment/method-renderer/vault.js index f2e59e5..7ea7575 100644 --- a/view/frontend/web/js/view/payment/method-renderer/vault.js +++ b/view/frontend/web/js/view/payment/method-renderer/vault.js @@ -10,7 +10,7 @@ define([ return VaultComponent.extend({ defaults: { - template: 'PMNTS_Gateway/payment/pmnts_vault_form' + template: 'FatZebra_Gateway/payment/fatzebra_vault_form' }, /** diff --git a/view/frontend/web/template/payment/pmnts-form.html b/view/frontend/web/template/payment/fatzebra-form.html similarity index 91% rename from view/frontend/web/template/payment/pmnts-form.html rename to view/frontend/web/template/payment/fatzebra-form.html index c4aa253..f45a29c 100755 --- a/view/frontend/web/template/payment/pmnts-form.html +++ b/view/frontend/web/template/payment/fatzebra-form.html @@ -1,10 +1,10 @@ @@ -38,7 +38,7 @@
- + style="display: none;" id="fatzebra-place-token-order">
diff --git a/view/frontend/web/template/payment/pmnts_vault_form.html b/view/frontend/web/template/payment/fatzebra_vault_form.html similarity index 93% rename from view/frontend/web/template/payment/pmnts_vault_form.html rename to view/frontend/web/template/payment/fatzebra_vault_form.html index 35c178f..935c85a 100644 --- a/view/frontend/web/template/payment/pmnts_vault_form.html +++ b/view/frontend/web/template/payment/fatzebra_vault_form.html @@ -1,10 +1,10 @@