├── .gitattributes ├── .gitignore ├── Api ├── Data │ ├── PaymentRequestInterface.php │ ├── PaymentResponseInterface.php │ └── WebhookEntityInterface.php ├── V3Interface.php └── WebhookEntityRepositoryInterface.php ├── Block ├── Account │ ├── AddCard.php │ └── CardRenderer.php ├── Adminhtml │ ├── Alerts │ │ └── VersionNotification.php │ ├── Logs │ │ └── View.php │ ├── Order │ │ └── View │ │ │ └── View.php │ ├── Payment │ │ └── Moto.php │ └── System │ │ └── Config │ │ ├── Field │ │ ├── AbstractCallbackUrl.php │ │ ├── LogFiles.php │ │ └── WebhookUrl.php │ │ └── Fieldset │ │ └── Payment.php ├── Apm │ ├── Form.php │ └── Sepa │ │ └── Mandate.php ├── Cart │ └── CheckoutConfig.php ├── Paypal │ ├── Review │ │ ├── PaymentMethod.php │ │ ├── PlaceOrderButton.php │ │ ├── ShippingAddress.php │ │ └── ShippingMethod.php │ └── Script.php └── Vault │ └── Form.php ├── Console └── Webhooks.php ├── Controller ├── Account │ └── SaveCard.php ├── Adminhtml │ ├── Logs │ │ └── View.php │ └── System │ │ └── Config │ │ └── Webhook.php ├── Api │ ├── V1.php │ └── V2.php ├── Apm │ ├── Display.php │ ├── DisplayBic.php │ ├── DisplayKlarna.php │ └── DisplaySepa.php ├── ApplePay │ └── Validation.php ├── Button │ └── PlaceOrder.php ├── Klarna │ ├── Context.php │ └── GetCustomerDatas.php ├── Payment │ ├── Fail.php │ ├── PlaceOrder.php │ └── Verify.php ├── Paypal │ ├── Context.php │ ├── Review.php │ ├── SaveData.php │ ├── SaveExpressShippingAddress.php │ └── SaveExpressShippingMethod.php ├── Vault │ └── Display.php └── Webhook │ └── Callback.php ├── Cron └── Webhooks.php ├── Exception └── WebhookEventAlreadyExistsException.php ├── Gateway └── Config │ ├── Config.php │ └── Loader.php ├── Helper ├── Logger.php └── Utilities.php ├── LICENSE.txt ├── Logger ├── Handler │ ├── InfoHandler.php │ └── Logger.php └── ResponseHandler.php ├── Model ├── Api │ ├── Data │ │ ├── PaymentRequest.php │ │ └── PaymentResponse.php │ ├── V3.php │ └── WebhookEntityRepository.php ├── Config │ └── Backend │ │ └── Source │ │ ├── ConfigAdditionalLogging.php │ │ ├── ConfigAlternativePayments.php │ │ ├── ConfigApplePayButton.php │ │ ├── ConfigApplePayCapabilities.php │ │ ├── ConfigApplePayNetworks.php │ │ ├── ConfigCardIcons.php │ │ ├── ConfigDefaultMethod.php │ │ ├── ConfigEnvironment.php │ │ ├── ConfigFormTheme.php │ │ ├── ConfigGooglePayButton.php │ │ ├── ConfigGooglePayEnvironment.php │ │ ├── ConfigGooglePayNetworks.php │ │ ├── ConfigLanguageFallback.php │ │ ├── ConfigOrderActionFailedPayment.php │ │ ├── ConfigOrderStatus.php │ │ ├── ConfigPaymentAction.php │ │ ├── ConfigPaymentFormLayout.php │ │ ├── ConfigPaymentProcesing.php │ │ ├── ConfigRegion.php │ │ ├── ConfigService.php │ │ └── ConfigWebhooks.php ├── Entity │ └── WebhookEntity.php ├── Files │ └── Mada │ │ ├── apm_list.csv │ │ ├── mada_live.csv │ │ └── mada_test.csv ├── InstantPurchase │ ├── AvailabilityChecker.php │ ├── CustomerData.php │ ├── ShippingSelector.php │ └── TokenFormatter.php ├── Methods │ ├── AbstractMethod.php │ ├── AlternativePaymentMethod.php │ ├── ApplePayMethod.php │ ├── CardPaymentMethod.php │ ├── GooglePayMethod.php │ ├── KlarnaMethod.php │ ├── MotoMethod.php │ ├── PaypalMethod.php │ └── VaultMethod.php ├── ResourceModel │ ├── WebhookEntity.php │ └── WebhookEntity │ │ └── Collection.php ├── Service │ ├── ApiHandlerService.php │ ├── CardHandlerService.php │ ├── InvoiceHandlerService.php │ ├── MethodHandlerService.php │ ├── OrderHandlerService.php │ ├── OrderStatusHandlerService.php │ ├── PaymentContextRequestService.php │ ├── PaymentErrorHandlerService.php │ ├── QuoteHandlerService.php │ ├── ShopperHandlerService.php │ ├── TransactionHandlerService.php │ ├── VaultHandlerService.php │ ├── VersionHandlerService.php │ └── WebhookHandlerService.php ├── Ui │ └── ConfigProvider.php └── Vault │ └── VaultToken.php ├── Observer ├── Api │ └── OrderCreditMemoSaveAfter.php └── Backend │ ├── MotoPaymentRequest.php │ ├── OrderAfterCancel.php │ ├── OrderAfterRefund.php │ └── OrderAfterVoid.php ├── Plugin ├── AddConfigDataToCart.php ├── AfterPlaceOrder.php ├── Api │ └── RefundInvoice.php └── Backend │ ├── OrderAfterInvoice.php │ └── OrderAfterSave.php ├── README.md ├── Setup └── Patch │ ├── Data │ ├── CreateVerificationDate.php │ ├── DeleteDuplicateEvents.php │ └── EncryptOldApiKeys.php │ └── Schema │ └── AddUniqueConstraintOnEventId.php ├── composer.json ├── etc ├── adminhtml │ ├── di.xml │ ├── events.xml │ ├── routes.xml │ └── system.xml ├── apm.xml ├── config.xml ├── cron_groups.xml ├── crontab.xml ├── csp_whitelist.xml ├── db_schema.xml ├── di.xml ├── frontend │ ├── di.xml │ ├── routes.xml │ └── sections.xml ├── module.xml ├── payment.xml ├── webapi.xml └── webapi_rest │ ├── di.xml │ └── events.xml ├── i18n ├── en_GB.csv └── en_US.csv ├── registration.php └── view ├── adminhtml ├── layout │ ├── adminhtml_system_config_edit.xml │ ├── cko_logs_view.xml │ ├── sales_order_create_index.xml │ └── sales_order_view.xml ├── requirejs-config.js ├── templates │ ├── logs │ │ └── view.phtml │ ├── order │ │ └── view │ │ │ └── view.phtml │ ├── payment │ │ └── moto.phtml │ └── system │ │ └── config │ │ ├── logfile_admin.phtml │ │ ├── simplepath_admin.phtml │ │ └── webhook_admin.phtml └── web │ └── css │ ├── main.css │ ├── main.min.css │ ├── moto.css │ └── moto.min.css ├── base ├── templates │ └── ui │ │ └── messages.phtml └── web │ └── images │ ├── cc │ ├── ae.svg │ ├── di.svg │ ├── dn.svg │ ├── jcb.svg │ ├── mc.svg │ └── vi.svg │ └── frames │ ├── multi │ ├── american express.svg │ ├── card-error.svg │ ├── card.svg │ ├── cvv-error.svg │ ├── cvv.svg │ ├── dinersclub.svg │ ├── discover.svg │ ├── error.svg │ ├── exp-date-error.svg │ ├── exp-date.svg │ ├── jcb.svg │ ├── loading.svg │ ├── mada.svg │ ├── maestro.svg │ ├── mastercard.svg │ └── visa.svg │ └── single │ ├── amex.svg │ ├── card.svg │ ├── dinersclub.svg │ ├── discover.svg │ ├── jcb.svg │ ├── mada.svg │ ├── maestro.svg │ ├── mastercard.svg │ └── visa.svg └── frontend ├── layout ├── checkout_cart_index.xml ├── checkout_index_index.xml ├── checkoutcom_paypal_review.xml ├── default.xml └── vault_cards_listaction.xml ├── requirejs-config.js ├── templates ├── account │ ├── add-card.phtml │ └── cards-list.phtml ├── cart │ ├── applepay.phtml │ ├── minicart-config.phtml │ └── paypal.phtml ├── payment │ ├── apm │ │ ├── alipay.phtml │ │ ├── bancontact.phtml │ │ ├── boleto.phtml │ │ ├── eps.phtml │ │ ├── fawry.phtml │ │ ├── giropay.phtml │ │ ├── ideal.phtml │ │ ├── klarna.phtml │ │ ├── knet.phtml │ │ ├── paypal.phtml │ │ ├── poli.phtml │ │ ├── sepa.phtml │ │ ├── sepa │ │ │ └── mandate.phtml │ │ └── sofort.phtml │ ├── paypal │ │ ├── review.phtml │ │ └── review │ │ │ ├── details.phtml │ │ │ ├── payment-method.phtml │ │ │ ├── place-order.phtml │ │ │ └── shipping-method.phtml │ └── vault │ │ └── card.phtml └── script │ └── paypal-script.phtml └── web ├── css ├── add-card.css ├── add-card.min.css ├── apm │ ├── apm.css │ └── apm.min.css ├── apple-pay │ ├── apple-pay.css │ └── apple-pay.min.css ├── cards-list.css ├── cards-list.min.css ├── frames │ ├── multi.css │ ├── multi.min.css │ ├── single.css │ └── single.min.css ├── google-pay │ ├── google-pay.css │ └── google-pay.min.css ├── main.css ├── main.min.css ├── paypal │ ├── paypal-express.css │ ├── paypal-review.css │ └── paypal.css ├── sepa │ └── sepa.css └── vault │ ├── vault.css │ └── vault.min.css ├── images └── icon-link.png ├── js ├── frames │ ├── multi.js │ ├── multi.min.js │ ├── single.js │ └── single.min.js ├── model │ ├── checkout-data-resolver.js │ ├── checkout-utilities.js │ └── grand-total-hide.js └── view │ ├── minicart │ └── applepaybutton.js │ └── payment │ ├── applepay-utilities.js │ ├── cart │ └── checkoutcom_applepay_cart.js │ ├── config-loader.js │ ├── method-renderer.js │ ├── method-renderer │ ├── checkoutcom_apm.js │ ├── checkoutcom_apple_pay.js │ ├── checkoutcom_card_payment.js │ ├── checkoutcom_google_pay.js │ ├── checkoutcom_klarna.js │ ├── checkoutcom_paypal.js │ ├── checkoutcom_paypal_express.js │ ├── checkoutcom_paypal_review.js │ └── checkoutcom_vault.js │ ├── paypal-utilities.js │ └── utilities.js └── template ├── checkout └── minicart │ ├── applepaybutton.html │ └── paypalbutton.html └── payment ├── checkoutcom_apm.html ├── checkoutcom_apple_pay.html ├── checkoutcom_card_payment.html ├── checkoutcom_google_pay.html ├── checkoutcom_klarna.html ├── checkoutcom_paypal.html ├── checkoutcom_paypal_express.html └── checkoutcom_vault.html /.gitattributes: -------------------------------------------------------------------------------- 1 | tests/ export-ignore 2 | .circleci/ export-ignore 3 | circle.yml export-ignore 4 | 5 | # Auto detect text files and perform LF normalization 6 | * text=auto 7 | 8 | # These files are text and should be normalized (Convert crlf => lf) 9 | *.php text 10 | *.css text 11 | *.js text 12 | *.json text 13 | *.html text 14 | *.phtml text 15 | *.xml text 16 | *.txt text 17 | *.ini text 18 | *.inc text 19 | *.sql text 20 | 21 | # These files are binary and should be left untouched 22 | # (binary is a macro for -text -diff) 23 | *.png binary 24 | *.jpg binary 25 | *.jpeg binary 26 | *.gif binary 27 | *.ico binary 28 | *.gz binary 29 | *.zip binary 30 | *.7z binary 31 | *.ttf binary -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode 3 | composer.lock 4 | vendor/ 5 | .idea/ -------------------------------------------------------------------------------- /Api/V3Interface.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | declare(strict_types=1); 18 | 19 | namespace CheckoutCom\Magento2\Api; 20 | 21 | /** 22 | * Interface for API v3 23 | */ 24 | interface V3Interface 25 | { 26 | /** 27 | * Set payment information and place order for a specified cart. 28 | * 29 | * @param \Magento\Customer\Api\Data\CustomerInterface $customer 30 | * @param \CheckoutCom\Magento2\Api\Data\PaymentRequestInterface $paymentRequest 31 | * @return \CheckoutCom\Magento2\Api\Data\PaymentResponseInterface 32 | */ 33 | public function executeApiV3( 34 | \Magento\Customer\Api\Data\CustomerInterface $customer, 35 | \CheckoutCom\Magento2\Api\Data\PaymentRequestInterface $paymentRequest 36 | ): \CheckoutCom\Magento2\Api\Data\PaymentResponseInterface; 37 | 38 | /** 39 | * Set payment information and place order for a guest quote. 40 | * 41 | * @param \CheckoutCom\Magento2\Api\Data\PaymentRequestInterface $paymentRequest 42 | * @return \CheckoutCom\Magento2\Api\Data\PaymentResponseInterface 43 | */ 44 | public function executeGuestApiV3( 45 | \CheckoutCom\Magento2\Api\Data\PaymentRequestInterface $paymentRequest 46 | ): \CheckoutCom\Magento2\Api\Data\PaymentResponseInterface; 47 | } 48 | -------------------------------------------------------------------------------- /Api/WebhookEntityRepositoryInterface.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2010-present Checkout.com all rights reserved 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://www.checkout.com 14 | */ 15 | 16 | declare(strict_types=1); 17 | 18 | namespace CheckoutCom\Magento2\Api; 19 | 20 | use CheckoutCom\Magento2\Api\Data\WebhookEntityInterface; 21 | 22 | /** 23 | * Interface WebhookEntityRepositoryInterface 24 | */ 25 | interface WebhookEntityRepositoryInterface 26 | { 27 | /** 28 | * Save Webhook entity 29 | * 30 | * @param \CheckoutCom\Magento2\Api\Data\WebhookEntityInterface $webhookEntity 31 | * 32 | * @return \CheckoutCom\Magento2\Api\WebhookEntityRepositoryInterface 33 | */ 34 | public function save(\CheckoutCom\Magento2\Api\Data\WebhookEntityInterface $webhookEntity): WebhookEntityRepositoryInterface; 35 | 36 | /** 37 | * Get webhook by id 38 | * 39 | * @param int $entityId 40 | * 41 | * @return \CheckoutCom\Magento2\Api\Data\WebhookEntityInterface 42 | */ 43 | public function getById(int $entityId): WebhookEntityInterface; 44 | 45 | /** 46 | * Delete webhook by id 47 | * 48 | * @param int $entityId 49 | * 50 | * @return bool 51 | */ 52 | public function deleteById(int $entityId): bool; 53 | 54 | /** 55 | * Delete Webhook entity 56 | * 57 | * @param \CheckoutCom\Magento2\Api\Data\WebhookEntityInterface $webhookEntity 58 | * 59 | * @return \CheckoutCom\Magento2\Api\WebhookEntityRepositoryInterface 60 | */ 61 | public function delete(\CheckoutCom\Magento2\Api\Data\WebhookEntityInterface $webhookEntity): \CheckoutCom\Magento2\Api\WebhookEntityRepositoryInterface; 62 | } 63 | -------------------------------------------------------------------------------- /Block/Account/AddCard.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | declare(strict_types=1); 18 | 19 | namespace CheckoutCom\Magento2\Block\Account; 20 | 21 | use CheckoutCom\Magento2\Gateway\Config\Config; 22 | use Magento\Framework\View\Element\Template; 23 | use Magento\Framework\View\Element\Template\Context; 24 | 25 | /** 26 | * Class AddCard 27 | */ 28 | class AddCard extends Template 29 | { 30 | /** 31 | * Config field 32 | * 33 | * @var Config $config 34 | */ 35 | private $config; 36 | 37 | /** 38 | * AddCard constructor 39 | * 40 | * @param Context $context 41 | * @param Config $config 42 | * @param array $data 43 | */ 44 | public function __construct( 45 | Context $context, 46 | Config $config, 47 | array $data = [] 48 | ) { 49 | $this->config = $config; 50 | parent::__construct($context, $data); 51 | } 52 | 53 | /** 54 | * Get config 55 | * 56 | * @return Config 57 | */ 58 | public function getConfig(): Config 59 | { 60 | return $this->config; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Field/WebhookUrl.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Block\Adminhtml\System\Config\Field; 21 | 22 | /** 23 | * Class WebhookUrl 24 | */ 25 | class WebhookUrl extends AbstractCallbackUrl 26 | { 27 | /** 28 | * Returns the controller url. 29 | * 30 | * @return string 31 | */ 32 | public function getControllerUrl(): string 33 | { 34 | return 'webhook/callback'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Block/Apm/Form.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Block\Apm; 21 | 22 | use Magento\Framework\View\Element\Template; 23 | 24 | /** 25 | * Class Form 26 | */ 27 | class Form extends Template 28 | { 29 | } 30 | -------------------------------------------------------------------------------- /Block/Apm/Sepa/Mandate.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | namespace CheckoutCom\Magento2\Block\Apm\Sepa; 19 | 20 | use Magento\Framework\View\Element\Template; 21 | 22 | /** 23 | * Class Mandate 24 | */ 25 | class Mandate extends Template 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /Block/Paypal/Review/PaymentMethod.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2010-present Checkout.com 16 | * @license https://opensource.org/licenses/mit-license.html MIT License 17 | * @link https://docs.checkout.com/ 18 | */ 19 | namespace CheckoutCom\Magento2\Block\Paypal\Review; 20 | 21 | use CheckoutCom\Magento2\Model\Methods\PaypalMethod; 22 | use Magento\Checkout\Model\Session; 23 | use Magento\Framework\View\Element\Template; 24 | use \Magento\Framework\View\Element\Template\Context as TemplateContext; 25 | 26 | class PaymentMethod extends Template 27 | { 28 | protected Session $checkoutSession; 29 | protected PaypalMethod $paypalMethod; 30 | 31 | public function __construct( 32 | TemplateContext $context, 33 | Session $checkoutSession, 34 | PaypalMethod $paypalMethod, 35 | array $data = [] 36 | ) { 37 | parent::__construct($context, $data); 38 | $this->checkoutSession = $checkoutSession; 39 | $this->paypalMethod = $paypalMethod; 40 | } 41 | 42 | public function getEmail(): string 43 | { 44 | return (string)$this->checkoutSession->getQuote()->getCustomerEmail(); 45 | } 46 | 47 | public function getPaymentMethod(): string 48 | { 49 | return (string)$this->paypalMethod->getTitle(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Block/Paypal/Review/PlaceOrderButton.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2010-present Checkout.com 16 | * @license https://opensource.org/licenses/mit-license.html MIT License 17 | * @link https://docs.checkout.com/ 18 | */ 19 | namespace CheckoutCom\Magento2\Block\Paypal\Review; 20 | 21 | use CheckoutCom\Magento2\Controller\Paypal\Review; 22 | use CheckoutCom\Magento2\Model\Methods\PaypalMethod; 23 | use Magento\Checkout\Model\Session; 24 | use Magento\Framework\App\RequestInterface; 25 | use Magento\Framework\View\Element\Template; 26 | use \Magento\Framework\View\Element\Template\Context as TemplateContext; 27 | 28 | class PlaceOrderButton extends Template 29 | { 30 | protected Session $checkoutSession; 31 | protected RequestInterface $request; 32 | protected PaypalMethod $paypalMethod; 33 | 34 | public function __construct( 35 | TemplateContext $context, 36 | Session $checkoutSession, 37 | RequestInterface $request, 38 | PaypalMethod $paypalMethod, 39 | array $data = [] 40 | ) { 41 | parent::__construct($context, $data); 42 | $this->checkoutSession = $checkoutSession; 43 | $this->request = $request; 44 | $this->paypalMethod = $paypalMethod; 45 | } 46 | 47 | public function getEmail(): string 48 | { 49 | return (string)$this->checkoutSession->getQuote()->getCustomerEmail(); 50 | } 51 | 52 | public function canPlaceOrder(): bool 53 | { 54 | return (bool)$this->checkoutSession->getQuote()->getShippingAddress()->getShippingMethod(); 55 | } 56 | 57 | public function getPaymentMethod(): string 58 | { 59 | return (string)$this->paypalMethod->getCode(); 60 | } 61 | 62 | public function getContextId(): string 63 | { 64 | return (string)$this->request->getParam(Review::PAYMENT_CONTEXT_ID_PARAMETER); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Block/Paypal/Script.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2010-present Checkout.com 16 | * @license https://opensource.org/licenses/mit-license.html MIT License 17 | * @link https://docs.checkout.com/ 18 | */ 19 | namespace CheckoutCom\Magento2\Block\Paypal; 20 | 21 | use CheckoutCom\Magento2\Gateway\Config\Config; 22 | use CheckoutCom\Magento2\Model\Methods\PaypalMethod; 23 | use Magento\Framework\View\Element\Template; 24 | use Magento\Framework\View\Element\Template\Context as TemplateContext; 25 | 26 | class Script extends Template 27 | { 28 | private PaypalMethod $paypalMethod; 29 | private Config $checkoutConfig; 30 | 31 | public function __construct( 32 | TemplateContext $context, 33 | PaypalMethod $paypalMethod, 34 | Config $checkoutConfig, 35 | array $data = [] 36 | ) { 37 | parent::__construct($context, $data); 38 | $this->paypalMethod = $paypalMethod; 39 | $this->checkoutConfig = $checkoutConfig; 40 | } 41 | 42 | public function getPaypalMerchantId(): string 43 | { 44 | return (string)$this->paypalMethod->getConfigData('merchant_id'); 45 | } 46 | 47 | public function getClientId(): string 48 | { 49 | return (string)$this->paypalMethod->getConfigData('checkout_client_id'); 50 | } 51 | 52 | public function getPartnerAttributionId(): string 53 | { 54 | return (string)$this->paypalMethod->getConfigData('checkout_partner_attribution_id'); 55 | } 56 | 57 | public function getIntent(): string 58 | { 59 | return $this->checkoutConfig->needsAutoCapture() ? 'capture' : 'authorize'; 60 | } 61 | 62 | public function getCommit(): string 63 | { 64 | return $this->isExpressButton() ? 'false' : 'true'; 65 | } 66 | 67 | public function getPageType(): string 68 | { 69 | return $this->getScriptType() ?? 'checkout'; 70 | } 71 | 72 | private function isExpressButton(): bool 73 | { 74 | return $this->getMode() === 'express'; 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Block/Vault/Form.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | namespace CheckoutCom\Magento2\Block\Vault; 19 | 20 | use CheckoutCom\Magento2\Gateway\Config\Config; 21 | use CheckoutCom\Magento2\Model\Service\CardHandlerService; 22 | use CheckoutCom\Magento2\Model\Service\VaultHandlerService; 23 | use Magento\Framework\View\Element\Template; 24 | use Magento\Framework\View\Element\Template\Context; 25 | 26 | /** 27 | * Class Form 28 | */ 29 | class Form extends Template 30 | { 31 | /** 32 | * $cardHandler field 33 | * 34 | * @var CardHandlerService $cardHandler 35 | */ 36 | public $cardHandler; 37 | /** 38 | * $vaultHandler field 39 | * 40 | * @var VaultHandlerService $vaultHandler 41 | */ 42 | public $vaultHandler; 43 | /** 44 | * $config field 45 | * 46 | * @var Config $config 47 | */ 48 | public $config; 49 | 50 | /** 51 | * Form constructor 52 | * 53 | * @param Context $context 54 | * @param CardHandlerService $cardHandler 55 | * @param VaultHandlerService $vaultHandler 56 | * @param Config $config 57 | * @param array $data 58 | */ 59 | public function __construct( 60 | Context $context, 61 | CardHandlerService $cardHandler, 62 | VaultHandlerService $vaultHandler, 63 | Config $config, 64 | array $data = [] 65 | ) { 66 | parent::__construct($context, $data); 67 | 68 | $this->cardHandler = $cardHandler; 69 | $this->vaultHandler = $vaultHandler; 70 | $this->config = $config; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Logs/View.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace Checkoutcom\Magento2\Controller\Adminhtml\Logs; 21 | 22 | use Magento\Backend\App\Action; 23 | use Magento\Backend\App\Action\Context; 24 | use Magento\Framework\Controller\ResultInterface; 25 | use Magento\Framework\View\Result\Page; 26 | use Magento\Framework\View\Result\PageFactory; 27 | 28 | /** 29 | * Class View 30 | */ 31 | class View extends Action 32 | { 33 | /** 34 | * $resultPageFactory field 35 | * 36 | * @var PageFactory $resultPageFactory 37 | */ 38 | protected $resultPageFactory; 39 | 40 | /** 41 | * View constructor 42 | * 43 | * @param Context $context 44 | * @param PageFactory $resultPageFactory 45 | */ 46 | public function __construct( 47 | Context $context, 48 | PageFactory $resultPageFactory 49 | ) { 50 | parent::__construct($context); 51 | 52 | $this->resultPageFactory = $resultPageFactory; 53 | } 54 | 55 | /** 56 | * Load the page defined in view/adminhtml/layout/cko_logs_view.xml 57 | * 58 | * @return Page 59 | */ 60 | public function execute() 61 | { 62 | $resultPage = $this->resultPageFactory->create(); 63 | $resultPage->getConfig()->getTitle()->prepend(__('Log File Reader')); 64 | 65 | return $resultPage; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Controller/Apm/DisplayBic.php: -------------------------------------------------------------------------------- 1 | 18 | * @copyright 2004-present Agence Dn'D 19 | * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 20 | * @link https://www.dnd.fr/ 21 | */ 22 | class DisplayBic implements HttpGetActionInterface 23 | { 24 | /** 25 | * @var StoreManagerInterface 26 | */ 27 | protected $storeManager; 28 | /** 29 | * @var ApiHandlerService 30 | */ 31 | protected $apiHandler; 32 | /** 33 | * @var JsonFactory 34 | */ 35 | protected $jsonFactory; 36 | 37 | public function __construct( 38 | StoreManagerInterface $storeManager, 39 | ApiHandlerService $apiHandler, 40 | JsonFactory $jsonFactory 41 | ) { 42 | $this->storeManager = $storeManager; 43 | $this->apiHandler = $apiHandler; 44 | $this->jsonFactory = $jsonFactory; 45 | } 46 | 47 | /** 48 | * @throws NoSuchEntityException 49 | * @throws CheckoutArgumentException 50 | * @throws CheckoutApiException 51 | */ 52 | public function execute() 53 | { 54 | // Get the store code 55 | $storeCode = $this->storeManager->getStore()->getCode(); 56 | 57 | // Initialize the API handler 58 | $checkoutApi = $this->apiHandler 59 | ->init($storeCode, ScopeInterface::SCOPE_STORE) 60 | ->getCheckoutApi(); 61 | 62 | $response = $checkoutApi->getIdealClient()->getIssuers(); 63 | 64 | if (!isset($response['countries'])) { 65 | return $this->jsonFactory->create()->setData([]); 66 | } 67 | 68 | $issuers = []; 69 | 70 | foreach ($response['countries'] as $country) { 71 | foreach ($country['issuers'] as $value) { 72 | $issuers[] = $value; 73 | } 74 | } 75 | 76 | return $this->jsonFactory->create()->setData($issuers); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Controller/Klarna/GetCustomerDatas.php: -------------------------------------------------------------------------------- 1 | 14 | * @copyright 2010-present Checkout.com 15 | * @license https://opensource.org/licenses/mit-license.html MIT License 16 | * @link https://docs.checkout.com/ 17 | */ 18 | 19 | namespace CheckoutCom\Magento2\Controller\Klarna; 20 | 21 | use CheckoutCom\Magento2\Model\Service\QuoteHandlerService; 22 | use Magento\Framework\App\Action\HttpPostActionInterface; 23 | use Magento\Framework\App\RequestInterface; 24 | use Magento\Framework\Controller\Result\Json; 25 | use Magento\Framework\Controller\Result\JsonFactory; 26 | 27 | class GetCustomerDatas implements HttpPostActionInterface 28 | { 29 | protected JsonFactory $resultJsonFactory; 30 | protected RequestInterface $request; 31 | protected QuoteHandlerService $quoteHandlerService; 32 | 33 | public function __construct( 34 | JsonFactory $resultJsonFactory, 35 | RequestInterface $request, 36 | QuoteHandlerService $quoteHandlerService 37 | ) { 38 | $this->resultJsonFactory = $resultJsonFactory; 39 | $this->request = $request; 40 | $this->quoteHandlerService = $quoteHandlerService; 41 | } 42 | 43 | /** 44 | * @inheritDoc 45 | */ 46 | public function execute(): Json 47 | { 48 | // Get the request data 49 | $quoteId = $this->request->getParam('quote_id'); 50 | $storeId = $this->request->getParam('store_id'); 51 | 52 | // Try to load a quote 53 | $quote = $this->quoteHandlerService->getQuote([ 54 | 'entity_id' => $quoteId, 55 | 'store_id' => $storeId, 56 | ]); 57 | 58 | $resultJson = $this->resultJsonFactory->create(); 59 | $resultJson->setData( 60 | [ 61 | 'billing' => $this->quoteHandlerService->getBillingAddress()->toArray(), 62 | ] 63 | ); 64 | 65 | return $resultJson; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Controller/Paypal/Context.php: -------------------------------------------------------------------------------- 1 | 14 | * @copyright 2010-present Checkout.com 15 | * @license https://opensource.org/licenses/mit-license.html MIT License 16 | * @link https://docs.checkout.com/ 17 | */ 18 | 19 | namespace CheckoutCom\Magento2\Controller\Paypal; 20 | 21 | use Checkout\Payments\Request\Source\AbstractRequestSource; 22 | use Checkout\Payments\Request\Source\Contexts\PaymentContextsPayPalSource; 23 | use CheckoutCom\Magento2\Model\Service\PaymentContextRequestService; 24 | use Magento\Framework\App\Action\HttpPostActionInterface; 25 | use Magento\Framework\App\RequestInterface; 26 | use Magento\Framework\Controller\Result\Json; 27 | use Magento\Framework\Controller\Result\JsonFactory; 28 | 29 | class Context implements HttpPostActionInterface 30 | { 31 | protected JsonFactory $resultJsonFactory; 32 | protected PaymentContextRequestService $paymentContextRequestService; 33 | protected RequestInterface $request; 34 | 35 | public function __construct( 36 | JsonFactory $resultJsonFactory, 37 | PaymentContextRequestService $paymentContextRequestService, 38 | RequestInterface $request 39 | ) { 40 | $this->resultJsonFactory = $resultJsonFactory; 41 | $this->paymentContextRequestService = $paymentContextRequestService; 42 | $this->request = $request; 43 | } 44 | 45 | /** 46 | * @inheritDoc 47 | */ 48 | public function execute(): Json 49 | { 50 | $resultJson = $this->resultJsonFactory->create(); 51 | $resultJson->setData( 52 | [ 53 | 'content' => $this->paymentContextRequestService 54 | ->setShippingFeesAsItem(false) 55 | ->collectDiscountAmountOnItemUnitPrice(true) 56 | ->setForceAuthorizeMode((bool)$this->request->getParam('forceAuthorizeMode')) 57 | ->makePaymentContextRequests( 58 | $this->getPaypalContext() 59 | ), 60 | ] 61 | ); 62 | 63 | return $resultJson; 64 | } 65 | 66 | private function getPaypalContext(): AbstractRequestSource 67 | { 68 | return new PaymentContextsPayPalSource(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Controller/Paypal/SaveExpressShippingMethod.php: -------------------------------------------------------------------------------- 1 | 14 | * @copyright 2010-present Checkout.com 15 | * @license https://opensource.org/licenses/mit-license.html MIT License 16 | * @link https://docs.checkout.com/ 17 | */ 18 | namespace CheckoutCom\Magento2\Controller\Paypal; 19 | 20 | use Magento\Framework\App\Action\HttpGetActionInterface; 21 | use Magento\Framework\Controller\Result\Redirect; 22 | 23 | class SaveExpressShippingMethod extends SaveData implements HttpGetActionInterface 24 | { 25 | /** 26 | * @inheritDoc 27 | */ 28 | public function execute(): Redirect 29 | { 30 | $quote = $this->checkoutSession->getQuote(); 31 | 32 | $redirectToCart = $this->shouldRedirectToCart(); 33 | $methodCode = $this->request->getParam(Review::SHIPPING_METHOD_PARAMETER); 34 | if (!$redirectToCart && !$methodCode) { 35 | $this->messageManager->addErrorMessage(__('Missing shipping method')); 36 | 37 | return $this->redirectFactory->create()->setRefererUrl(); 38 | } 39 | 40 | if ($redirectToCart) { 41 | return $this->redirectFactory->create()->setUrl($this->urlInterface->getUrl('checkout/cart')); 42 | } 43 | 44 | // Save Shipping address 45 | try { 46 | $shippingAddress = $quote->getShippingAddress(); 47 | $shippingAddress->setShippingMethod($methodCode)->setCollectShippingRates(true); 48 | $cartExtension = $quote->getExtensionAttributes(); 49 | if ($cartExtension && $cartExtension->getShippingAssignments()) { 50 | $cartExtension->getShippingAssignments()[0] 51 | ->getShipping() 52 | ->setMethod($methodCode); 53 | } 54 | $quote->collectTotals(); 55 | 56 | $this->cartRepository->save($quote); 57 | } catch (Exception $e) { 58 | $this->logger->write(__('Error occured while saving paypal express shipping method: %1', $e->getMessage())); 59 | $this->messageManager->addErrorMessage(__('An error occurred while saving shipping method')); 60 | } 61 | 62 | return $this->redirectFactory->create()->setRefererUrl(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Exception/WebhookEventAlreadyExistsException.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Exception; 21 | 22 | use Magento\Framework\Exception\AlreadyExistsException; 23 | 24 | class WebhookEventAlreadyExistsException extends AlreadyExistsException 25 | { 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Checkout.com 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Logger/Handler/InfoHandler.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2004-present Agence Dn'D 13 | * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 14 | * @link https://www.dnd.fr/ 15 | */ 16 | class InfoHandler extends BaseHandler 17 | { 18 | protected $fileName = '/var/log/checkoutcom_magento2_gateway.log'; 19 | protected $loggerType = MonologLogger::INFO; 20 | } 21 | -------------------------------------------------------------------------------- /Logger/Handler/Logger.php: -------------------------------------------------------------------------------- 1 | 11 | * @copyright 2004-present Agence Dn'D 12 | * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 13 | * @link https://www.dnd.fr/ 14 | */ 15 | class Logger extends Monolog 16 | { 17 | } 18 | -------------------------------------------------------------------------------- /Logger/ResponseHandler.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2004-present Agence Dn'D 16 | * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 17 | * @link https://www.dnd.fr/ 18 | */ 19 | class ResponseHandler 20 | { 21 | private const FILE_EXTENSION = '.log'; 22 | private const FILE_NAME = 'checkoutcom_magento2_gateway_{{date}}'; 23 | private const DATE_FORMAT = 'Ymd-H:i:s'; 24 | 25 | /** 26 | * @var TimezoneInterface $timezone 27 | */ 28 | private $timezone; 29 | /** 30 | * @var InfoHandlerFactory $infoHandlerFactory 31 | */ 32 | private $infoHandlerFactory; 33 | /** 34 | * @var LoggerFactory $loggerFactory 35 | */ 36 | private $loggerFactory; 37 | /** 38 | * @var DirectoryList $directoryList 39 | */ 40 | private $directoryList; 41 | 42 | public function __construct( 43 | TimezoneInterface $timezone, 44 | InfoHandlerFactory $infoHandlerFactory, 45 | LoggerFactory $loggerFactory, 46 | DirectoryList $directoryList 47 | ) { 48 | $this->timezone = $timezone; 49 | $this->infoHandlerFactory = $infoHandlerFactory; 50 | $this->loggerFactory = $loggerFactory; 51 | $this->directoryList = $directoryList; 52 | } 53 | 54 | public function log(string $message): void 55 | { 56 | $filePath = $this->getFilePath(); 57 | 58 | $infoHandler = $this->infoHandlerFactory->create( 59 | [ 60 | 'fileName' => $filePath, 61 | ] 62 | ); 63 | 64 | $logger = $this->loggerFactory->create( 65 | [ 66 | 'handlers' => [ 67 | 'info' => $infoHandler, 68 | ], 69 | ] 70 | ); 71 | 72 | $logger->info($message); 73 | } 74 | 75 | private function getFilePath(): string 76 | { 77 | return DIRECTORY_SEPARATOR . $this->directoryList->getDefaultConfig()[DirectoryList::LOG]['path'] . DIRECTORY_SEPARATOR . $this->getFilename() . self::FILE_EXTENSION; 78 | } 79 | 80 | private function getFilename(): string 81 | { 82 | return str_replace('{{date}}', $this->timezone->date()->format(self::DATE_FORMAT), self::FILE_NAME); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigAlternativePayments.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use CheckoutCom\Magento2\Gateway\Config\Loader; 23 | use Magento\Framework\Data\OptionSourceInterface; 24 | 25 | /** 26 | * Class ConfigAlternativePayments 27 | */ 28 | class ConfigAlternativePayments implements OptionSourceInterface 29 | { 30 | /** 31 | * $configLoader field 32 | * 33 | * @var Loader $configLoader 34 | */ 35 | private $configLoader; 36 | 37 | /** 38 | * ConfigAlternativePayments constructor 39 | * 40 | * @param Loader $configLoader 41 | */ 42 | public function __construct( 43 | Loader $configLoader 44 | ) { 45 | $this->configLoader = $configLoader; 46 | } 47 | 48 | /** 49 | * {@inheritDoc} 50 | * 51 | * @return string[][] 52 | */ 53 | public function toOptionArray(): array 54 | { 55 | return $this->configLoader->loadApmList(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigApplePayButton.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigApplePayButton 26 | */ 27 | class ConfigApplePayButton implements OptionSourceInterface 28 | { 29 | /** 30 | * BUTTON_BLACK constant 31 | * 32 | * @var string BUTTON_BLACK 33 | */ 34 | const BUTTON_BLACK = 'black'; 35 | /** 36 | * BUTTON_WHITE constant 37 | * 38 | * @var string BUTTON_WHITE 39 | */ 40 | const BUTTON_WHITE = 'white'; 41 | /** 42 | * BUTTON_WHITE_LINE constant 43 | * 44 | * @var string BUTTON_WHITE_LINE 45 | */ 46 | const BUTTON_WHITE_LINE = 'white-with-line'; 47 | 48 | /** 49 | * Possible Apple Pay button styles 50 | * 51 | * @return string[][] 52 | */ 53 | public function toOptionArray(): array 54 | { 55 | return [ 56 | [ 57 | 'value' => self::BUTTON_BLACK, 58 | 'label' => __('Black') 59 | ], 60 | [ 61 | 'value' => self::BUTTON_WHITE, 62 | 'label' => __('White') 63 | ], 64 | [ 65 | 'value' => self::BUTTON_WHITE_LINE, 66 | 'label' => __('White with line') 67 | ], 68 | ]; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigApplePayCapabilities.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigApplePayCapabilities 26 | */ 27 | class ConfigApplePayCapabilities implements OptionSourceInterface 28 | { 29 | /** 30 | * CAP_CRE constant 31 | * 32 | * @var string CAP_CRE 33 | */ 34 | const CAP_CRE = 'supportsCredit'; 35 | /** 36 | * CAP_DEB constant 37 | * 38 | * @var string CAP_DEB 39 | */ 40 | const CAP_DEB = 'supportsDebit'; 41 | 42 | /** 43 | * Possible Apple Pay Cards 44 | * 45 | * @return string[][] 46 | */ 47 | public function toOptionArray(): array 48 | { 49 | return [ 50 | [ 51 | 'value' => self::CAP_CRE, 52 | 'label' => __('Credit cards') 53 | ], 54 | [ 55 | 'value' => self::CAP_DEB, 56 | 'label' => __('Debit cards') 57 | ], 58 | ]; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigApplePayNetworks.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigApplePayNetworks 26 | */ 27 | class ConfigApplePayNetworks implements OptionSourceInterface 28 | { 29 | /** 30 | * CARD_VISA constant 31 | * 32 | * @var string CARD_VISA 33 | */ 34 | const CARD_VISA = 'visa'; 35 | /** 36 | * CARD_MASTERCARD constant 37 | * 38 | * @var string CARD_MASTERCARD 39 | */ 40 | const CARD_MASTERCARD = 'masterCard'; 41 | /** 42 | * CARD_AMEX constant 43 | * 44 | * @var string CARD_AMEX 45 | */ 46 | const CARD_AMEX = 'amex'; 47 | /** 48 | * CARD_MADA constant 49 | * 50 | * @var string CARD_MADA 51 | */ 52 | const CARD_MADA = 'mada'; 53 | 54 | /** 55 | * Possible Apple Pay Cards 56 | * 57 | * @return string[][] 58 | */ 59 | public function toOptionArray(): array 60 | { 61 | return [ 62 | [ 63 | 'value' => self::CARD_VISA, 64 | 'label' => __('Visa') 65 | ], 66 | [ 67 | 'value' => self::CARD_MASTERCARD, 68 | 'label' => __('Mastercard') 69 | ], 70 | [ 71 | 'value' => self::CARD_AMEX, 72 | 'label' => __('American Express') 73 | ], 74 | [ 75 | 'value' => self::CARD_MADA, 76 | 'label' => __('MADA') 77 | ], 78 | ]; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigCardIcons.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use CheckoutCom\Magento2\Model\Service\CardHandlerService; 23 | use Magento\Framework\Data\OptionSourceInterface; 24 | 25 | /** 26 | * Class ConfigCardIcons 27 | */ 28 | class ConfigCardIcons implements OptionSourceInterface 29 | { 30 | /** 31 | * Options getter 32 | * 33 | * @return string[][] 34 | */ 35 | public function toOptionArray(): array 36 | { 37 | $output = []; 38 | foreach (CardHandlerService::CARD_MAPPER as $value => $label) { 39 | $output[] = [ 40 | 'value' => $value, 41 | 'label' => __($label) 42 | ]; 43 | } 44 | 45 | return $output; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigDefaultMethod.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use CheckoutCom\Magento2\Gateway\Config\Config; 23 | use Magento\Framework\Data\OptionSourceInterface; 24 | 25 | /** 26 | * Class ConfigDefaultMethod 27 | */ 28 | class ConfigDefaultMethod implements OptionSourceInterface 29 | { 30 | /** 31 | * $config field 32 | * 33 | * @var Config $config 34 | */ 35 | private $config; 36 | 37 | /** 38 | * ConfigDefaultMethod constructor 39 | * 40 | * @param Config $config 41 | */ 42 | public function __construct( 43 | Config $config 44 | ) { 45 | $this->config = $config; 46 | } 47 | 48 | /** 49 | * Return the order status options 50 | * 51 | * @return string[][] 52 | */ 53 | public function toOptionArray(): array 54 | { 55 | // Prepare the default array 56 | $options = [ 57 | 'value' => '', 58 | 'label' => __('None') 59 | ]; 60 | 61 | // Get the available payment methods 62 | $methods = $this->config->getMethodsConfig(); 63 | 64 | // Build an array of options 65 | foreach ($methods as $id => $data) { 66 | $options[] = [ 67 | 'value' => $id, 68 | 'label' => __($data['title']) 69 | ]; 70 | } 71 | 72 | return $options; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigEnvironment.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigEnvironment 26 | */ 27 | class ConfigEnvironment implements OptionSourceInterface 28 | { 29 | /** 30 | * Options getter 31 | * 32 | * @return string[][] 33 | */ 34 | public function toOptionArray(): array 35 | { 36 | return [ 37 | [ 38 | 'value' => 1, 39 | 'label' => __('Test') 40 | ], 41 | [ 42 | 'value' => 0, 43 | 'label' => __('Production') 44 | ] 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigFormTheme.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigFormTheme 26 | */ 27 | class ConfigFormTheme implements OptionSourceInterface 28 | { 29 | /** 30 | * Language fallback 31 | * 32 | * @return string[][] 33 | */ 34 | public function toOptionArray(): array 35 | { 36 | return [ 37 | [ 38 | 'value' => 'standard', 39 | 'label' => __('Standard') 40 | ], 41 | [ 42 | 'value' => 'simple', 43 | 'label' => __('Simple') 44 | ] 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigGooglePayButton.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigGooglePayButton 26 | */ 27 | class ConfigGooglePayButton implements OptionSourceInterface 28 | { 29 | /** 30 | * BUTTON_BLACK constant 31 | * 32 | * @var string BUTTON_BLACK 33 | */ 34 | const BUTTON_BLACK = 'black'; 35 | /** 36 | * BUTTON_WHITE constant 37 | * 38 | * @var string BUTTON_WHITE 39 | */ 40 | const BUTTON_WHITE = 'white'; 41 | 42 | /** 43 | * Possible Google Pay button styles 44 | * 45 | * @return string[][] 46 | */ 47 | public function toOptionArray(): array 48 | { 49 | return [ 50 | [ 51 | 'value' => self::BUTTON_BLACK, 52 | 'label' => __('Black') 53 | ], 54 | [ 55 | 'value' => self::BUTTON_WHITE, 56 | 'label' => __('White') 57 | ], 58 | ]; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigGooglePayEnvironment.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigGooglePayEnvironment 26 | */ 27 | class ConfigGooglePayEnvironment implements OptionSourceInterface 28 | { 29 | /** 30 | * ENVIRONMENT_TEST constant 31 | * 32 | * @var string ENVIRONMENT_TEST 33 | */ 34 | const ENVIRONMENT_TEST = 'TEST'; 35 | /** 36 | * ENVIRONMENT_PRODUCTION constant 37 | * 38 | * @var string ENVIRONMENT_PRODUCTION 39 | */ 40 | const ENVIRONMENT_PRODUCTION = 'PRODUCTION'; 41 | 42 | /** 43 | * Possible environment types 44 | * 45 | * @return string[][] 46 | */ 47 | public function toOptionArray(): array 48 | { 49 | return [ 50 | [ 51 | 'value' => self::ENVIRONMENT_TEST, 52 | 'label' => __('Test') 53 | ], 54 | [ 55 | 'value' => self::ENVIRONMENT_PRODUCTION, 56 | 'label' => __('Production') 57 | ] 58 | ]; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigGooglePayNetworks.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigGooglePayNetworks 26 | */ 27 | class ConfigGooglePayNetworks implements OptionSourceInterface 28 | { 29 | /** 30 | * CARD_VISA string 31 | * 32 | * @var string CARD_VISA 33 | */ 34 | const CARD_VISA = 'VISA'; 35 | /** 36 | * CARD_MASTERCARD string 37 | * 38 | * @var string CARD_MASTERCARD 39 | */ 40 | const CARD_MASTERCARD = 'MASTERCARD'; 41 | /** 42 | * CARD_AMEX string 43 | * 44 | * @var string CARD_AMEX 45 | */ 46 | const CARD_AMEX = 'AMEX'; 47 | /** 48 | * CARD_JCB string 49 | * 50 | * @var string CARD_JCB 51 | */ 52 | const CARD_JCB = 'JCB'; 53 | /** 54 | * CARD_DISCOVER string 55 | * 56 | * @var string CARD_DISCOVER 57 | */ 58 | const CARD_DISCOVER = 'DISCOVER'; 59 | 60 | /** 61 | * Possible Google Pay Cards 62 | * 63 | * @return string[][] 64 | */ 65 | public function toOptionArray(): array 66 | { 67 | return [ 68 | [ 69 | 'value' => self::CARD_VISA, 70 | 'label' => __('Visa') 71 | ], 72 | [ 73 | 'value' => self::CARD_MASTERCARD, 74 | 'label' => __('Mastercard') 75 | ], 76 | [ 77 | 'value' => self::CARD_AMEX, 78 | 'label' => __('American Express') 79 | ], 80 | [ 81 | 'value' => self::CARD_JCB, 82 | 'label' => __('JCB') 83 | ], 84 | [ 85 | 'value' => self::CARD_DISCOVER, 86 | 'label' => __('Discover') 87 | ], 88 | ]; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigLanguageFallback.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigLanguageFallback 26 | */ 27 | class ConfigLanguageFallback implements OptionSourceInterface 28 | { 29 | /** 30 | * Language fallback 31 | * 32 | * @return string[][] 33 | */ 34 | public function toOptionArray(): array 35 | { 36 | return [ 37 | [ 38 | 'value' => 'EN-GB', 39 | 'label' => __('English') 40 | ], 41 | [ 42 | 'value' => 'ES-ES', 43 | 'label' => __('Spanish') 44 | ], 45 | [ 46 | 'value' => 'DE-DE', 47 | 'label' => __('German') 48 | ], 49 | [ 50 | 'value' => 'KR-KR', 51 | 'label' => __('Korean') 52 | ], 53 | [ 54 | 'value' => 'FR-FR', 55 | 'label' => __('French') 56 | ], 57 | [ 58 | 'value' => 'IT-IT', 59 | 'label' => __('Italian') 60 | ], 61 | [ 62 | 'value' => 'NL-NL', 63 | 'label' => __('Dutch') 64 | ] 65 | ]; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigOrderActionFailedPayment.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | declare(strict_types=1); 18 | 19 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 20 | 21 | use Magento\Framework\Data\OptionSourceInterface; 22 | 23 | /** 24 | * Class ConfigOrderActionFailedPayment 25 | */ 26 | class ConfigOrderActionFailedPayment implements OptionSourceInterface 27 | { 28 | /** 29 | * Options getter 30 | * 31 | * @return string[][] 32 | */ 33 | public function toOptionArray(): array 34 | { 35 | return [ 36 | [ 37 | 'value' => 'cancel', 38 | 'label' => __('Cancel the order') 39 | ], 40 | [ 41 | 'value' => 'delete', 42 | 'label' => __('Delete the order') 43 | ], 44 | [ 45 | 'value' => 'pending', 46 | 'label' => __('Do nothing') 47 | ] 48 | ]; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigOrderStatus.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | use Magento\Sales\Model\ResourceModel\Order\Status\Collection; 24 | 25 | /** 26 | * Class ConfigOrderStatus 27 | */ 28 | class ConfigOrderStatus implements OptionSourceInterface 29 | { 30 | /** 31 | * $orderStatusCollection field 32 | * 33 | * @var Collection $orderStatusCollection 34 | */ 35 | private $orderStatusCollection; 36 | 37 | /** 38 | * ConfigOrderStatus constructor 39 | * 40 | * @param Collection $orderStatusCollection 41 | */ 42 | public function __construct( 43 | Collection $orderStatusCollection 44 | ) { 45 | $this->orderStatusCollection = $orderStatusCollection; 46 | } 47 | 48 | /** 49 | * Return the order status options 50 | * 51 | * @return string[][] 52 | */ 53 | public function toOptionArray(): array 54 | { 55 | return $this->getStatusOptions(); 56 | } 57 | 58 | /** 59 | * Get the order status options 60 | * 61 | * @return string[][] 62 | */ 63 | public function getStatusOptions(): array 64 | { 65 | // Return the options as array 66 | return $this->orderStatusCollection->toOptionArray(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigPaymentAction.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigPaymentAction 26 | */ 27 | class ConfigPaymentAction implements OptionSourceInterface 28 | { 29 | /** 30 | * Options getter 31 | * 32 | * @return string[][] 33 | */ 34 | public function toOptionArray(): array 35 | { 36 | return [ 37 | [ 38 | 'value' => 'authorize', 39 | 'label' => __('Authorize') 40 | ], 41 | [ 42 | 'value' => 'authorize_capture', 43 | 'label' => __('Authorize and Capture') 44 | ] 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigPaymentFormLayout.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigPaymentFormLayout 26 | */ 27 | class ConfigPaymentFormLayout implements OptionSourceInterface 28 | { 29 | /** 30 | * Payment form layout 31 | * 32 | * @return string[][] 33 | */ 34 | public function toOptionArray(): array 35 | { 36 | return [ 37 | [ 38 | 'value' => 'single', 39 | 'label' => __('Single iframe') 40 | ], 41 | [ 42 | 'value' => 'multi', 43 | 'label' => __('Multiple iframes') 44 | ] 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigPaymentProcesing.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigDefaultMethod 26 | */ 27 | class ConfigPaymentProcesing implements OptionSourceInterface 28 | { 29 | /** 30 | * PAYMENT_FIRST constant 31 | * 32 | * @var string PAYMENT_FIRST 33 | */ 34 | const PAYMENT_FIRST = 'payment_first'; 35 | /** 36 | * ORDER_FIRST constant 37 | * 38 | * @var string ORDER_FIRST 39 | */ 40 | const ORDER_FIRST = 'order_first'; 41 | 42 | /** 43 | * Return the order status options 44 | * 45 | * @return string[][] 46 | */ 47 | public function toOptionArray(): array 48 | { 49 | // Return the default array 50 | return [ 51 | [ 52 | 'value' => self::PAYMENT_FIRST, 53 | 'label' => __('Payment first'), 54 | ], 55 | [ 56 | 'value' => self::ORDER_FIRST, 57 | 'label' => __('Order first'), 58 | ], 59 | ]; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigRegion.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | class ConfigRegion implements OptionSourceInterface 25 | { 26 | public const REGION_GLOBAL = 'global'; 27 | public const REGION_KSA = 'ksa'; 28 | 29 | /** 30 | * Options getter 31 | * 32 | * @return string[][] 33 | */ 34 | public function toOptionArray(): array 35 | { 36 | return [ 37 | [ 38 | 'value' => self::REGION_GLOBAL, 39 | 'label' => __('--') 40 | ], 41 | [ 42 | 'value' => self::REGION_KSA, 43 | 'label' => __('KSA') 44 | ] 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigService.php: -------------------------------------------------------------------------------- 1 | 'ABC', 41 | 'value' => self::SERVICE_ABC 42 | ], 43 | [ 44 | 'label' => 'NAS', 45 | 'value' => self::SERVICE_NAS 46 | ] 47 | ]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Model/Config/Backend/Source/ConfigWebhooks.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\Config\Backend\Source; 21 | 22 | use Magento\Framework\Data\OptionSourceInterface; 23 | 24 | /** 25 | * Class ConfigWebhooks 26 | */ 27 | class ConfigWebhooks implements OptionSourceInterface 28 | { 29 | /** 30 | * Options getter 31 | * 32 | * @return string[][] 33 | */ 34 | public function toOptionArray(): array 35 | { 36 | return [ 37 | [ 38 | 'value' => 'webhook', 39 | 'label' => __('Webhook') 40 | ], 41 | [ 42 | 'value' => 'cron', 43 | 'label' => __('Cron Job') 44 | ] 45 | ]; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Model/Files/Mada/apm_list.csv: -------------------------------------------------------------------------------- 1 | Id,Title 2 | alipay,Alipay 3 | boleto,Boleto 4 | ideal,Ideal 5 | poli,Poli 6 | sepa,Sepa 7 | sofort,Sofort 8 | klarna,Klarna 9 | eps,EPS 10 | -------------------------------------------------------------------------------- /Model/Files/Mada/mada_test.csv: -------------------------------------------------------------------------------- 1 | Bank Name,BIN,PAN Length,Card Brand,isOld 2 | CKO Test Cards,424242,16,Visa Credit Card,Yes 3 | CKO Test Cards,249996,16,Visa Credit Card,Yes 4 | CKO Test Cards,606378,16,Mastercard Credit Card,Yes 5 | CKO Test Cards,479399,16,Mastercard Credit Card,Yes 6 | CKO Test Cards,641465,16,Mastercard Credit Card,Yes 7 | CKO Test Cards,234564,15,AMEX Credit Card,Yes 8 | CKO Test Cards,310005,15,AMEX Credit Card,Yes 9 | CKO Test Cards,789019,14,DinersClub Credit Card,Yes 10 | CKO Test Cards,111117,16,Discover Credit Card,Yes 11 | CKO Test Cards,300000,16,JCB Credit Card,Yes 12 | CKO Test Cards,000001,16,Visa Debit Card,Yes 13 | CKO Test Cards,346654,16,Mastercard Debit Card,Yes 14 | CKO Test Cards,035519,16,Visa Commercial Card,Yes 15 | CKO Test Cards,003404,16,Mastercard Commercial Card,Yes -------------------------------------------------------------------------------- /Model/InstantPurchase/AvailabilityChecker.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\InstantPurchase; 21 | 22 | use CheckoutCom\Magento2\Gateway\Config\Config; 23 | use CheckoutCom\Magento2\Model\Service\VaultHandlerService; 24 | 25 | /** 26 | * Class AvailabilityChecker 27 | */ 28 | class AvailabilityChecker 29 | { 30 | /** 31 | * $config field 32 | * 33 | * @var Config $config 34 | */ 35 | private $config; 36 | /** 37 | * $vaultHandler field 38 | * 39 | * @var VaultHandlerService $vaultHandler 40 | */ 41 | private $vaultHandler; 42 | 43 | /** 44 | * AvailabilityChecker constructor 45 | * 46 | * @param Config $config 47 | * @param VaultHandlerService $vaultHandler 48 | */ 49 | public function __construct( 50 | Config $config, 51 | VaultHandlerService $vaultHandler 52 | ) { 53 | $this->config = $config; 54 | $this->vaultHandler = $vaultHandler; 55 | } 56 | 57 | /** 58 | * Description isAvailable function 59 | * 60 | * @return bool 61 | */ 62 | public function isAvailable(): bool 63 | { 64 | // Get the vault state 65 | $vaultEnabled = $this->config->getValue( 66 | 'active', 67 | 'checkoutcom_vault' 68 | ); 69 | 70 | // Get the instant purchase state 71 | $instantPurchaseEnabled = $this->config->getValue( 72 | 'instant_purchase_enabled', 73 | 'checkoutcom_vault' 74 | ); 75 | 76 | $madaEnabled = $this->config->getValue('mada_enabled', 'checkoutcom_vault'); 77 | 78 | return $vaultEnabled 79 | && $instantPurchaseEnabled 80 | && !$madaEnabled 81 | && $this->vaultHandler->userHasCards(); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Model/InstantPurchase/ShippingSelector.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\InstantPurchase; 21 | 22 | use Magento\Quote\Model\Quote\Address; 23 | use Magento\Quote\Model\Quote\Address\Rate as QuoteAddressRate; 24 | 25 | /** 26 | * Class ShippingSelector 27 | */ 28 | class ShippingSelector 29 | { 30 | /** 31 | * Selects a shipping method. 32 | * 33 | * @param Address $address 34 | * 35 | * @return string 36 | */ 37 | public function getShippingMethod(Address $address): ?string 38 | { 39 | $address->setCollectShippingRates(true); 40 | $address->collectShippingRates(); 41 | $shippingRates = $address->getAllShippingRates(); 42 | 43 | if (empty($shippingRates)) { 44 | return null; 45 | } 46 | 47 | return $this->selectCheapestRate($shippingRates)->getCode(); 48 | } 49 | 50 | /** 51 | * Selects shipping price with minimal price. 52 | * 53 | * @param QuoteAddressRate[] $shippingRates 54 | * 55 | * @return QuoteAddressRate 56 | */ 57 | private function selectCheapestRate(array $shippingRates): QuoteAddressRate 58 | { 59 | $rate = array_shift($shippingRates); 60 | foreach ($shippingRates as $tmpRate) { 61 | if ($tmpRate->getPrice() < $rate->getPrice()) { 62 | $rate = $tmpRate; 63 | } 64 | } 65 | 66 | return $rate; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Model/InstantPurchase/TokenFormatter.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Model\InstantPurchase; 21 | 22 | use CheckoutCom\Magento2\Model\Service\VaultHandlerService; 23 | use Magento\Vault\Api\Data\PaymentTokenInterface; 24 | 25 | /** 26 | * Class TokenFormatter 27 | */ 28 | class TokenFormatter 29 | { 30 | /** 31 | * $vaultHandler field 32 | * 33 | * @var VaultHandlerService $vaultHandler 34 | */ 35 | private $vaultHandler; 36 | 37 | /** 38 | * TokenFormatter constructor 39 | * 40 | * @param VaultHandlerService $vaultHandler 41 | */ 42 | public function __construct( 43 | VaultHandlerService $vaultHandler 44 | ) { 45 | $this->vaultHandler = $vaultHandler; 46 | } 47 | 48 | /** 49 | * Description formatPaymentToken function 50 | * 51 | * @param PaymentTokenInterface $paymentToken 52 | * 53 | * @return string 54 | */ 55 | public function formatPaymentToken(PaymentTokenInterface $paymentToken): string 56 | { 57 | // Return the formatted token 58 | return $this->vaultHandler->renderTokenData($paymentToken); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Model/ResourceModel/WebhookEntity.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | declare(strict_types=1); 18 | 19 | namespace CheckoutCom\Magento2\Model\ResourceModel; 20 | 21 | use Magento\Framework\Model\ResourceModel\Db\AbstractDb; 22 | use Magento\Framework\Model\ResourceModel\Db\Context; 23 | 24 | /** 25 | * Class WebhookEntity mysql resource 26 | */ 27 | class WebhookEntity extends AbstractDb 28 | { 29 | /** @var array */ 30 | protected $_uniqueFields = [['field' => 'event_id', 'title' => 'event_id should be unique']]; 31 | /** 32 | * WebhookEntity constructor 33 | * 34 | * @param Context $context 35 | * @param null $resourcePrefix 36 | */ 37 | public function __construct( 38 | Context $context, 39 | $resourcePrefix = null 40 | ) { 41 | parent::__construct($context, $resourcePrefix); 42 | } 43 | 44 | /** 45 | * Initialize resource model. 46 | * 47 | * @return void 48 | */ 49 | protected function _construct(): void 50 | { 51 | $this->_init('checkoutcom_webhooks', 'id'); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Model/ResourceModel/WebhookEntity/Collection.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | declare(strict_types=1); 18 | 19 | namespace CheckoutCom\Magento2\Model\ResourceModel\WebhookEntity; 20 | 21 | use CheckoutCom\Magento2\Model\Entity\WebhookEntity as WebhookEntityModel; 22 | use CheckoutCom\Magento2\Model\ResourceModel\WebhookEntity as WebhookEntityResource; 23 | use Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection; 24 | 25 | /** 26 | * Class Collection 27 | */ 28 | class Collection extends AbstractCollection 29 | { 30 | /** 31 | * $_idFieldName field 32 | * 33 | * @var string $_idFieldName 34 | */ 35 | protected $_idFieldName = 'id'; 36 | 37 | /** 38 | * Define the resource model 39 | * 40 | * @return void 41 | */ 42 | protected function _construct(): void 43 | { 44 | $this->_init( 45 | WebhookEntityModel::class, 46 | WebhookEntityResource::class 47 | ); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Plugin/AddConfigDataToCart.php: -------------------------------------------------------------------------------- 1 | config = $config; 21 | $this->compositeConfigProvider = $compositeConfigProvider; 22 | } 23 | 24 | public function afterGetSectionData(Cart $subject, array $result): array 25 | { 26 | $configProvider = ['checkoutConfigProvider' => $this->compositeConfigProvider->getConfig()]; 27 | 28 | return array_merge($this->config->getMethodsConfig(), $configProvider, $result); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Plugin/AfterPlaceOrder.php: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | declare(strict_types=1); 18 | 19 | namespace CheckoutCom\Magento2\Plugin; 20 | 21 | use CheckoutCom\Magento2\Gateway\Config\Config; 22 | use Magento\Framework\Exception\LocalizedException; 23 | use Magento\Sales\Api\Data\OrderInterface; 24 | use Magento\Sales\Api\OrderManagementInterface; 25 | 26 | /** 27 | * Class AfterPlaceOrder 28 | */ 29 | class AfterPlaceOrder 30 | { 31 | /** 32 | * $config field 33 | * 34 | * @var Config $config 35 | */ 36 | private $config; 37 | 38 | /** 39 | * AfterPlaceOrder constructor 40 | * 41 | * @param Config $config 42 | */ 43 | public function __construct( 44 | Config $config 45 | ) { 46 | $this->config = $config; 47 | } 48 | 49 | /** 50 | * Description afterPlace function 51 | * 52 | * @param OrderManagementInterface $subject 53 | * @param OrderInterface $order 54 | * 55 | * @return OrderInterface 56 | * @throws LocalizedException 57 | */ 58 | public function afterPlace(OrderManagementInterface $subject, OrderInterface $order): OrderInterface 59 | { 60 | // Get the method ID 61 | $methodId = $order->getPayment()->getMethodInstance()->getCode(); 62 | 63 | // If can proceed 64 | if (in_array($methodId, $this->config->getMethodsList())) { 65 | // Disable the email sending 66 | $order->setCanSendNewEmailFlag(false); 67 | } 68 | 69 | return $order; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Setup/Patch/Data/CreateVerificationDate.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Setup\Patch\Data; 21 | 22 | use Magento\Framework\App\Config\Storage\WriterInterface; 23 | use Magento\Framework\DB\Adapter\AdapterInterface; 24 | use Magento\Framework\Setup\ModuleDataSetupInterface; 25 | use Magento\Framework\Setup\Patch\DataPatchInterface; 26 | 27 | class CreateVerificationDate implements DataPatchInterface 28 | { 29 | private const VERIFICATION_DATE_PATH = 'settings/checkoutcom_configuration/verification_date'; 30 | 31 | private $writer; 32 | 33 | public function __construct( 34 | WriterInterface $writer 35 | ) { 36 | $this->writer = $writer; 37 | } 38 | 39 | public static function getDependencies(): array 40 | { 41 | return []; 42 | } 43 | 44 | public function getAliases(): array 45 | { 46 | return []; 47 | } 48 | 49 | public function apply(): self 50 | { 51 | $this->writer->save(self::VERIFICATION_DATE_PATH, date('Y-m-d H:i:s')); 52 | 53 | return $this; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Setup/Patch/Schema/AddUniqueConstraintOnEventId.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | declare(strict_types=1); 19 | 20 | namespace CheckoutCom\Magento2\Setup\Patch\Schema; 21 | 22 | use CheckoutCom\Magento2\Setup\Patch\Data\DeleteDuplicateEvents; 23 | use Magento\Framework\DB\Adapter\AdapterInterface; 24 | use Magento\Framework\DB\Ddl\Table; 25 | use Magento\Framework\Setup\ModuleDataSetupInterface; 26 | use Magento\Framework\Setup\Patch\SchemaPatchInterface; 27 | use Magento\Framework\Setup\SchemaSetupInterface; 28 | 29 | class AddUniqueConstraintOnEventId implements SchemaPatchInterface 30 | { 31 | /** @var SchemaSetupInterface $setup */ 32 | private $setup; 33 | 34 | public function __construct( 35 | SchemaSetupInterface $setup 36 | ) { 37 | $this->setup = $setup; 38 | } 39 | 40 | public static function getDependencies(): array 41 | { 42 | return [DeleteDuplicateEvents::class]; 43 | } 44 | 45 | public function getAliases(): array 46 | { 47 | return []; 48 | } 49 | 50 | public function apply(): self 51 | { 52 | $this->setup->startSetup(); 53 | 54 | $this->setup->getConnection()->addIndex( 55 | $this->setup->getTable('checkoutcom_webhooks'), 56 | $this->setup->getIdxName( 57 | 'CHECKOUTCOM_WEBHOOKS_EVENT_ID_UNIQUE', 58 | ['event_id'], 59 | AdapterInterface::INDEX_TYPE_UNIQUE 60 | ), 61 | ['event_id'], 62 | AdapterInterface::INDEX_TYPE_UNIQUE 63 | ); 64 | 65 | $this->setup->endSetup(); 66 | 67 | return $this; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "checkoutcom/magento2", 3 | "description": "Checkout.com Payment Gateway for Magento 2", 4 | "require": { 5 | "checkout/checkout-sdk-php": "3.2.4", 6 | "php": "~7.4.0||~8.1.0||~8.2.0||~8.3.0", 7 | "magento/framework": ">=100.0.1" 8 | }, 9 | "type": "magento2-module", 10 | "version": "6.4.3", 11 | "autoload": { 12 | "files": [ 13 | "registration.php" 14 | ], 15 | "psr-4": { 16 | "CheckoutCom\\Magento2\\": "" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /etc/adminhtml/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | \Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE 23 | 24 | CheckoutCom_Magento2::ui/messages.phtml 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | CheckoutCom\Magento2\Block\Adminhtml\Alerts\VersionNotification 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /etc/adminhtml/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /etc/adminhtml/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /etc/cron_groups.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 60 19 | 120 20 | 2 21 | 10 22 | 60 23 | 600 24 | 1 25 | 26 | 27 | -------------------------------------------------------------------------------- /etc/crontab.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 0 * * * * 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /etc/csp_whitelist.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | https://cdn.checkout.com 21 | 22 | 23 | 24 | 25 | https://cdn.checkout.com 26 | 27 | 28 | 29 | 30 | https://*.checkout.com 31 | *.klarnacdn.net 32 | 33 | 34 | 35 | 36 | https://js.checkout.com 37 | *.klarnaevt.com 38 | 39 | 40 | 41 | 42 | https://js.checkout.com 43 | *.klarna.com 44 | 45 | 46 | 47 | 48 | data: 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /etc/db_schema.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
41 |
42 | -------------------------------------------------------------------------------- /etc/frontend/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 17 | 18 | 19 | 20 | 21 | 22 | CheckoutCom\Magento2\Model\Ui\ConfigProvider 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | CheckoutCom\Magento2\Model\InstantPurchase\CustomerData 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | \Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE 45 | 46 | CheckoutCom_Magento2::ui/messages.phtml 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /etc/frontend/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /etc/frontend/sections.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /etc/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /etc/payment.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | 21 | 0 22 | 23 | 24 | 0 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /etc/webapi.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | %customer_id% 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /etc/webapi_rest/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /etc/webapi_rest/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /registration.php: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | use Magento\Framework\Component\ComponentRegistrar; 19 | 20 | $registrar = new ComponentRegistrar(); 21 | if ($registrar->getPath(ComponentRegistrar::MODULE, 'CheckoutCom_Magento2') === null) { 22 | ComponentRegistrar::register(ComponentRegistrar::MODULE, 'CheckoutCom_Magento2', __DIR__); 23 | } 24 | -------------------------------------------------------------------------------- /view/adminhtml/layout/adminhtml_system_config_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /view/adminhtml/layout/cko_logs_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | Log File Reader 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_create_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /view/adminhtml/requirejs-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | var config = { 17 | map: { 18 | '*': { 19 | framesjs: 'https://cdn.checkout.com/js/framesv2.min.js' 20 | } 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /view/adminhtml/templates/logs/view.phtml: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | use CheckoutCom\Magento2\Block\Adminhtml\Logs\View; 19 | 20 | /** @var View $block */ 21 | 22 | ?> 23 |
24 |
25 |
26 | getFileName(); ?> 27 |

getSizeMessage(); ?>

28 |
29 |
30 | 31 |
32 |
33 |
34 | -------------------------------------------------------------------------------- /view/adminhtml/templates/system/config/logfile_admin.phtml: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | 18 | use CheckoutCom\Magento2\Block\Adminhtml\System\Config\Field\LogFiles; 19 | 20 | /** @var LogFiles $block */ 21 | 22 | ?> 23 | getElementHtml(); ?> 24 | getButtonHtml($block->getButtonUrl()); ?> 25 | -------------------------------------------------------------------------------- /view/adminhtml/templates/system/config/simplepath_admin.phtml: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | ?> 18 | 19 |
20 |
21 |
22 |

23 | escapeHtml(__('Get your credentials here.')) ?> 24 |

25 |
26 | -------------------------------------------------------------------------------- /view/adminhtml/web/css/moto.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | #payment_form_checkoutcom_moto{width:auto}#cko-form-holder{margin-bottom:20px}#vault-container{margin-bottom:20px}#vault-container div:last-child{border-bottom:none!important}#vault-container .card-on,#vault-container .card-selected{background-color:#f1f1f1}.cko-vault-card{border-bottom:1px solid #ccc;padding:15px;cursor:pointer}.cko-vault-card input[type=radio]{position:absolute!important;opacity:0!important;width:0!important;height:0!important}.cko-vault-card input[type=radio]+img{cursor:pointer!important}.cko-vault-card label img{width:45px;height:30px;margin-right:10px}.cko-vault-card .vault-details{float:left!important}.cko-vault-card .vault-cvv{float:right!important}.cko-vault-card .vault-cvv input{width:55px!important}.clr{clear:both;visibility:hidden;height:0;width:0}*,::after,::before{box-sizing:border-box}html{padding:1rem;background-color:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}#payment-form{width:31.5rem;margin:0 auto}iframe{width:100%}.one-liner{display:flex;flex-direction:column}.card-frame{border:solid 1px #13395e;border-radius:3px;width:100%;margin-bottom:8px;height:40px;box-shadow:0 1px 3px 0 rgba(19,57,94,.2)}.card-frame.frame--rendered{opacity:1}.card-frame.frame--rendered.frame--focus{border:solid 1px #13395e;box-shadow:0 2px 5px 0 rgba(19,57,94,.15)}.card-frame.frame--rendered.frame--invalid{border:solid 1px #d96830;box-shadow:0 2px 5px 0 rgba(217,104,48,.15)}.success-payment-message{color:#13395e;line-height:1.4}.token{color:#b35e14;font-size:.9rem;font-family:monospace}@media screen and (min-width:31rem){.one-liner{flex-direction:row}.card-frame{width:500px;margin-bottom:0}} 17 | -------------------------------------------------------------------------------- /view/base/templates/ui/messages.phtml: -------------------------------------------------------------------------------- 1 | 13 | * @copyright 2010-present Checkout.com 14 | * @license https://opensource.org/licenses/mit-license.html MIT License 15 | * @link https://docs.checkout.com/ 16 | */ 17 | ?> 18 | 19 |
20 | escapeHtml($block->getData('output')) ?>
21 | getData('link')): ?>
22 | 
escapeUrl($block->getData('link')) ?> 23 | 24 |
25 | -------------------------------------------------------------------------------- /view/base/web/images/cc/dn.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 44 | 46 | 50 | 51 | -------------------------------------------------------------------------------- /view/base/web/images/cc/jcb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 44 | 46 | 47 | 48 | 50 | 52 | 54 | 55 | 57 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /view/base/web/images/cc/mc.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 44 | 46 | 47 | 48 | 50 | 51 | -------------------------------------------------------------------------------- /view/base/web/images/cc/vi.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 44 | 46 | 51 | 52 | -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/american express.svg: -------------------------------------------------------------------------------- 1 | icon-amex-small -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/card-error.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/card.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/cvv-error.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/cvv.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/dinersclub.svg: -------------------------------------------------------------------------------- 1 | icon-diners-small -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/discover.svg: -------------------------------------------------------------------------------- 1 | icon-discover-small -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/error.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/exp-date-error.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/exp-date.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/jcb.svg: -------------------------------------------------------------------------------- 1 | icon-jcb-small -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/loading.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 04F9496F-DDA0-44F5-B1BF-8E1369F8B567 5 | Created with sketchtool. 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/maestro.svg: -------------------------------------------------------------------------------- 1 | icon-maestro-small -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/mastercard.svg: -------------------------------------------------------------------------------- 1 | icon-mastercard-small -------------------------------------------------------------------------------- /view/base/web/images/frames/multi/visa.svg: -------------------------------------------------------------------------------- 1 | icon-visa -------------------------------------------------------------------------------- /view/base/web/images/frames/single/card.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /view/base/web/images/frames/single/maestro.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 44 | 46 | 47 | 48 | 50 | 51 | -------------------------------------------------------------------------------- /view/frontend/layout/vault_cards_listaction.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /view/frontend/requirejs-config.js: -------------------------------------------------------------------------------- 1 | var config = { 2 | map: { 3 | '*': { 4 | framesjs: 'https://cdn.checkout.com/js/framesv2.min.js', 5 | Klarna: 'https://x.klarnacdn.net/kp/lib/v1/api.js', 6 | googlepayjs: 'https://pay.google.com/gp/p/js/pay.js' 7 | } 8 | }, config: { 9 | mixins: { 10 | 'Magento_Checkout/js/model/checkout-data-resolver': { 11 | 'CheckoutCom_Magento2/js/model/checkout-data-resolver': true 12 | }, 13 | 'Magento_Tax/js/view/checkout/summary/grand-total': { 14 | 'CheckoutCom_Magento2/js/model/grand-total-hide': true 15 | } 16 | } 17 | } 18 | }; -------------------------------------------------------------------------------- /view/frontend/templates/cart/applepay.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 | 28 |
29 | 30 |
31 | -------------------------------------------------------------------------------- /view/frontend/templates/cart/minicart-config.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | 18 | use CheckoutCom\Magento2\Block\Cart\CheckoutConfig; 19 | use Magento\Framework\View\Helper\SecureHtmlRenderer; 20 | 21 | /** @var CheckoutConfig $block */ 22 | /** @var SecureHtmlRenderer $secureRenderer */ 23 | if ($block->isPaypalOrApplePayEnabled()): 24 | ?> 25 | getProductCount() > 0 ? $block->getSerializedCheckoutConfig() : $block->getSerializedCheckoutComConfig(); 26 | $scriptString = << 24 |
26 | 27 |
28 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/alipay.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | ?> 18 | 19 |
20 |
21 | 22 | escapeHtml($block->getData('title')) ?> 23 |
24 |
25 |
26 |
27 | 28 |
29 |
30 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/bancontact.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 |
19 |
20 | 21 | escapeHtml($block->getData('title'))?> 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/boleto.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 |
19 |
20 | 21 | escapeHtml($block->getData('title'))?> 22 |
23 |
24 |
25 |
26 | 27 |
28 | 30 | 31 |
32 |
33 | 35 | 36 |
37 |
38 | 40 | 41 |
42 |
43 |
44 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/eps.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 |
19 |
20 | 21 | escapeHtml($block->getData('title'))?> 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/fawry.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 |
19 |
20 | 21 | escapeHtml($block->getData('title'))?> 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/giropay.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 |
19 |
20 | 21 | escapeHtml($block->getData('title'))?> 22 |
23 |
24 |
25 |
26 | 27 | getData('service_previous_mode')): ?> 28 |
29 | 31 | 32 |
33 | 34 |
35 |
36 |
37 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/knet.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 |
19 |
20 | 21 | escapeHtml($block->getData('title'))?> 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/paypal.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 |
19 |
20 | 21 | escapeHtml($block->getData('title')) ?> 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/poli.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 |
19 |
20 | 21 | escapeHtml($block->getData('title'))?> 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/apm/sofort.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | ?> 17 | 18 |
19 |
20 | 21 | escapeHtml($block->getData('title'))?> 22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/paypal/review.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | /** 18 | * @var Escaper $escaper 19 | */ 20 | 21 | use Magento\Framework\Escaper; 22 | 23 | ?> 24 | 25 |
26 |
27 |
28 |
29 | getChildHtml('checkoutcom_paypal_review_shipping_method') ?> 30 | getChildHtml('checkoutcom_paypal_review_payment_method') ?> 31 |
32 |
33 | getChildHtml('checkoutcom_paypal_review_shipping_address') ?> 34 |
35 |
36 |
37 | 38 |
39 | getChildHtml('checkoutcom_paypal.additional.actions') ?> 40 |
41 | 42 |
43 |
44 | escapeHtml(__('Items in Your Shopping Cart')) ?> 45 | 46 | escapeHtml(__('Edit Shopping Cart')) ?> 47 | 48 |
49 | 50 | getChildHtml('details') ?> 51 | getChildHtml('checkoutcom_paypal_review_place_order') ?> 52 |
53 |
54 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/paypal/review/details.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | use Magento\Checkout\Block\Cart\Totals; 18 | use Magento\Framework\Escaper; 19 | 20 | /** 21 | * @var Totals $block 22 | * @var Escaper $escaper 23 | */ 24 | ?> 25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | getItems() as $item) : ?> 37 | getItemHtml($item) ?> 39 | 40 | 41 | getChildHtml('totals') ?> 43 | 44 |
escapeHtml(__('Items in Your Shopping Cart')) ?>
escapeHtml(__('Item')) ?>escapeHtml(__('Price')) ?>escapeHtml(__('Qty')) ?>escapeHtml(__('Subtotal')) ?>
45 |
46 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/paypal/review/payment-method.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | /** 18 | * @var PaymentMethod $block 19 | * @var Escaper $escaper 20 | */ 21 | 22 | use CheckoutCom\Magento2\Block\Paypal\Review\PaymentMethod; 23 | use Magento\Framework\Escaper; 24 | 25 | ?> 26 |
27 | escapeHtml(__('Payment Method')) ?> 28 |
29 | escapeHtml($block->getPaymentMethod()); ?>
30 | escapeHtml($block->getEmail()); ?> 31 |
32 |
33 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/paypal/review/place-order.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | /** 18 | * @var PlaceOrderButton $block 19 | * @var Escaper $escaper 20 | */ 21 | 22 | use CheckoutCom\Magento2\Block\Paypal\Review\PlaceOrderButton; 23 | use Magento\Framework\Escaper; 24 | ?> 25 | 26 |
27 |
28 |
29 |
30 | getChildHtml('agreements') ?> 31 |
32 |
33 | 38 |
39 | 41 | escapeHtml(__('Submitting order information...')) ?> 42 | 43 | renderStyleAsTag("display: none;", 'span#review-please-wait') ?> 45 |
46 |
47 | 59 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/paypal/review/shipping-method.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | /** 18 | * @var ShippingMethod $block 19 | * @var Escaper $escaper 20 | */ 21 | 22 | use CheckoutCom\Magento2\Block\Paypal\Review\ShippingMethod; 23 | use Magento\Framework\Escaper; 24 | 25 | $rates = $block->getRates(); 26 | ?> 27 |
28 | escapeHtml(__('Shipping Method')) ?> 29 |
30 | 31 | 32 | 33 | isCurrentShippingRate($carrierMethod); ?> 34 | 35 | 38 | 39 | 40 | 41 | escapeHtml($carrierMethod->getCarrierTitle()) ?> - 42 | escapeHtml($carrierMethod->getMethodTitle()) ?> - 43 | getFormatedPrice($carrierMethod->getPrice()) ?> 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 |

54 | escapeHtml( 55 | __( 56 | 'Sorry, no quotes are available for this order right now.' 57 | ) 58 | ); ?> 59 |

60 | 61 |
62 |
63 | -------------------------------------------------------------------------------- /view/frontend/templates/payment/vault/card.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | use CheckoutCom\Magento2\Block\Account\AddCard; 18 | 19 | /** @var AddCard $block */ 20 | 21 | $card = $block->getData('card'); 22 | $details = json_decode($card->getTokenDetails() ?: '{}', true); 23 | 24 | ?> 25 |
26 |
27 | 33 | 34 | escapeHtml($block->vaultHandler->renderTokenData($card))?> 35 | 36 |
37 | config->getValue('require_cvv', 'checkoutcom_vault')): ?> 39 |
40 | 41 |
42 | 43 |
44 |
45 | -------------------------------------------------------------------------------- /view/frontend/templates/script/paypal-script.phtml: -------------------------------------------------------------------------------- 1 | 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | use CheckoutCom\Magento2\Block\Paypal\Script; 18 | use Magento\Framework\Escaper; 19 | /** @var Escaper $escaper */ 20 | /** @var Script $block */ 21 | $clientId = $block->getClientId(); 22 | $partnerId = $block->getPartnerAttributionId(); 23 | $paypalMerchantId = $block->getPaypalMerchantId(); 24 | if ($clientId && $partnerId && $paypalMerchantId): 25 | ?> 26 | 33 | 34 | -------------------------------------------------------------------------------- /view/frontend/web/css/add-card.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | #ckoSaveCard{margin-top:10px}#cko-form-holder .frames-field{display:flex;align-items:center;margin-bottom:10px}#cko-form-holder .tooltip{position:relative}#cko-form-holder .tooltip button{border-radius:50%;height:20px;width:20px;padding:0;margin-left:5px}#cko-form-holder .tooltip-content{background:#fff;max-width:360px;min-width:210px;padding:12px 16px;position:absolute;z-index:10;text-align:left;color:#333;line-height:1.4;border:1px solid #bbb;left:50%;top:calc(100% + 15px);transform:translateX(-50%)}#cko-form-holder .tooltip-content::after,#cko-form-holder .tooltip-content::before{content:'';width:0;height:0;border-style:solid;position:absolute;left:50%;transform:translateX(-50%)}#cko-form-holder .tooltip-content::before{border-width:0 5px 10px;border-color:transparent transparent #bbb;top:-10px}#cko-form-holder .tooltip-content::after{border-width:0 4px 8px;border-color:transparent transparent #fff;top:-8px}*,::after,::before{box-sizing:border-box}html{padding:1rem;background-color:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}#payment-form{width:31.5rem;margin:0 auto}iframe{width:100%}.one-liner{display:flex;flex-direction:column}.card-frame{border:1px solid #13395e;border-radius:3px;width:100%;margin-bottom:8px;height:40px;box-shadow:0 1px 3px 0 rgba(19,57,94,.2)}.card-frame.frame--rendered{opacity:1}.card-frame.frame--rendered.frame--focus{border:1px solid #13395e;box-shadow:0 2px 5px 0 rgba(19,57,94,.15)}.card-frame.frame--rendered.frame--invalid{border:1px solid #d96830;box-shadow:0 2px 5px 0 rgba(217,104,48,.15)}.success-payment-message{color:#13395e;line-height:1.4}.token{color:#b35e14;font-size:.9rem;font-family:monospace}@media screen and (min-width:31rem){.one-liner{flex-direction:row}.card-frame{width:500px;margin-bottom:0}} 17 | -------------------------------------------------------------------------------- /view/frontend/web/css/apple-pay/apple-pay.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | @supports (-webkit-appearance: -apple-pay-button) { 17 | .apple-pay-button { 18 | display: inline-block; 19 | -webkit-appearance: -apple-pay-button; 20 | } 21 | .apple-pay-button-black { 22 | -apple-pay-button-style: black; 23 | } 24 | .apple-pay-button-white { 25 | -apple-pay-button-style: white; 26 | } 27 | .apple-pay-button-white-with-line { 28 | -apple-pay-button-style: white-outline; 29 | } 30 | } 31 | 32 | @supports not (-webkit-appearance: -apple-pay-button) { 33 | .apple-pay-button { 34 | display: inline-block; 35 | background-size: 100% 60%; 36 | background-repeat: no-repeat; 37 | background-position: 50% 50%; 38 | border-radius: 5px; 39 | padding: 0px; 40 | box-sizing: border-box; 41 | min-width: 200px; 42 | min-height: 32px; 43 | max-height: 64px; 44 | } 45 | .apple-pay-button-black { 46 | background-image: -webkit-named-image(apple-pay-logo-white); 47 | background-color: black; 48 | } 49 | .apple-pay-button-white { 50 | background-image: -webkit-named-image(apple-pay-logo-black); 51 | background-color: white; 52 | } 53 | .apple-pay-button-white-with-line { 54 | background-image: -webkit-named-image(apple-pay-logo-black); 55 | background-color: white; 56 | border: .5px solid black; 57 | } 58 | } 59 | 60 | /* make ApplePay button larger*/ 61 | 62 | .ap-checkout { 63 | width: 138px !important; 64 | height: 52px !important; 65 | } 66 | 67 | .ap-cart { 68 | width: 100% !important; 69 | height: 52px !important; 70 | } 71 | 72 | /* For mobile */ 73 | 74 | @media only screen and (max-width: 600px) { 75 | #ckoApplePayButton { 76 | width: 100% !important; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /view/frontend/web/css/apple-pay/apple-pay.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | @supports (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:inline-block;-webkit-appearance:-apple-pay-button}.apple-pay-button-black{-apple-pay-button-style:#000}.apple-pay-button-white{-apple-pay-button-style:#fff}.apple-pay-button-white-with-line{-apple-pay-button-style:white-outline}}@supports not (-webkit-appearance:-apple-pay-button){.apple-pay-button{display:inline-block;background-size:100% 60%;background-repeat:no-repeat;background-position:50% 50%;border-radius:5px;padding:0;box-sizing:border-box;min-width:200px;min-height:32px;max-height:64px}.apple-pay-button-black{background-image:-webkit-named-image(apple-pay-logo-white);background-color:#000}.apple-pay-button-white{background-image:-webkit-named-image(apple-pay-logo-black);background-color:#fff}.apple-pay-button-white-with-line{background-image:-webkit-named-image(apple-pay-logo-black);background-color:#fff;border:.5px solid #000}}#ckoApplePayButton{width:138px!important;height:52px!important}@media only screen and (max-width:600px){#ckoApplePayButton{width:100%!important}} 17 | -------------------------------------------------------------------------------- /view/frontend/web/css/cards-list.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | #closebtn { 17 | margin-left: 15px; 18 | color: white; 19 | font-weight: bold; 20 | float: right; 21 | font-size: 22px; 22 | line-height: 20px; 23 | cursor: pointer; 24 | transition: 0.3s; 25 | } 26 | 27 | #payment_form_checkout_com { 28 | padding-top: 20px; 29 | } 30 | 31 | #card-number, 32 | #card-holder { 33 | width: 220px; 34 | } 35 | 36 | #expiry-month { 37 | width: 140px; 38 | } 39 | 40 | #expiry-year { 41 | width: 80px; 42 | } 43 | 44 | .ccv { 45 | width: 100px; 46 | } 47 | 48 | #info-icon, 49 | #info-icon svg { 50 | width: 30px; 51 | height: 30px; 52 | } 53 | 54 | #info-icon, 55 | #info-text { 56 | float: left; 57 | } 58 | 59 | #info-text { 60 | margin-top: 10px; 61 | text-align: left; 62 | margin-bottom: 10px; 63 | width: 90%; 64 | } 65 | 66 | td.card-type img { 67 | vertical-align: middle; 68 | display: inline-block !important; 69 | } 70 | 71 | td.card-type span { 72 | display: inline-block; 73 | margin-left: 5px; 74 | } 75 | -------------------------------------------------------------------------------- /view/frontend/web/css/cards-list.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | #closebtn{margin-left:15px;color:#fff;font-weight:700;float:right;font-size:22px;line-height:20px;cursor:pointer;transition:.3s}#payment_form_checkout_com{padding-top:20px}#card-holder,#card-number{width:220px}#expiry-month{width:140px}#expiry-year{width:80px}.ccv{width:100px}#info-icon,#info-icon svg{width:30px;height:30px}#info-icon,#info-text{float:left}#info-text{margin-top:10px;text-align:left;margin-bottom:10px;width:90%}td.card-type img{vertical-align:middle;display:inline-block!important}td.card-type span{display:inline-block;margin-left:5px} 17 | -------------------------------------------------------------------------------- /view/frontend/web/css/frames/single.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | #checkoutcom_card_payment_frm *, 17 | #checkoutcom_card_payment_frm *::before, 18 | #checkoutcom_card_payment_frm *::after { 19 | box-sizing: border-box; 20 | } 21 | 22 | #checkoutcom_card_payment_frm html { 23 | padding: 1rem; 24 | background-color: #FFF; 25 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; 26 | } 27 | 28 | #checkoutcom_card_payment_frm iframe { 29 | width: 100%; 30 | } 31 | 32 | #checkoutcom_card_payment_frm .one-liner { 33 | display: flex; 34 | flex-direction: column; 35 | } 36 | 37 | #checkoutcom_card_payment_frm .card-frame { 38 | border: solid 1px #13395E; 39 | border-radius: 3px; 40 | width: 100%; 41 | margin-bottom: 8px; 42 | height: 40px; 43 | box-shadow: 0 1px 3px 0 rgba(19,57,94,0.2); 44 | } 45 | 46 | #checkoutcom_card_payment_frm .card-frame.frame--rendered { 47 | opacity: 1; /* Prevents iFrame rendering issue */ 48 | 49 | /* Reminder: consider removal of 'rendered' */ 50 | /* event passing to Merchant page */ 51 | } 52 | 53 | #checkoutcom_card_payment_frm .card-frame.frame--rendered.frame--focus { 54 | border: solid 1px #13395E; 55 | box-shadow: 0 2px 5px 0 rgba(19,57,94,0.15); 56 | } 57 | 58 | #checkoutcom_card_payment_frm .card-frame.frame--rendered.frame--invalid { 59 | border: solid 1px #D96830; 60 | box-shadow: 0 2px 5px 0 rgba(217,104,48,0.15); 61 | } 62 | 63 | #checkoutcom_card_payment_frm .error-message { 64 | display: block; 65 | color: #C9501C; 66 | font-size: 1.2rem; 67 | margin: 8px 0 0 1px; 68 | font-weight: 300; 69 | } 70 | 71 | #checkoutcom_card_payment_frm .success-payment-message { 72 | color: #13395E; 73 | line-height: 1.4; 74 | } 75 | 76 | #checkoutcom_card_payment_frm .token { 77 | color: #b35e14; 78 | font-size: .9rem; 79 | font-family: monospace; 80 | } 81 | 82 | @media screen and (min-width: 31rem) { 83 | #checkoutcom_card_payment_frm .one-liner { 84 | flex-direction: row; 85 | } 86 | 87 | #checkoutcom_card_payment_frm .card-frame { 88 | margin-bottom: 0; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /view/frontend/web/css/frames/single.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | #checkoutcom_card_payment_frm *,#checkoutcom_card_payment_frm ::after,#checkoutcom_card_payment_frm ::before{box-sizing:border-box}#checkoutcom_card_payment_frm html{padding:1rem;background-color:#fff;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}#checkoutcom_card_payment_frm iframe{width:100%}#checkoutcom_card_payment_frm .one-liner{display:flex;flex-direction:column}#checkoutcom_card_payment_frm .card-frame{border:1px solid #13395e;border-radius:3px;width:100%;margin-bottom:8px;height:40px;box-shadow:0 1px 3px 0 rgba(19,57,94,.2)}#checkoutcom_card_payment_frm .card-frame.frame--rendered{opacity:1}#checkoutcom_card_payment_frm .card-frame.frame--rendered.frame--focus{border:1px solid #13395e;box-shadow:0 2px 5px 0 rgba(19,57,94,.15)}#checkoutcom_card_payment_frm .card-frame.frame--rendered.frame--invalid{border:1px solid #d96830;box-shadow:0 2px 5px 0 rgba(217,104,48,.15)}#checkoutcom_card_payment_frm .error-message{display:block;color:#c9501c;font-size:1.2rem;margin:8px 0 0 1px;font-weight:300}#checkoutcom_card_payment_frm .success-payment-message{color:#13395e;line-height:1.4}#checkoutcom_card_payment_frm .token{color:#b35e14;font-size:.9rem;font-family:monospace}@media screen and (min-width:31rem){#checkoutcom_card_payment_frm .one-liner{flex-direction:row}#checkoutcom_card_payment_frm .card-frame{margin-bottom:0}} 17 | -------------------------------------------------------------------------------- /view/frontend/web/css/main.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | @import url(https://cdn.checkout.com/v2/css/cko-fonts-jsicons.css?v=1.1.9);.frames-container,.frames-container .tooltip{position:relative}.frames-container{margin-bottom:15px;max-width:650px;z-index:1}.frames-container .frames-field{display:flex;align-items:center;margin-bottom:10px}.frames-container .tooltip button{border-radius:50%;height:20px;width:20px;padding:0;margin-left:5px}.frames-container .tooltip-content{background:#fff;max-width:360px;min-width:210px;padding:12px 16px;position:absolute;z-index:10;text-align:left;color:#333;line-height:1.4;border:1px solid #bbb;left:50%;top:calc(100% + 15px);transform:translateX(-50%)}.frames-container .tooltip-content::after,.frames-container .tooltip-content::before{content:'';width:0;height:0;border-style:solid;position:absolute;left:50%;transform:translateX(-50%)}.frames-container .tooltip-content::before{border-width:0 5px 10px;border-color:transparent transparent #bbb;top:-10px}.frames-container .tooltip-content::after{border-width:0 4px 8px;border-color:transparent transparent #fff;top:-8px}.save-card-option{margin-bottom:10px}.clr{clear:both;visibility:hidden;height:0;width:0}.checkout-agreement label{background-image:url(../images/icon-link.png);background-repeat:no-repeat;background-position:top right;padding-right:20px;background-size:13px 13px}.message.notice{overflow-wrap:break-word} 17 | -------------------------------------------------------------------------------- /view/frontend/web/css/paypal/paypal-express.css: -------------------------------------------------------------------------------- 1 | #minicart-paypal-button-container { 2 | margin-top: 10px; 3 | } 4 | -------------------------------------------------------------------------------- /view/frontend/web/css/paypal/paypal-review.css: -------------------------------------------------------------------------------- 1 | .checkoutcom-paypal-review .box .box-title { 2 | display: block; 3 | margin: 0 0 20px; 4 | padding: 0 0 10px; 5 | width: 100%; 6 | box-sizing: border-box; 7 | } 8 | 9 | .checkoutcom-paypal-review .box .box-title span { 10 | font-weight: 300; 11 | line-height: 1.2; 12 | font-size: 18px; 13 | } 14 | 15 | .checkoutcom-paypal-review .box-order-shipping-method .item { 16 | display: block; 17 | } 18 | 19 | @media screen and (min-width: 769px) { 20 | .checkoutcom-paypal-review .boxes { 21 | display: grid; 22 | gap: 4%; 23 | grid-template-columns: repeat(2, minmax(0, 1fr)); 24 | } 25 | 26 | .checkoutcom-paypal-review .box .box-title { 27 | border-bottom: 1px solid #C5C5C5; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /view/frontend/web/css/paypal/paypal.css: -------------------------------------------------------------------------------- 1 | .checkoutcom-paypal-review .box .box-title { 2 | display: block; 3 | margin: 0 0 20px; 4 | padding: 0 0 10px; 5 | width: 100%; 6 | box-sizing: border-box; 7 | } 8 | 9 | .checkoutcom-paypal-review .box .box-title span { 10 | font-weight: 300; 11 | line-height: 1.2; 12 | font-size: 18px; 13 | } 14 | 15 | .checkoutcom-paypal-review .box-order-shipping-method .item { 16 | display: block; 17 | } 18 | 19 | @media screen and (min-width: 769px) { 20 | .checkoutcom-paypal-review .boxes { 21 | display: grid; 22 | gap: 4%; 23 | grid-template-columns: repeat(2, minmax(0, 1fr)); 24 | } 25 | 26 | .checkoutcom-paypal-review .box .box-title { 27 | border-bottom: 1px solid #C5C5C5; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /view/frontend/web/css/vault/vault.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | /** 17 | * Vault payment 18 | */ 19 | #vault-container { 20 | margin-bottom: 20px; 21 | } 22 | 23 | #vault-container div:last-child { 24 | border-bottom: none !important; 25 | } 26 | 27 | #vault-container .card-on, 28 | #vault-container .card-selected { 29 | background-color: #f1f1f1; 30 | } 31 | 32 | .cko-vault-card { 33 | border-bottom: 1px solid #ccc; 34 | padding: 15px; 35 | cursor: pointer; 36 | } 37 | 38 | .cko-vault-card input[type=radio] { 39 | position: absolute; 40 | opacity: 0; 41 | width: 0; 42 | height: 0; 43 | } 44 | 45 | .cko-vault-card input[type=radio] + img { 46 | cursor: pointer; 47 | } 48 | 49 | .cko-vault-card label img { 50 | width: 45px; 51 | height: 30px; 52 | margin-right: 10px; 53 | } 54 | 55 | .cko-vault-card .vault-details { 56 | float: left; 57 | } 58 | 59 | .cko-vault-card .vault-cvv { 60 | float: right; 61 | width: 55px; 62 | } 63 | -------------------------------------------------------------------------------- /view/frontend/web/css/vault/vault.min.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | #vault-container{margin-bottom:20px}#vault-container div:last-child{border-bottom:none!important}#vault-container .card-on,#vault-container .card-selected{background-color:#f1f1f1}.cko-vault-card{border-bottom:1px solid #ccc;padding:15px;cursor:pointer}.cko-vault-card input[type=radio]{position:absolute;opacity:0;width:0;height:0}.cko-vault-card input[type=radio]+img{cursor:pointer}.cko-vault-card label img{width:45px;height:30px;margin-right:10px}.cko-vault-card .vault-details{float:left}.cko-vault-card .vault-cvv{float:right;width:55px} 17 | -------------------------------------------------------------------------------- /view/frontend/web/images/icon-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/checkout/checkout-magento2-plugin/4bcba97e9156c3d7f003ecd7e834b03b160100e5/view/frontend/web/images/icon-link.png -------------------------------------------------------------------------------- /view/frontend/web/js/frames/single.min.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Checkout.com 4 | * Authorized and regulated as an electronic money institution 5 | * by the UK Financial Conduct Authority (FCA) under number 900816. 6 | * 7 | * PHP version 7 8 | * 9 | * @category Magento2 10 | * @package Checkout.com 11 | * @author Platforms Development Team 12 | * @copyright 2010-present Checkout.com 13 | * @license https://opensource.org/licenses/mit-license.html MIT License 14 | * @link https://docs.checkout.com/ 15 | */ 16 | 17 | define(["jquery","mage/translate"],function(e,r){return{load:function(e,r){return this.F=e,this.formId=r,this.F.addEventHandler(this.F.Events.FRAME_VALIDATION_CHANGED,this.onValidationChanged.bind(this)),this.F},getLogos:function(){var e={};return e["card-number"]={src:"card",alt:r("Card number logo")},e["expiry-date"]={src:"exp-date",alt:r("Expiry date logo")},e.cvv={src:"cvv",alt:r("CVV logo")},e},getErrors:function(){return{"card-number":r("Please enter a valid card number"),"expiry-date":r("Please enter a valid expiry date"),cvv:r("Please enter a valid CVV code")}},getErrorMessage:function(e){return e.isValid||e.isEmpty?"":this.getErrors()[e.element]},onValidationChanged:function(e){var r=e.element;e.paymentMethod;var t="#"+this.formId+" .icon-container.payment-method";document.querySelector(t),e.isValid||e.isEmpty?this.clearErrorMessage(r):this.setErrorMessage(r)},clearErrorMessage:function(e){var r="#"+this.formId+" .error-message__"+e;document.querySelector(r).textContent=""},setErrorMessage:function(e){var r="#"+this.formId+" .error-message__"+e;document.querySelector(r).textContent=this.getErrors()[e]}}}); 18 | -------------------------------------------------------------------------------- /view/frontend/web/js/model/checkout-utilities.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | define([ 17 | 'jquery', 18 | 'CheckoutCom_Magento2/js/view/payment/utilities', 19 | 'Magento_Checkout/js/model/step-navigator', 20 | 'Magento_Checkout/js/action/set-payment-information' 21 | ], function ($, Utilities, StepNavigator, setPaymentInformationAction) { 22 | 'use strict'; 23 | 24 | const PAYMENT_STEP_CODE = 'payment'; 25 | 26 | return { 27 | 28 | /** 29 | * Workaround to refresh payment method information when guest customer 30 | * go back to shipping step & change his email address 31 | * 32 | * @param {UiClass} Component 33 | * @public 34 | */ 35 | initSubscribers: function (Component) { 36 | const code = Component.getCode(); 37 | 38 | StepNavigator.steps.subscribe((steps) => { 39 | if (this.getCurrentCheckoutStep(steps) === PAYMENT_STEP_CODE && 40 | Utilities.methodIsSelected(code)) { 41 | setPaymentInformationAction(Component.messageContainer, { 42 | method: code 43 | }); 44 | } 45 | }); 46 | }, 47 | 48 | /** 49 | * Return current checkout step code 50 | * 51 | * @param {Array} steps 52 | * @return string 53 | * @public 54 | */ 55 | getCurrentCheckoutStep: function (steps) { 56 | return steps[StepNavigator.getActiveItemIndex()]['code']; 57 | } 58 | }; 59 | }); 60 | -------------------------------------------------------------------------------- /view/frontend/web/js/model/grand-total-hide.js: -------------------------------------------------------------------------------- 1 | define(function () { 2 | 'use strict'; 3 | 4 | var mixin = { 5 | isBaseGrandTotalDisplayNeeded: function () { 6 | let checkoutConfig = window.checkoutConfig.payment["checkoutcom_magento2"]; 7 | return !parseInt(checkoutConfig["checkoutcom_configuration"]['active']); 8 | } 9 | }; 10 | 11 | return function (target) { 12 | return target.extend(mixin); 13 | }; 14 | }); 15 | -------------------------------------------------------------------------------- /view/frontend/web/js/view/minicart/applepaybutton.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Agence Dn'D 3 | * @copyright 2004-present Agence Dn'D 4 | * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 5 | * @link https://www.dnd.fr/ 6 | */ 7 | 8 | define([ 9 | 'ko', 10 | 'uiComponent', 11 | 'Magento_Customer/js/customer-data', 12 | ], function(ko, Component, customerData) { 13 | 'use strict'; 14 | 15 | return Component.extend({ 16 | isVisible: ko.observable(false), 17 | 18 | initialize: function() { 19 | this._super(); 20 | let cartData = customerData.get('cart'); 21 | this.isVisible(cartData()['summary_count'] > 0 22 | && cartData()['checkoutcom_apple_pay'] 23 | && cartData()['checkoutcom_apple_pay']['active'] === '1', 24 | ); 25 | 26 | cartData.subscribe((updatedCart) => { 27 | if (typeof window.checkoutConfig !== 'undefined' 28 | && typeof window.checkoutConfig.quoteId === 'undefined') { 29 | window.checkoutConfig = {...updatedCart['checkoutConfigProvider']}; 30 | } 31 | 32 | this.isVisible(updatedCart['summary_count'] > 0 33 | && updatedCart['checkoutcom_apple_pay'] 34 | && updatedCart['checkoutcom_apple_pay']['active'] === '1'); 35 | }); 36 | }, 37 | }); 38 | }); 39 | -------------------------------------------------------------------------------- /view/frontend/web/js/view/payment/config-loader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | define( 17 | [ 18 | 'jquery' 19 | ], 20 | function ($) { 21 | 'use strict'; 22 | const MODULE_ID = 'checkoutcom_magento2'; 23 | return window.checkoutConfig.payment[MODULE_ID]; 24 | } 25 | ); 26 | -------------------------------------------------------------------------------- /view/frontend/web/js/view/payment/method-renderer.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | define( 17 | [ 18 | 'uiComponent', 19 | 'Magento_Checkout/js/model/payment/renderer-list', 20 | 'CheckoutCom_Magento2/js/view/payment/config-loader' 21 | ], 22 | function ( 23 | Component, 24 | rendererList, 25 | Config 26 | ) { 27 | // Render the active payment methods 28 | for (var method in Config) { 29 | if (method === 'checkoutcom_apple_pay' && !window.ApplePaySession) { 30 | continue; // Skip render if Apple Pay is run in wrong browser 31 | } else { 32 | rendererList.push( 33 | { 34 | type: method, 35 | component: 'CheckoutCom_Magento2/js/view/payment/method-renderer/' + method 36 | } 37 | ); 38 | } 39 | } 40 | 41 | return Component.extend({}); 42 | } 43 | ); 44 | -------------------------------------------------------------------------------- /view/frontend/web/js/view/payment/method-renderer/checkoutcom_paypal_review.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | define([ 17 | 'jquery', 18 | 'CheckoutCom_Magento2/js/view/payment/utilities', 19 | ], function ($, Utilities) { 20 | 'use strict'; 21 | 22 | $.widget('checkoutCom.paypalReviewPlaceorder', { 23 | 24 | /** 25 | * @return {void} 26 | */ 27 | _create: function () { 28 | this.editAddressForm = this.element.find('.form-address-edit'); 29 | this.submitButton = this.element.find(this.options.buttonSelector); 30 | 31 | Utilities.loadCss('paypal-review', 'paypal'); 32 | this._eventListeners(); 33 | 34 | if (!this.editAddressForm.validation('isValid')) { 35 | this.submitButton.attr('disabled', 'true'); 36 | } 37 | }, 38 | 39 | /** 40 | * @return {void} 41 | */ 42 | _eventListeners () { 43 | this.submitButton.on('click', (event) => { 44 | this.placeOrder(event); 45 | }); 46 | }, 47 | 48 | /** 49 | * @param {jQuery.Event} event 50 | * @return {void} 51 | */ 52 | placeOrder: function (event) { 53 | $('body').trigger('processStart'); 54 | 55 | if (this.options.chkPayPalContextId) { 56 | const submitButton = $(event.currentTarget); 57 | const data = { 58 | methodId: this.options.methodId, 59 | contextPaymentId: this.options.chkPayPalContextId, 60 | }; 61 | 62 | // Place the order 63 | Utilities.placeOrder( 64 | data, 65 | this.options.methodId, 66 | false 67 | ) 68 | .then(() => { 69 | $('body').trigger('processStop'); 70 | }); 71 | 72 | Utilities.cleanCustomerShippingAddress(); 73 | } else { 74 | $('body').trigger('processStop'); 75 | } 76 | }, 77 | }); 78 | 79 | return $.checkoutCom.paypalReviewPlaceorder; 80 | }); 81 | -------------------------------------------------------------------------------- /view/frontend/web/js/view/payment/paypal-utilities.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Checkout.com 3 | * Authorized and regulated as an electronic money institution 4 | * by the UK Financial Conduct Authority (FCA) under number 900816. 5 | * 6 | * PHP version 7 7 | * 8 | * @category Magento2 9 | * @package Checkout.com 10 | * @author Platforms Development Team 11 | * @copyright 2010-present Checkout.com 12 | * @license https://opensource.org/licenses/mit-license.html MIT License 13 | * @link https://docs.checkout.com/ 14 | */ 15 | 16 | define([ 17 | 'jquery', 18 | "CheckoutCom_Magento2/js/view/payment/utilities" 19 | ], function($, Utilities) { 20 | 'use strict'; 21 | 22 | return { 23 | 24 | /** 25 | * @public 26 | * @param {Object} config 27 | * @return {Promise} 28 | */ 29 | paypalScriptLoader: function (config) { 30 | return new Promise((resolve, reject) => { 31 | const paypalScript = document.querySelector(`script[src*="${config.paypalScriptUrl}"]`); 32 | 33 | if (paypalScript) { 34 | resolve(); 35 | return; 36 | } 37 | 38 | const script = document.createElement('script'); 39 | 40 | script.addEventListener('load', () => { 41 | resolve(); 42 | }); 43 | 44 | script.addEventListener('error', () => { 45 | reject('Something wrong happened with paypal script load'); 46 | }); 47 | 48 | this.buildScript(script, config); 49 | }); 50 | }, 51 | 52 | /** 53 | * @public 54 | * @param {HTMLScriptElement} script 55 | * @param {Object} config 56 | */ 57 | buildScript: function (script, config) { 58 | const scriptUrl = new URL(config.paypalScriptUrl); 59 | scriptUrl.searchParams.append('client-id', config.clientId); 60 | scriptUrl.searchParams.append('merchant-id', config.merchantId); 61 | scriptUrl.searchParams.append('intent', config.intent); 62 | scriptUrl.searchParams.append('commit', config.commit); 63 | scriptUrl.searchParams.append('currency', Utilities.getQuoteCurrency()); 64 | scriptUrl.searchParams.append('disable-funding', 'credit,card,sepa'); 65 | 66 | script.type = 'text/javascript'; 67 | script.src = scriptUrl; 68 | script.dataset.pageType = config.pageType; 69 | script.dataset.partnerAttributionId = config.partnerAttributionId; 70 | 71 | document.head.appendChild(script); 72 | } 73 | }; 74 | }); 75 | -------------------------------------------------------------------------------- /view/frontend/web/template/checkout/minicart/applepaybutton.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 |
12 |
13 | 18 |
19 |
20 | 21 | -------------------------------------------------------------------------------- /view/frontend/web/template/checkout/minicart/paypalbutton.html: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 |
12 |
13 |
14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /view/frontend/web/template/payment/checkoutcom_apple_pay.html: -------------------------------------------------------------------------------- 1 | 15 | 16 |
18 |
19 | 21 | 24 |
25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 |
35 |
36 | 37 |
38 | 39 | 40 | 41 | 42 |
43 | 44 | 45 |
46 |
47 | 50 |
51 |
52 | 53 |
54 |
55 | -------------------------------------------------------------------------------- /view/frontend/web/template/payment/checkoutcom_google_pay.html: -------------------------------------------------------------------------------- 1 | 15 | 16 |
17 |
18 | 19 | 22 |
23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 |
33 |
34 | 35 |
36 | 37 | 38 | 39 | 40 |
41 | 42 |
43 |
44 | 45 |
46 |
47 |
48 |
49 |
50 | 51 | -------------------------------------------------------------------------------- /view/frontend/web/template/payment/checkoutcom_paypal.html: -------------------------------------------------------------------------------- 1 | 15 | 16 |
18 |
19 | 21 | 24 |
25 | 26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 |
34 |
35 |
36 | 37 | 38 |
39 | 40 | 41 | 42 |
43 | 44 | 45 |
46 | 47 | 48 | 49 |
50 | 51 | 52 |
53 |
54 |
55 | 56 |
57 |
58 | -------------------------------------------------------------------------------- /view/frontend/web/template/payment/checkoutcom_paypal_express.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 |
20 |
21 |
22 |
23 |
24 | 25 | --------------------------------------------------------------------------------