├── .circleci ├── README.md ├── config.yml ├── phpstan │ ├── mocks │ │ ├── aheadworks_giftcard_api_data_giftcardinterface.mock │ │ ├── aheadworks_giftcard_model_giftcard.mock │ │ ├── amasty_commonrules_model_resouremodel_rule.mock │ │ ├── amasty_giftcard_model_account.mock │ │ ├── amasty_giftcardaccount_api_data_giftcardaccountinterface.mock │ │ ├── amasty_giftcardaccount_model_giftcardaccount_giftcardprocessor.mock │ │ ├── amasty_number_model_configprovider.mock │ │ ├── amasty_promo_plugin_quote_model_quote_rule.mock │ │ ├── amasty_promo_plugin_quote_model_quote_totalscollectorplugin.mock │ │ ├── amasty_shiprestriction_model_shippingrestrictionrule.mock │ │ ├── amasty_storecredit_api_data_salesfieldinterface.mock │ │ ├── bagriders_storecredit_api_data_salesfieldinterface.mock │ │ ├── classyllama_avatax_plugin_model_resourcemodel_extension.mock │ │ ├── imaginationmedia_tmwgiftcard_observer_force_invoice.mock │ │ ├── magento_giftcard_model_catalog_product_type_giftcard.mock │ │ ├── magento_giftcardaccount_model_giftcardaccount.mock │ │ ├── magento_inventory_model_sourceitem_command_decrementsourceitemqty.mock │ │ ├── magento_inventoryinstorepickupshippingapi_model_carrier_instorepickup.mock │ │ ├── magento_reward_controller_cart_remove.mock │ │ ├── mageplaza_giftcard_model_giftcard.mock │ │ ├── magevision_freeshippingadmin_model_carrier_method.mock │ │ ├── mageworx_rewardpoints_controller_checkout_apply.mock │ │ ├── mageworx_storelocator_helper_data.mock │ │ ├── mirasvit_credit_model_config.mock │ │ ├── mirasvit_credit_model_total_quote_credit.mock │ │ ├── mirasvit_revards_api_config_rule_spendingstyleinterface.mock │ │ ├── mirasvit_rewards_helper_calculation.mock │ │ ├── mirasvit_rewards_model_purchase.mock │ │ ├── mirasvit_rewards_model_total_quote_discount.mock │ │ ├── mirasvit_rewardscheckout_controller_checkout_applypointspost.mock │ │ ├── mirasvut_rewards_helper_balance_spendcartrangedata.mock │ │ ├── shineretroits_shippingmethod_model_carrier_customshipping.mock │ │ ├── taxjar_salestax_model_smartcalcs.mock │ │ ├── unirgy_giftcert_model_cert.mock │ │ ├── webkul_odoomagentoconnect_model_resourcemodel_order.mock │ │ └── zonos_dutytax_model_carrier_zonos.mock │ └── phpstan.neon └── scripts │ ├── auto-rebase-branches.txt │ ├── auto-rebase.sh │ ├── rebase-and-magento-integration-test.sh │ └── test-merchant-branches.sh ├── .eslintignore ├── .eslintrc.json ├── .github ├── CODEOWNERS ├── pull_request_template.md └── stale.yml ├── .gitignore ├── Api ├── CartManagementInterface.php ├── CreateOrderInterface.php ├── Data │ ├── CartDataInterface.php │ ├── DefaultOrderStatusInterface.php │ ├── ExtendWarrantyPlanInterface.php │ ├── ExternalCustomerEntityInterface.php │ ├── FeatureSwitchInterface.php │ ├── GetMaskedQuoteIDDataInterface.php │ ├── GetProductDataInterface.php │ ├── PluginVersionNotificationInterface.php │ ├── ProductEventInterface.php │ ├── ProductInterface.php │ ├── ProductInventoryInfoInterface.php │ ├── ShipToStoreOptionInterface.php │ ├── ShippingDataInterface.php │ ├── ShippingOptionInterface.php │ ├── ShippingOptionsInterface.php │ ├── ShippingTaxDataInterface.php │ ├── ShippingTaxInterface.php │ ├── StoreAddressInterface.php │ ├── TaxDataInterface.php │ ├── TaxResultInterface.php │ ├── UniversalApiResultInterface.php │ ├── UniversalWebhookResultInterface.php │ └── UpdateCartResultInterface.php ├── DebugInterface.php ├── DiscountCodeValidationInterface.php ├── ExtendWarrantyManagementInterface.php ├── ExternalCustomerEntityRepositoryInterface.php ├── FeatureSwitchRepositoryInterface.php ├── FeatureSwitchesHookInterface.php ├── GetAccountInterface.php ├── GetDefaultOrderStatusesInterface.php ├── GetProductImageUrlInterface.php ├── GetProductInterface.php ├── LegacyApiInterface.php ├── OAuthRedirectInterface.php ├── OrderManagementInterface.php ├── OrderTransactionsInterface.php ├── PluginVersionNotificationRepositoryInterface.php ├── ProductEventManagerInterface.php ├── ProductEventRepositoryInterface.php ├── RouteInsuranceManagementInterface.php ├── ShippingInterface.php ├── ShippingMethodsInterface.php ├── StoreConfigurationManagerInterface.php ├── TaxInterface.php ├── UniversalApiInterface.php ├── UniversalWebhookInterface.php ├── UpdateCartInterface.php └── UpdateSettingsInterface.php ├── Block ├── Adminhtml │ ├── Customer │ │ └── CreditCard │ │ │ └── Tab │ │ │ ├── CreditCard.php │ │ │ └── View │ │ │ ├── CardNumber.php │ │ │ ├── CardType.php │ │ │ ├── CreditCard.php │ │ │ └── DeleteAction.php │ ├── MinifiedJsCartApiDriven.php │ └── System │ │ └── Config │ │ └── Form │ │ └── Version.php ├── BlockTrait.php ├── Checkout │ ├── Cart │ │ └── ComponentSwitcherProcessor.php │ ├── ComponentSwitcherProcessor.php │ ├── LayoutProcessor.php │ └── Success.php ├── Customer │ └── CreditCard.php ├── Form.php ├── Info.php ├── Js.php ├── JsProductPage.php ├── MinifiedJs.php ├── MinifiedJsCartApiDriven.php └── System │ └── Config │ ├── DisableForCustomerGroup.php │ └── IntegrationConnection.php ├── CHANGELOG.md ├── Controller ├── Adminhtml │ ├── Cart │ │ └── Data.php │ ├── Customer │ │ ├── CreditCard.php │ │ └── DeleteCreditCard.php │ ├── Order │ │ ├── ReceivedUrl.php │ │ └── Save.php │ └── System │ │ └── ProcessIntegrationToken.php ├── Cart │ ├── CheckoutConfig.php │ ├── Data.php │ ├── Email.php │ └── Hints.php ├── Customer │ ├── CreditCard.php │ └── DeleteCreditCard.php ├── Order │ ├── ReceivedUrl.php │ └── Save.php ├── ReceivedUrlInterface.php ├── ReceivedUrlTrait.php └── Shipping │ └── Prefetch.php ├── Cron ├── CatalogIngestion.php ├── DeactivateQuote.php ├── DeleteOldWebHookLogs.php └── VersionNotifier.php ├── Exception └── BoltException.php ├── Helper ├── Api.php ├── ArrayHelper.php ├── AutomatedTesting.php ├── Bugsnag.php ├── Cart.php ├── CheckboxesHandler.php ├── Config.php ├── CustomFieldsHandler.php ├── Discount.php ├── FeatureSwitch │ ├── Debug.php │ ├── Decider.php │ ├── Definitions.php │ └── Manager.php ├── Geolocation.php ├── GiftOptionsHandler.php ├── GraphQL │ ├── Client.php │ └── Constants.php ├── Hook.php ├── IntegrationManagement.php ├── JWT │ ├── BeforeValidException.php │ ├── ExpiredException.php │ ├── JWK.php │ ├── JWT.php │ ├── LICENSE │ └── SignatureInvalidException.php ├── Log.php ├── LogRetriever.php ├── Metric.php ├── MetricsClient.php ├── ModuleRetriever.php ├── Order.php ├── SSOHelper.php ├── SecretObscurer.php ├── Session.php └── Shared │ ├── ApiUtils.php │ └── CurrencyUtils.php ├── LICENSE.txt ├── Logger ├── Handler.php └── Logger.php ├── Model ├── Api │ ├── CartManagement.php │ ├── CreateOrder.php │ ├── Data │ │ ├── AutomatedTesting │ │ │ ├── Address.php │ │ │ ├── Cart.php │ │ │ ├── CartItem.php │ │ │ ├── Config.php │ │ │ ├── Order.php │ │ │ ├── OrderItem.php │ │ │ ├── PriceProperty.php │ │ │ └── StoreItem.php │ │ ├── BoltConfigSetting.php │ │ ├── CartData.php │ │ ├── DebugInfo.php │ │ ├── DefaultOrderStatus.php │ │ ├── ExtendWarrantyPlan.php │ │ ├── GetMaskedQuoteIDData.php │ │ ├── GetProductData.php │ │ ├── PluginVersion.php │ │ ├── Product.php │ │ ├── ProductInventoryInfo.php │ │ ├── ShipToStoreOption.php │ │ ├── ShippingData.php │ │ ├── ShippingOption.php │ │ ├── ShippingOptions.php │ │ ├── ShippingTax.php │ │ ├── StoreAddress.php │ │ ├── TaxData.php │ │ ├── TaxResult.php │ │ ├── UniversalApiResult.php │ │ ├── UniversalWebhookResult.php │ │ └── UpdateCartResult.php │ ├── Debug.php │ ├── DiscountCodeValidation.php │ ├── ExtendWarrantyManagement.php │ ├── FeatureSwitchesHook.php │ ├── GetAccount.php │ ├── GetDefaultOrderStatuses.php │ ├── GetProduct.php │ ├── GetProductImageUrl.php │ ├── LegacyApi.php │ ├── OAuthRedirect.php │ ├── OrderManagement.php │ ├── OrderTransactions.php │ ├── RouteInsuranceManagement.php │ ├── Shipping.php │ ├── ShippingMethods.php │ ├── ShippingTax.php │ ├── ShippingTaxContext.php │ ├── Tax.php │ ├── UniversalApi.php │ ├── UniversalWebhook.php │ ├── UpdateCart.php │ ├── UpdateCartCommon.php │ ├── UpdateCartContext.php │ ├── UpdateCartItemTrait.php │ ├── UpdateDiscountTrait.php │ └── UpdateSettings.php ├── Authorization │ └── HookContext.php ├── BoltAdditionalRequestParamsReader.php ├── CatalogIngestion │ ├── Debug.php │ ├── ProductEvent.php │ ├── ProductEventManager.php │ ├── ProductEventProcessor.php │ ├── ProductEventPublisher.php │ ├── ProductEventRepository.php │ ├── ProductEventRequestBuilder.php │ └── Request │ │ └── Product │ │ └── DataProcessor.php ├── Config │ └── Source │ │ └── Catalog │ │ └── Ingestion │ │ ├── Attributes.php │ │ └── Events.php ├── CustomerCreditCard.php ├── ErrorResponse.php ├── EventsForThirdPartyModules.php ├── ExternalCustomerEntity.php ├── ExternalCustomerEntityRepository.php ├── FeatureSwitch.php ├── FeatureSwitchRepository.php ├── HttpClientAdapter.php ├── Payment.php ├── Request.php ├── ResourceModel │ ├── CatalogIngestion │ │ ├── ProductEvent.php │ │ └── ProductEvent │ │ │ └── Collection.php │ ├── CustomerCreditCard.php │ ├── CustomerCreditCard │ │ └── Collection.php │ ├── ExternalCustomerEntity.php │ ├── ExternalCustomerEntity │ │ └── Collection.php │ ├── FeatureSwitch.php │ ├── FeatureSwitch │ │ └── Collection.php │ ├── VersionNotifier │ │ ├── PluginVersionNotification.php │ │ └── PluginVersionNotification │ │ │ └── Collection.php │ ├── WebhookLog.php │ └── WebhookLog │ │ └── Collection.php ├── Response.php ├── RestApiRequestValidator.php ├── Service │ └── InvoiceService.php ├── Source │ └── Group.php ├── StoreConfiguration │ ├── StoreConfigurationManager.php │ └── StoreConfigurationRequestBuilder.php ├── System │ └── Message │ │ └── NewVersionNotification.php ├── ThirdPartyModuleFactory.php ├── VersionNotifier │ ├── PluginVersionNotification.php │ ├── PluginVersionNotificationRepository.php │ └── VersionValidator.php └── WebhookLog.php ├── Observer ├── Adminhtml │ ├── ActionPredispatch.php │ └── Sales │ │ ├── CreateInvoiceForRechargedOrder.php │ │ ├── OrderCreateProcessDataObserver.php │ │ └── RechargeCustomer.php ├── ClearBoltShippingTaxCacheObserver.php ├── CustomPrice.php ├── OrderSaveObserver.php ├── PreventCustomerEdit.php ├── PublishBoltProductEventObserver.php ├── RemoveBlocksObserver.php └── TrackingSaveObserver.php ├── Plugin ├── AbstractLoginPlugin.php ├── Amasty │ ├── CommonRules │ │ └── Model │ │ │ └── ResourceModel │ │ │ └── Rule │ │ │ └── CollectionPlugin.php │ ├── Number │ │ └── Model │ │ │ └── ConfigProviderPlugin.php │ ├── Promo │ │ └── Quote │ │ │ └── Model │ │ │ └── Quote │ │ │ └── TotalsCollectorPlugin.php │ └── Shiprestriction │ │ └── Model │ │ └── ShippingRestrictionRulePlugin.php ├── AmastyGiftCardRemovePlugin.php ├── CheckSettingsUpdate.php ├── ClassyLlama │ └── AvaTax │ │ └── Plugin │ │ └── Model │ │ └── ResourceModel │ │ └── ExtensionAttributesPersistencePluginPlugin.php ├── ClearQuote.php ├── ImaginationMedia │ └── TmwGiftCard │ │ └── ForceInvoicePlugin.php ├── LoginPlugin.php ├── LoginPostPlugin.php ├── MageVision │ └── FreeShippingAdmin │ │ └── MethodPlugin.php ├── MageWorx │ ├── RewardPoints │ │ └── Controller │ │ │ └── Checkout │ │ │ └── ApplyPlugin.php │ └── StoreLocator │ │ └── Helper │ │ └── DataPlugin.php ├── Magento │ ├── Catalog │ │ └── Api │ │ │ └── ProductRepositoryPlugin.php │ ├── CatalogInventory │ │ ├── Api │ │ │ └── StockItemRepositoryPlugin.php │ │ └── Model │ │ │ └── ResourceModel │ │ │ └── StockPlugin.php │ ├── Checkout │ │ ├── Api │ │ │ ├── GuestPaymentInformationManagementPlugin.php │ │ │ └── PaymentInformationManagementPlugin.php │ │ ├── CustomerData │ │ │ └── Cart.php │ │ └── Model │ │ │ ├── Session │ │ │ └── SuccessValidatorPlugin.php │ │ │ └── ShippingInformationManagementPlugin.php │ ├── Config │ │ └── Model │ │ │ └── ConfigPlugin.php │ ├── CustomerBalance │ │ └── Observer │ │ │ └── RevertStoreCreditForOrderPlugin.php │ ├── Fedex │ │ └── Model │ │ │ └── CacheFedexResultPlugin.php │ ├── Framework │ │ ├── App │ │ │ └── Action │ │ │ │ └── AbstractActionPlugin.php │ │ ├── HTTP │ │ │ └── PhpEnvironment │ │ │ │ └── RemoteAddressPlugin.php │ │ ├── Session │ │ │ ├── SessionManagerPlugin.php │ │ │ └── ValidatorPlugin.php │ │ └── View │ │ │ └── Element │ │ │ └── UiComponent │ │ │ └── DataProvider │ │ │ ├── DataProviderPlugin.php │ │ │ ├── RegularFilterPlugin.php │ │ │ └── ReportingPlugin.php │ ├── GiftCard │ │ └── GenerateGiftCardAccountsOrderPlugin.php │ ├── Integration │ │ └── Model │ │ │ └── IntegrationServicePlugin.php │ ├── Inventory │ │ └── Model │ │ │ └── SourceItem │ │ │ └── Command │ │ │ ├── DecrementSourceItemQtyPlugin.php │ │ │ ├── SourceItemSavePlugin.php │ │ │ └── SourceItemsDeletePlugin.php │ ├── InventorySalesApi │ │ └── Api │ │ │ └── PlaceReservationsForSalesEventPlugin.php │ ├── Quote │ │ ├── Api │ │ │ └── ShippingMethodManagementPlugin.php │ │ └── Observer │ │ │ └── Frontend │ │ │ └── Quote │ │ │ └── Address │ │ │ └── AddressCollectTotalsObserverPlugin.php │ ├── Rewards │ │ └── Controller │ │ │ └── Cart │ │ │ └── RemoveActionPlugin.php │ ├── Sales │ │ └── Model │ │ │ ├── AdminOrder │ │ │ └── CreatePlugin.php │ │ │ └── InvoiceOrderPlugin.php │ ├── TogglePaymentMethodsPlugin.php │ └── Ui │ │ ├── Component │ │ └── Form │ │ │ └── Element │ │ │ └── SelectPlugin.php │ │ └── Model │ │ └── Export │ │ └── MetadataProviderPlugin.php ├── Mirasvit │ ├── Credit │ │ └── Model │ │ │ └── Total │ │ │ └── Quote │ │ │ └── CreditPlugin.php │ ├── Rewards │ │ └── Model │ │ │ ├── PurchasePlugin.php │ │ │ └── Total │ │ │ └── Quote │ │ │ └── DiscountPlugin.php │ └── RewardsCheckout │ │ └── Controller │ │ └── Checkout │ │ └── ApplyPointsPostPlugin.php ├── MirasvitCreditQuotePaymentImportDataBeforePlugin.php ├── NonBoltOrderPlugin.php ├── OrderPlugin.php ├── OrderSenderPlugin.php ├── QuotePlugin.php ├── RestoreQuotePlugin.php ├── SalesRuleActionDiscountPlugin.php ├── SalesRuleModelUtilityPlugin.php ├── SalesRuleQuoteDiscountPlugin.php ├── Shineretrofits │ └── ShippingMethod │ │ └── Model │ │ └── Carrier │ │ └── CustomshippingPlugin.php ├── Taxjar │ └── SalesTax │ │ └── Model │ │ └── SmartcalcsPlugin.php ├── WebapiRest │ └── Magento │ │ ├── Checkout │ │ └── Api │ │ │ ├── GuestPaymentInformationManagementPlugin.php │ │ │ └── PaymentInformationManagementPlugin.php │ │ ├── Framework │ │ └── Webapi │ │ │ └── ErrorProcessorPlugin.php │ │ └── Quote │ │ └── Model │ │ └── QuotePlugin.php ├── Webkul │ └── Odoomagentoconnect │ │ └── Model │ │ └── ResourceModel │ │ └── OrderPlugin.php └── Zonos │ └── DutyTax │ └── Model │ └── Carrier │ └── ZonosPlugin.php ├── README.md ├── Section └── CustomerData │ ├── BoltCart.php │ └── BoltHints.php ├── Service └── GitApiService.php ├── Setup ├── Recurring.php ├── RecurringData.php ├── Uninstall.php └── UpgradeSchema.php ├── Test ├── Load │ ├── README.md │ ├── config.js │ ├── inputs │ │ ├── address.js │ │ ├── amount.js │ │ ├── jacket_item.js │ │ ├── preauth_cart.js │ │ ├── preauth_payload.js │ │ ├── shipment.js │ │ ├── shippingtax_cart.js │ │ └── shippingtax_payload.js │ ├── rpcs │ │ ├── cartdata.js │ │ ├── create_order.js │ │ └── shippingtax.js │ ├── setup-files │ │ ├── LoadTestCartData.php │ │ ├── LoadTestCartDataInterface.php │ │ ├── README.md │ │ └── setup.sh │ └── user_flow.js ├── Unit │ ├── .gitignore │ ├── Block │ │ ├── Adminhtml │ │ │ └── Customer │ │ │ │ └── CreditCard │ │ │ │ └── Tab │ │ │ │ ├── CreditCardTest.php │ │ │ │ └── View │ │ │ │ ├── CardNumberTest.php │ │ │ │ ├── CardTypeTest.php │ │ │ │ ├── CreditCardTest.php │ │ │ │ └── DeleteActionTest.php │ │ ├── BlockTraitTest.php │ │ ├── Checkout │ │ │ ├── Cart │ │ │ │ └── ComponentSwitcherProcessorTest.php │ │ │ ├── ComponentSwitcherProcessorTest.php │ │ │ ├── LayoutProcessorTest.php │ │ │ └── SuccessTest.php │ │ ├── Customer │ │ │ └── CreditCardTest.php │ │ ├── FormTest.php │ │ ├── InfoTest.php │ │ ├── JsProductPageTest.php │ │ ├── JsTest.php │ │ └── MinifiedJsTest.php │ ├── BoltTestCase.php │ ├── Controller │ │ ├── Adminhtml │ │ │ ├── Cart │ │ │ │ └── DataTest.php │ │ │ ├── Customer │ │ │ │ ├── CreditCardTest.php │ │ │ │ └── DeleteCreditCardTest.php │ │ │ └── Order │ │ │ │ ├── ReceivedUrlTest.php │ │ │ │ └── SaveTest.php │ │ ├── Cart │ │ │ ├── CheckoutConfigTest.php │ │ │ ├── DataTest.php │ │ │ ├── EmailTest.php │ │ │ └── HintsTest.php │ │ ├── Customer │ │ │ ├── CreditCardTest.php │ │ │ └── DeleteCreditCardTest.php │ │ ├── Order │ │ │ ├── ReceivedUrlTest.php │ │ │ └── SaveTest.php │ │ ├── ReceivedUrlTraitTest.php │ │ └── Shipping │ │ │ └── PrefetchTest.php │ ├── Cron │ │ ├── CatalogIngestionTest.php │ │ ├── DeactivateQuoteTest.php │ │ └── DeleteOldWebHookLogsTest.php │ ├── Exception │ │ └── BoltExceptionTest.php │ ├── Helper │ │ ├── ApiTest.php │ │ ├── ArrayHelperTest.php │ │ ├── AutomatedTestingTest.php │ │ ├── BugsnagTest.php │ │ ├── CartTest.php │ │ ├── CheckboxesHandlerTest.php │ │ ├── ConfigTest.php │ │ ├── CustomFieldsHandlerTest.php │ │ ├── DiscountTest.php │ │ ├── FeatureSwitch │ │ │ ├── DeciderTest.php │ │ │ └── ManagerTest.php │ │ ├── GeolocationTest.php │ │ ├── GiftOptionsHandlerTest.php │ │ ├── GraphQL │ │ │ └── ClientTest.php │ │ ├── HookTest.php │ │ ├── LogRetrieverTest.php │ │ ├── LogTest.php │ │ ├── MetricTest.php │ │ ├── MetricsClientTest.php │ │ ├── ModuleRetrieverTest.php │ │ ├── OrderTest.php │ │ ├── SSOHelperTest.php │ │ ├── SecretObscurerTest.php │ │ ├── SessionTest.php │ │ └── Shared │ │ │ ├── ApiUtilsTest.php │ │ │ └── CurrencyUtilsTest.php │ ├── Model │ │ ├── Api │ │ │ ├── CartManagementTest.php │ │ │ ├── CreateOrderTest.php │ │ │ ├── Data │ │ │ │ ├── AutomatedTesting │ │ │ │ │ ├── AddressTest.php │ │ │ │ │ ├── CartItemTest.php │ │ │ │ │ ├── CartTest.php │ │ │ │ │ ├── ConfigTest.php │ │ │ │ │ ├── OrderItemTest.php │ │ │ │ │ ├── OrderTest.php │ │ │ │ │ ├── PricePropertyTest.php │ │ │ │ │ └── StoreItemTest.php │ │ │ │ ├── BoltConfigSettingTest.php │ │ │ │ ├── CartDataTest.php │ │ │ │ ├── DebugInfoTest.php │ │ │ │ ├── PluginVersionTest.php │ │ │ │ ├── ShipToStoreOptionTest.php │ │ │ │ ├── ShippingDataTest.php │ │ │ │ ├── ShippingOptionTest.php │ │ │ │ ├── ShippingOptionsTest.php │ │ │ │ ├── ShippingTaxTest.php │ │ │ │ ├── StoreAddressTest.php │ │ │ │ ├── TaxDataTest.php │ │ │ │ ├── TaxResultTest.php │ │ │ │ └── UpdateCartResultTest.php │ │ │ ├── DebugTest.php │ │ │ ├── DiscountCodeValidationTest.php │ │ │ ├── FeatureSwitchesHookTest.php │ │ │ ├── GetAccountTest.php │ │ │ ├── GetProductImageUrlTest.php │ │ │ ├── OAuthRedirectTest.php │ │ │ ├── OrderManagementTest.php │ │ │ ├── OrderTransactionsTest.php │ │ │ ├── RouteInsuranceManagementTest.php │ │ │ ├── ShippingMethodsTest.php │ │ │ ├── ShippingTaxContextTest.php │ │ │ ├── ShippingTaxTest.php │ │ │ ├── ShippingTest.php │ │ │ ├── TaxTest.php │ │ │ ├── UniversalApiTest.php │ │ │ ├── UniversalWebhookTest.php │ │ │ ├── UpdateCartCommonTest.php │ │ │ ├── UpdateCartContextTest.php │ │ │ ├── UpdateCartItemTraitTest.php │ │ │ ├── UpdateCartTest.php │ │ │ ├── UpdateDiscountTraitTest.php │ │ │ ├── UpdateSettingsTest.php │ │ │ └── _files │ │ │ │ └── magento_image.jpg │ │ ├── Authorization │ │ │ └── HookContextTest.php │ │ ├── CatalogIngestion │ │ │ ├── ProductEventManagerTest.php │ │ │ ├── ProductEventProcessorTest.php │ │ │ └── ProductEventRequestBuilderTest.php │ │ ├── CustomerCreditCardTest.php │ │ ├── ErrorResponseTest.php │ │ ├── EventsForThirdPartyModulesMock.php │ │ ├── EventsForThirdPartyModulesTest.php │ │ ├── ExternalCustomerEntityRepositoryTest.php │ │ ├── ExternalCustomerEntityTest.php │ │ ├── FeatureSwitchRepositoryTest.php │ │ ├── FeatureSwitchTest.php │ │ ├── ListenerMock.php │ │ ├── PaymentTest.php │ │ ├── ResourceModel │ │ │ ├── CustomerCreditCard │ │ │ │ └── CollectionTest.php │ │ │ ├── CustomerCreditCardTest.php │ │ │ ├── ExternalCustomerEntity │ │ │ │ └── CollectionTest.php │ │ │ ├── ExternalCustomerEntityTest.php │ │ │ ├── FeatureSwitchTest.php │ │ │ ├── WebhookLog │ │ │ │ └── CollectionTest.php │ │ │ └── WebhookLogTest.php │ │ ├── Service │ │ │ └── InvoiceServiceTest.php │ │ ├── ThirdPartyModuleFactoryTest.php │ │ ├── WebHook │ │ │ ├── StoreConfigurationManagerTest.php │ │ │ └── StoreConfigurationRequestBuilderTest.php │ │ └── WebhookLogTest.php │ ├── Observer │ │ ├── Adminhtml │ │ │ ├── ActionPredispatchTest.php │ │ │ └── Sales │ │ │ │ ├── CreateInvoiceForRechargedOrderTest.php │ │ │ │ ├── OrderCreateProcessDataObserverTest.php │ │ │ │ └── RechargeCustomerTest.php │ │ ├── ClearBoltShippingTaxCacheObserverTest.php │ │ ├── OrderSaveObserverTest.php │ │ ├── RemoveBlocksObserverTest.php │ │ └── TrackingSaveObserverTest.php │ ├── Plugin │ │ ├── AbstractLoginPluginTest.php │ │ ├── CheckSettingsUpdateTest.php │ │ ├── ClassyLlama │ │ │ └── AvaTax │ │ │ │ └── Plugin │ │ │ │ └── Model │ │ │ │ └── ResourceModel │ │ │ │ └── ExtensionAttributesPersistencePluginPluginTest.php │ │ ├── ClearQuoteTest.php │ │ ├── LoginPostPluginTest.php │ │ ├── MageVision │ │ │ └── FreeShippingAdmin │ │ │ │ └── MethodPluginTest.php │ │ ├── Magento │ │ │ ├── Framework │ │ │ │ ├── Session │ │ │ │ │ └── ValidatorPluginTest.php │ │ │ │ └── View │ │ │ │ │ └── Element │ │ │ │ │ └── UiComponent │ │ │ │ │ └── DataProvider │ │ │ │ │ └── DataProviderPluginTest.php │ │ │ ├── GiftCard │ │ │ │ └── GenerateGiftCardAccountsOrderPluginTest.php │ │ │ ├── Quote │ │ │ │ └── Observer │ │ │ │ │ └── Frontend │ │ │ │ │ └── Quote │ │ │ │ │ └── Address │ │ │ │ │ └── AddressCollectTotalsObserverPluginTest.php │ │ │ ├── Rewards │ │ │ │ └── Controller │ │ │ │ │ └── Cart │ │ │ │ │ └── RemoveActionPluginTest.php │ │ │ ├── Sales │ │ │ │ └── Model │ │ │ │ │ └── AdminOrder │ │ │ │ │ └── CreatePluginTest.php │ │ │ ├── TogglePaymentMethodsPluginTest.php │ │ │ └── Ui │ │ │ │ └── Component │ │ │ │ └── Form │ │ │ │ └── Element │ │ │ │ └── SelectPluginTest.php │ │ ├── Mirasvit │ │ │ └── Rewards │ │ │ │ └── Model │ │ │ │ └── PurchasePluginTest.php │ │ ├── NonBoltOrderObserverTest.php │ │ ├── OrderPluginTest.php │ │ ├── OrderSenderPluginTest.php │ │ ├── QuotePluginTest.php │ │ ├── RestoreQuotePluginTest.php │ │ ├── SalesRuleActionDiscountPluginTest.php │ │ ├── SalesRuleModelUtilityPluginTest.php │ │ ├── SalesRuleQuoteDiscountPluginTest.php │ │ ├── WebapiRest │ │ │ └── Magento │ │ │ │ └── Quote │ │ │ │ └── Model │ │ │ │ └── QuotePluginTest.php │ │ └── Webkul │ │ │ └── Odoomagentoconnect │ │ │ └── Model │ │ │ └── ResourceModel │ │ │ └── OrderPluginTest.php │ ├── README.md │ ├── Section │ │ └── CustomerData │ │ │ ├── BoltCartTest.php │ │ │ └── BoltHintsTest.php │ ├── Setup │ │ ├── RecurringDataTest.php │ │ ├── RecurringTest.php │ │ └── UpgradeSchemaTest.php │ ├── TestHelper.php │ ├── TestUtils.php │ ├── ThirdPartyModules │ │ ├── Aheadworks │ │ │ ├── RewardPointsTest.php │ │ │ └── Sarp2Test.php │ │ ├── Amasty │ │ │ ├── GiftCardAccountTest.php │ │ │ └── StoreCreditTest.php │ │ ├── IDme │ │ │ └── GroupVerificationTest.php │ │ ├── Magecomp │ │ │ └── ExtrafeeTest.php │ │ ├── Magento │ │ │ ├── CustomerBalanceTest.php │ │ │ └── RewardTest.php │ │ └── Webkul │ │ │ └── OdoomagentoconnectTest.php │ ├── UnirgyMock.php │ ├── ViewModel │ │ ├── CartDiscountsTest.php │ │ ├── MinicartAddonsTest.php │ │ └── OrderCommentTest.php │ ├── integration_phpunit.xml │ └── phpunit.xml └── scripts │ ├── 000-default.conf │ ├── CouponCode.php │ ├── FreeShipping.php │ ├── apache2.conf │ ├── ci-integration.sh │ ├── ci-magento-integration.sh │ ├── ci-unit.sh │ ├── install_magento.sh │ ├── install_magento_integrations.sh │ └── phpcs_meqp2.sh ├── ThirdPartyModules ├── Aheadworks │ ├── Giftcard.php │ ├── RewardPoints.php │ ├── Sarp2.php │ └── StoreCredit.php ├── Amasty │ ├── Affiliate.php │ ├── Extrafee.php │ ├── GiftCard.php │ ├── GiftCardAccount.php │ ├── Preorder.php │ ├── Promo.php │ ├── Rewards.php │ └── StoreCredit.php ├── BagRiders │ └── StoreCredit.php ├── Bss │ └── StoreCredit.php ├── IDme │ └── GroupVerification.php ├── ImaginationMedia │ └── TmwGiftCard.php ├── J2t │ └── Rewardpoints.php ├── Listrak │ └── Remarketing.php ├── MageWorld │ ├── Affiliate.php │ └── RewardPoints.php ├── MageWorx │ ├── Donations.php │ ├── Pickup.php │ ├── RewardPoints.php │ └── ShippingRules.php ├── Magecomp │ └── Extrafee.php ├── Magento │ ├── CompanyPayment.php │ ├── CustomerBalance.php │ ├── GiftCard.php │ ├── GiftCardAccount.php │ ├── InStorePickupShipping.php │ ├── Reward.php │ └── SalesRuleStaging.php ├── Mageplaza │ ├── GiftCard.php │ └── ShippingRestriction.php ├── Mageside │ └── CustomShippingPrice.php ├── Mexbs │ └── Tieredcoupon.php ├── Mirasvit │ ├── Credit.php │ └── Rewards.php ├── Route │ └── Route.php ├── SomethingDigital │ └── InStorePickupBoltIntegration.php ├── Teamwork │ ├── StoreCredit.php │ └── Token.php ├── Webkul │ └── Odoomagentoconnect.php └── Zonos │ └── DutyTax.php ├── ViewModel ├── CartDiscounts.php ├── MinicartAddons.php └── OrderComment.php ├── codecov.yml ├── composer.json ├── create_release.sh ├── docker-container ├── README.md ├── auth-format.py ├── compose-format.py ├── config.sh ├── configure-store.sh ├── docker-compose.yml ├── docker-format.py ├── install.sh ├── launch-magento.sh ├── m2-update.sh └── php-init.sh ├── etc ├── adminhtml │ ├── di.xml │ ├── events.xml │ ├── routes.xml │ └── system.xml ├── catalog_attributes.xml ├── config.xml ├── cron_groups.xml ├── crontab.xml ├── csp_whitelist.xml ├── di.xml ├── events.xml ├── extension_attributes.xml ├── frontend │ ├── di.xml │ ├── events.xml │ ├── routes.xml │ └── sections.xml ├── integration │ ├── api.xml │ └── config.xml ├── module.xml ├── webapi.xml └── webapi_rest │ └── di.xml ├── operations └── docker │ ├── README.md │ ├── php71 │ ├── Dockerfile │ └── auth-sample.json │ ├── php72 │ ├── Dockerfile │ └── auth-sample.json │ ├── php72_integration │ ├── Dockerfile │ ├── auth-sample.json │ └── install_magento_data.sh │ ├── php74 │ ├── Dockerfile │ └── auth-sample.json │ └── php8.4 │ └── Dockerfile ├── package-lock.json ├── package.json ├── phpcs.xml ├── registration.php └── view ├── adminhtml ├── layout │ ├── adminhtml_system_config_edit.xml │ ├── boltpay_customer_creditcard.xml │ ├── customer_index_edit.xml │ ├── sales_order_create_index.xml │ └── sales_order_view.xml ├── requirejs-config.js ├── templates │ ├── boltpay │ │ ├── button.phtml │ │ └── js │ │ │ ├── replacejs.phtml │ │ │ └── transaction.phtml │ ├── info │ │ ├── default.phtml │ │ └── pdf │ │ │ └── default.phtml │ ├── js │ │ └── replacejs-cart-api-driven.phtml │ ├── order │ │ └── comment.phtml │ └── system │ │ └── config │ │ └── integrationconnection.phtml └── web │ └── js │ ├── bolt-api-driven-checkout.js │ ├── shims │ └── es6-collections-shim.js │ └── validation.js └── frontend ├── layout ├── boltpay_customer_creditcard.xml ├── catalog_product_view.xml ├── catalog_product_view_type_bundle.xml ├── checkout_cart_index.xml ├── checkout_index_index.xml ├── checkout_onepage_success.xml ├── customer_account.xml ├── customer_account_create.xml ├── customer_account_login.xml ├── default.xml ├── hyva_catalog_product_view.xml ├── hyva_catalog_product_view_type_bundle.xml └── hyva_default.xml ├── requirejs-config.js ├── templates ├── authorization.phtml ├── boltaccount.phtml ├── button.phtml ├── button_product_page.phtml ├── checkout │ ├── cart │ │ └── discounts.phtml │ ├── minicart_addons.phtml │ └── success.phtml ├── css │ └── boltcss.phtml ├── customer │ ├── creditcard.phtml │ ├── login.phtml │ └── register.phtml ├── hyva │ ├── button_product_page.phtml │ └── js │ │ ├── boltglobaljs.phtml │ │ ├── boltjs.phtml │ │ ├── custom_sso_buttons.phtml │ │ ├── replacejs-cart-api-driven.phtml │ │ └── replacejs.phtml ├── info │ └── default.phtml ├── js │ ├── boltglobaljs.phtml │ ├── boltjs.phtml │ ├── checkout_funnel.js.phtml │ ├── custom_sso_buttons.phtml │ ├── replacejs-cart-api-driven.phtml │ ├── replacejs.phtml │ └── sso_button.phtml └── popup.phtml └── web ├── js ├── bolt-api-driven-checkout.js ├── bolt-legacy.js ├── mixins │ └── payment │ │ └── reward.js ├── track-checkout.js ├── utils │ ├── when-defined.js │ └── when-defined.test.js └── view │ ├── account.js │ ├── custom-sso-buttons.js │ ├── payment │ ├── boltpay.js │ └── method-renderer │ │ └── boltpay.js │ ├── pdp-button.js │ └── popup.js └── template ├── payment └── boltpay.html └── third-party-modules ├── aheadworks └── reward-points │ └── cart │ └── reward-points.html └── mageworx └── reward-points └── cart ├── rewardpoints.html └── rewardpoints_custom_amount.html /.circleci/README.md: -------------------------------------------------------------------------------- 1 | # Overview of Custom Circle CI Setup 2 | 3 | ## Customization branch auto rebase 4 | The circle ci workflow _auto-rebase_ will be triggered on every PR merge to master and try to auto-rebase the branches listed in _.circlci/scripts/auto-rebase-branches.txt_ against master one by one. 5 | The results of rebasing will be pushed to ci/ 6 | 7 | When a rebase process fails (eg: there is a conflict that needs to resolve manually) for a specified branch, it would try to recover and continue rebasing the other listed branches. 8 | In the end of the job, it prints out a summary about which branches failed to auto-rebase. 9 | 10 | To make your branch auto-rebase on master, simply append the branch name to _.circlci/scripts/auto-rebase-branches.txt_ in the newline separated format. -------------------------------------------------------------------------------- /.circleci/phpstan/mocks/aheadworks_giftcard_api_data_giftcardinterface.mock: -------------------------------------------------------------------------------- 1 | \n" 5 | exit 1 6 | fi 7 | 8 | if [[ $CIRCLE_BRANCH == master ]] ; then 9 | exit 0 10 | fi 11 | 12 | if [[ ${CIRCLE_BRANCH:0:3} == ci/ ]] && grep -n "^${CIRCLE_BRANCH:3}$" ./.circleci/scripts/auto-rebase-branches.txt >> /dev/null ; then 13 | echo "test-merchant-branches.sh Cannot be called from a merchant branch (this will cause an infinite loop)" 14 | exit 0 15 | fi 16 | 17 | # init git 18 | git config user.email "circleci@bolt.com" 19 | git config user.name "Circle CI" 20 | 21 | vcsType=$1 22 | user=$2 23 | repoName=$3 24 | 25 | echo "vcsType: $vcsType" 26 | echo "user: $user" 27 | echo "repoName: $repoName" 28 | 29 | # load auto-rebasing branches 30 | configFile="./.circleci/scripts/auto-rebase-branches.txt" 31 | if ! test -f "$configFile"; then 32 | echo "Cannot find the configuration for auto-rebase." 33 | exit 1 34 | fi 35 | 36 | while IFS= read -r branchName || [[ -n "$branchName" ]]; do 37 | if [ ${#branchName} -gt 0 ]; then 38 | merchantBranch="ci/$branchName" 39 | echo "Beginning testing on branch: $merchantBranch" 40 | 41 | params='{"run_rebase_and_magento_integration_test":true,"rebase_and_magento_integration_test_branch_name":"'"$merchantBranch"'","run_default_workflow":false}' 42 | echo "params: $params" 43 | /tmp/swissknife/trigger_pipeline.sh "$vcsType" "$user" "$repoName" "$CIRCLE_BRANCH" "$params" 44 | 45 | fi 46 | done < "$configFile" -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # ignore the test folder 2 | Test 3 | 4 | .gitignore -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["html", "exclude-php-tags"], 3 | "settings": { 4 | "html/html-extensions": [".phtml", ".html"] 5 | }, 6 | "parserOptions": { 7 | "ecmaVersion": 5 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Automatically request reviews from M2 code-owners 2 | * @BoltApp/commerce-platform-m2 3 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | Please include a summary of the change and which issue is fixed. Include the motivation for the changes, and comment on your PR if necessary for clarity. 3 | 4 | Fixes: (link ticket) 5 | 6 | #changelog 7 | 8 | # Type of change 9 | 10 | - [ ] Bug fix (change which fixes an issue) 11 | - [ ] New feature (change which adds functionality) 12 | - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) 13 | - [ ] This change requires a documentation update 14 | 15 | # How Has This Been Tested? 16 | 17 | Please validate that you have tested your change in at least one of the following areas: 18 | 19 | - [ ] Successfully tested locally (or docker image) 20 | - [ ] Successfully tested on a staging or sandbox server 21 | - [ ] Successfully tested on a merchant's staging server 22 | 23 | # For PR Reviewer 24 | 25 | - [ ] Reviewed unit tests to make sure we are using real components rather than mocks as much as possible? 26 | - [ ] For any major change (observer, new Bolt feature, core Magento interaction) we must add a feature switch, did you verify this? 27 | 28 | # Checklist: 29 | 30 | - [ ] My code follows the style guidelines of this project. 31 | - [ ] I have performed a self-review of my own code. 32 | - [ ] I have commented my code, particularly in hard-to-understand areas. 33 | - [ ] New and existing unit tests pass locally with my changes. 34 | - [ ] I have created or modified unit tests to sufficiently cover my changes. 35 | - [ ] I have added my ticket link and provided a changelog message. 36 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 5 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 2 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | - dependencies 10 | # Label to use when marking an issue as stale 11 | staleLabel: old 12 | # Comment to post when marking an issue as stale. Set to `false` to disable 13 | markComment: > 14 | This PR hasn't been touched in a while. Marking it as stale. If there is no 15 | activity in two days this PR will be auto-closed. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea/ 3 | .vscode/ 4 | node_modules 5 | 6 | # magento container files 7 | docker-container/magento-cloud 8 | auth.json 9 | config.sh 10 | vendor/ 11 | composer.lock -------------------------------------------------------------------------------- /Api/CreateOrderInterface.php: -------------------------------------------------------------------------------- 1 | getCardLast4Digit(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Block/Adminhtml/Customer/CreditCard/Tab/View/CardType.php: -------------------------------------------------------------------------------- 1 | getCardType(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Block/Adminhtml/Customer/CreditCard/Tab/View/DeleteAction.php: -------------------------------------------------------------------------------- 1 | $this->getUrl('boltpay/customer/deletecreditcard', ['id' => $row->getId()]), 30 | 'confirm' => __('Do you really want to delete the credit card'), 31 | 'caption' => __('Delete') 32 | ]; 33 | 34 | return $this->_toLinkHtml($action, $row); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Block/Adminhtml/MinifiedJsCartApiDriven.php: -------------------------------------------------------------------------------- 1 | featureSwitches->isEnabledFetchCartViaApi() && 36 | $this->isEnabled() 37 | ) { 38 | return $this->minifyJs(parent::_toHtml()); 39 | } 40 | } catch (\Exception $e) { 41 | return ''; 42 | } 43 | return ''; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Block/Checkout/ComponentSwitcherProcessor.php: -------------------------------------------------------------------------------- 1 | configHelper->isPaymentOnlyCheckoutEnabled(); 38 | return $jsLayout; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Block/Checkout/LayoutProcessor.php: -------------------------------------------------------------------------------- 1 | configHelper = $configHelper; 44 | } 45 | 46 | /** 47 | * Process the layout 48 | * 49 | * @param array $jsLayout 50 | * 51 | * @return array 52 | */ 53 | abstract public function process($jsLayout); 54 | } 55 | -------------------------------------------------------------------------------- /Block/MinifiedJs.php: -------------------------------------------------------------------------------- 1 | featureSwitches->isEnabledFetchCartViaApi() || 38 | in_array($this->getNameInLayout(), $this->allowedBlocksToRender) 39 | ) { 40 | return $this->minifyJs(parent::_toHtml()); 41 | } 42 | return ''; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Block/MinifiedJsCartApiDriven.php: -------------------------------------------------------------------------------- 1 | featureSwitches->isEnabledFetchCartViaApi() && 33 | !$this->shouldDisableBoltCheckout() && 34 | !$this->isBoltDisabledOnCurrentPage() && 35 | !(!$this->isOnPageFromWhiteList() && !$this->isMinicartEnabled()) 36 | ) { 37 | return $this->minifyJs(parent::_toHtml()); 38 | } 39 | } catch (\Exception $e) { 40 | return ''; 41 | } 42 | return ''; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Block/System/Config/DisableForCustomerGroup.php: -------------------------------------------------------------------------------- 1 | _featureSwitch = $_featureSwitch; 37 | parent::__construct($context, $data); 38 | } 39 | 40 | public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) 41 | { 42 | if ($this->_featureSwitch->isAllowDisablingBoltForCustomerGroup()) { 43 | return parent::render($element); // TODO: Change the autogenerated stub 44 | } 45 | 46 | return ''; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Customer/CreditCard.php: -------------------------------------------------------------------------------- 1 | initCurrentCustomer(); 28 | $resultLayout = $this->resultLayoutFactory->create(); 29 | return $resultLayout; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Controller/Customer/CreditCard.php: -------------------------------------------------------------------------------- 1 | _view->loadLayout(); 30 | $this->_view->renderLayout(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Controller/ReceivedUrlInterface.php: -------------------------------------------------------------------------------- 1 | versionValidator = $versionValidator; 34 | } 35 | /** 36 | * Getting last version data from git API 37 | */ 38 | public function execute(): void 39 | { 40 | $this->versionValidator->checkVersions(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Exception/BoltException.php: -------------------------------------------------------------------------------- 1 | code = (int) $code; 46 | $this->quote = $quote; 47 | } 48 | 49 | /** 50 | * @return null|Quote 51 | */ 52 | public function getQuote() 53 | { 54 | return $this->quote; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Helper/JWT/BeforeValidException.php: -------------------------------------------------------------------------------- 1 | key = $key; 42 | $this->data = $data; 43 | } 44 | 45 | 46 | /** 47 | * Gets JSON for object 48 | * 49 | * @return JSON 50 | */ 51 | public function getMetricJson() 52 | { 53 | return json_encode($this); 54 | } 55 | 56 | 57 | /** 58 | * Required function to use the json_encode function 59 | * 60 | * @return array 61 | */ 62 | public function jsonSerialize(): array 63 | { 64 | return 65 | [ $this->key => $this->data ]; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Helper/SecretObscurer.php: -------------------------------------------------------------------------------- 1 | amount; 42 | } 43 | 44 | /** 45 | * Set tax amount. 46 | * 47 | * @api 48 | * @param int $amount 49 | * 50 | * @return $this 51 | */ 52 | public function setAmount($amount) 53 | { 54 | $this->amount = $amount; 55 | return $this; 56 | } 57 | 58 | /** 59 | * @inheritDoc 60 | */ 61 | public function jsonSerialize(): array 62 | { 63 | return [ 64 | "amount" => $this->amount 65 | ]; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Model/Authorization/HookContext.php: -------------------------------------------------------------------------------- 1 | self::STOCK_STATUS_CHANGES, 'label' => __('Product Stock Status Changes')] 37 | ]; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Model/Request.php: -------------------------------------------------------------------------------- 1 | _init('bolt_product_event', 'id'); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Model/ResourceModel/CatalogIngestion/ProductEvent/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 35 | ProductEvent::class, 36 | ProductEventResource::class 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Model/ResourceModel/CustomerCreditCard.php: -------------------------------------------------------------------------------- 1 | _init('bolt_customer_credit_cards', 'id'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Model/ResourceModel/ExternalCustomerEntity.php: -------------------------------------------------------------------------------- 1 | _init('bolt_external_customer_entity', 'id'); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Model/ResourceModel/FeatureSwitch.php: -------------------------------------------------------------------------------- 1 | _init('bolt_feature_switches', 'id'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Model/ResourceModel/FeatureSwitch/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 31 | 'Bolt\Boltpay\Model\FeatureSwitch', 32 | 'Bolt\Boltpay\Model\ResourceModel\FeatureSwitch' 33 | ); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Model/ResourceModel/VersionNotifier/PluginVersionNotification.php: -------------------------------------------------------------------------------- 1 | _init('plugin_version_notification', PluginVersionNotificationInterface::LATEST_VERSION); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Model/ResourceModel/VersionNotifier/PluginVersionNotification/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 35 | PluginVersionNotification::class, 36 | PluginVersionNotificationResource::class 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Model/Response.php: -------------------------------------------------------------------------------- 1 | orderConverter->toInvoice($order); 36 | $invoice->setSubtotal($amount); 37 | $invoice->setGrandTotal($amount); 38 | 39 | $order->getInvoiceCollection()->addItem($invoice); 40 | 41 | return $invoice; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Plugin/Amasty/CommonRules/Model/ResourceModel/Rule/CollectionPlugin.php: -------------------------------------------------------------------------------- 1 | sessionHelper = $sessionHelper; 32 | } 33 | 34 | public function afterAddAddressFilter(\Amasty\CommonRules\Model\ResourceModel\Rule\Collection $subject, $result, $address) 35 | { 36 | if (HookHelper::$fromBolt && $this->sessionHelper->getCheckoutSession()->getBoltBackendOrderShippingRestrictionRule(false)) { 37 | $result->addFieldToFilter('for_admin', 1); 38 | $this->sessionHelper->getCheckoutSession()->setBoltBackendOrderShippingRestrictionRule(false); 39 | } 40 | 41 | return $result; 42 | } 43 | } -------------------------------------------------------------------------------- /Plugin/Magento/GiftCard/GenerateGiftCardAccountsOrderPlugin.php: -------------------------------------------------------------------------------- 1 | getEvent(); 31 | /** @var Order $order */ 32 | $order = $event->getOrder(); 33 | if ($order->getPayment() && $order->getPayment()->getMethod() === BoltPayment::METHOD_CODE && 34 | in_array($order->getStatus(), [Order::STATE_PENDING_PAYMENT, Order::STATE_CANCELED])) { 35 | return; 36 | } 37 | return $proceed($observer); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Plugin/Magento/TogglePaymentMethodsPlugin.php: -------------------------------------------------------------------------------- 1 | getEvent()->getMethodInstance()->getCode(); 36 | if ($paymentMethod != \Bolt\Boltpay\Model\Payment::METHOD_CODE) { 37 | return; 38 | } 39 | 40 | $result = $observer->getEvent()->getResult(); 41 | if ($result->getData('is_available')) { 42 | return; 43 | } 44 | 45 | $quote = $observer->getEvent()->getQuote(); 46 | if (!$quote) { 47 | return; 48 | } 49 | 50 | if ($quote->getBaseGrandTotal() == 0) { 51 | $result->setData('is_available', true); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Section/CustomerData/BoltHints.php: -------------------------------------------------------------------------------- 1 | cartHelper = $cartHelper; 42 | $this->configHelper = $configHelper; 43 | } 44 | 45 | public function getSectionData() 46 | { 47 | if (!$this->configHelper->isActive() || !$this->configHelper->getProductPageCheckoutFlag()) { 48 | return []; 49 | } 50 | return [ 51 | 'data' => $this->cartHelper->getHints(null, 'product'), 52 | ]; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Test/Load/README.md: -------------------------------------------------------------------------------- 1 | Bolt [k6](https://github.com/loadimpact/k6) load testing scripts. 2 | 3 | ## Writing Tests 4 | 5 | https://docs.k6.io/docs 6 | 7 | k6 execution environment is not nodejs (for performance reasons). 8 | Code written for it has to follow certain guidelines: 9 | 10 | - vanilla JS (no TS) 11 | - absolute imports only from "k6" namespace 12 | - "./" relative imports only within this folder 13 | 14 | ## Running Tests 15 | 16 | Setup the load test for by following the instructions in `setup-files/README.md` 17 | Then setup the `config.js` file in this directory so that it matches your stores configuration. 18 | 19 | Then to run the test once: 20 | 21 | docker run -i -v $(pwd):/src -e NODE_PATH=/src loadimpact/k6 run \ 22 | /src/user_flow.js 23 | 24 | To specify number of users/duration: 25 | 26 | docker run -i -v $(pwd):/src -e NODE_PATH=/src loadimpact/k6 run \ 27 | --vus 10 --duration 60s /src/user_flow.js 28 | 29 | Debugging http: 30 | docker run -i loadimpact/k6 run \ 31 | --http-debug /src/user_flow.js 32 | 33 | ## Creating BlackFire Profiles 34 | Follow these steps to setup [Blackfire](https://www.notion.so/boltteam/Blackfire-17f549490e084c7a98097d7b37d2d0fd) 35 | 36 | Create profiles by running: 37 | 38 | blackfire --samples 3 run sh -c \ 39 | 'k6 run user_flow.js \ 40 | -e SLEEP=0 \ 41 | -e BLACKFIRE_HEADER=$BLACKFIRE_QUERY' 42 | -------------------------------------------------------------------------------- /Test/Load/config.js: -------------------------------------------------------------------------------- 1 | import crypto from "k6/crypto"; 2 | 3 | // The constants below should be replaced with the 4 | // values from the store you want to load test 5 | 6 | // URL to the store 7 | export const URL = "http://54.201.96.204"; 8 | 9 | // Path from URL to the Cart Data Load Test Webhook 10 | export const CART_PATH = "/rest/V1/bolt/boltpay/order/cartdata"; 11 | 12 | // Path from URL to the Shipping and Tax Webhook 13 | export const SHIPPING_PATH = "/rest/V1/bolt/boltpay/shipping/methods"; 14 | 15 | // Path from URL to the PreAuth Webhook 16 | export const PREAUTH_PATH = "/rest/V1/bolt/boltpay/order/create"; 17 | 18 | // Store's Signing Secret 19 | const SIGNING_SECRET = "76037c6eeaf7005580f4541e3e5397017e153d5f7ce97ae30656f8a830c4908f"; 20 | 21 | // Used for profiling the test server 22 | const BLACKFIRE_HEADER = __ENV.BLACKFIRE_HEADER || ""; 23 | 24 | export function create_header( data ) { 25 | const hmac = crypto.hmac( 'sha256', SIGNING_SECRET, JSON.stringify( data ), 'base64' ); 26 | return { 27 | "X-Bolt-Hmac-Sha256": hmac, 28 | "Content-Type": "application/json", 29 | "X-Blackfire-Query": BLACKFIRE_HEADER 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /Test/Load/inputs/address.js: -------------------------------------------------------------------------------- 1 | export const address = { 2 | "street_address1": "1245 San Diego Loop", 3 | "street_address2": "", 4 | "street_address3": "", 5 | "street_address4": "", 6 | "locality": "Boston", 7 | "region": "Massachusetts", 8 | "postal_code": "02116", 9 | "company": "", 10 | "country": "United States", 11 | "country_code": "US", 12 | "name": "dummy user", 13 | "first_name": "dummy", 14 | "last_name": "user", 15 | "phone": "4161111111", 16 | "email_address": "kajan@bolt.com" 17 | }; 18 | -------------------------------------------------------------------------------- /Test/Load/inputs/amount.js: -------------------------------------------------------------------------------- 1 | export function create_amount( amount ){ 2 | return { 3 | "amount": amount, 4 | "currency": "USD", 5 | "currency_symbol": "$" 6 | }; 7 | } -------------------------------------------------------------------------------- /Test/Load/inputs/jacket_item.js: -------------------------------------------------------------------------------- 1 | import { create_amount } from "./amount.js"; 2 | import { URL } from "../config.js"; 3 | 4 | export function create_jacket_item ( is_pre_auth ) { 5 | return { 6 | "reference": "408", 7 | "name": "Montana Wind Jacket-S-Green", 8 | "description": "Light-as-a-feather wind protection for runners, walkers and outdoor fitness buffs," + 9 | " the Montana Wind Jacket can be stuffed into your pocket for portable protection." + 10 | " Its stylish, move-with-you design makes it especially versatile." + 11 | "\\nAdjustable hood. Split pocket. Thumb holes. Machine wash/hang to dry.", 12 | "options": null, 13 | "total_amount": is_pre_auth ? create_amount(4900) : 4900, 14 | "unit_price": is_pre_auth ? create_amount(4900) : 4900, 15 | "tax_amount": is_pre_auth ? create_amount(0) : 0, 16 | "quantity": 1, 17 | "uom": null, 18 | "upc": null, 19 | "sku": "MJ03-S-Green", 20 | "isbn": null, 21 | "brand": null, 22 | "manufacturer": null, 23 | "category": null, 24 | "tags": null, 25 | "properties": [], 26 | "color": null, 27 | "size": null, 28 | "weight": null, 29 | "weight_unit": null, 30 | "image_url": URL + "/pub/media/catalog/product/cache/a2d2345650965cd6042e53fd7d716674/m/j/mj03-green_main.jpg", 31 | "details_url": null, 32 | "taxable": true, 33 | "tax_code": null, 34 | "type": "physical" 35 | }; 36 | 37 | } -------------------------------------------------------------------------------- /Test/Load/inputs/preauth_cart.js: -------------------------------------------------------------------------------- 1 | import { create_amount } from "./amount.js"; 2 | import { address } from "./address.js"; 3 | import { create_jacket_item } from "./jacket_item.js"; 4 | import { shipment } from "./shipment.js"; 5 | 6 | export function create_preauth_cart ( order_reference ) { 7 | return { 8 | "order_reference": order_reference, 9 | "display_id": "000000316 / " + order_reference, 10 | "currency": { 11 | "currency": "USD", 12 | "currency_symbol": "$" 13 | }, 14 | "subtotal_amount": create_amount(4900), 15 | "total_amount": create_amount(5400), 16 | "tax_amount": create_amount(0), 17 | "shipping_amount": create_amount(500), 18 | "discount_amount": create_amount(0), 19 | "billing_address": address, 20 | "items": [ create_jacket_item(true) ], 21 | "shipments": [ shipment ], 22 | "discounts": [] 23 | }; 24 | } -------------------------------------------------------------------------------- /Test/Load/inputs/preauth_payload.js: -------------------------------------------------------------------------------- 1 | import { create_preauth_cart } from "./preauth_cart.js"; 2 | 3 | export function create_preauth_payload(order_token, order_reference) { 4 | return { 5 | "type": "order.create", 6 | "currency": "USD", 7 | "order": { 8 | "token": order_token, 9 | "cart": create_preauth_cart( order_reference ) 10 | } 11 | }; 12 | } -------------------------------------------------------------------------------- /Test/Load/inputs/shipment.js: -------------------------------------------------------------------------------- 1 | import { address } from "./address.js"; 2 | import { create_amount } from "./amount.js"; 3 | 4 | export const shipment = { 5 | "shipping_address": address, 6 | "shipping_method": "unknown", 7 | "service": "Flat Rate - Fixed", 8 | "cost": create_amount(500), 9 | "tax_amount": create_amount(0), 10 | "reference": "flatrate_flatrate" 11 | }; -------------------------------------------------------------------------------- /Test/Load/inputs/shippingtax_cart.js: -------------------------------------------------------------------------------- 1 | import { address } from "./address.js"; 2 | import { create_jacket_item } from "./jacket_item.js"; 3 | 4 | export function create_shippingtax_cart ( order_reference ) { 5 | return { 6 | "order_reference": order_reference, 7 | "display_id": "000000316 / " + order_reference, 8 | "currency": "USD", 9 | "total_amount": 4900, 10 | "tax_amount": 0, 11 | "billing_address": address, 12 | "billing_address_id": null, 13 | "items": [ 14 | create_jacket_item( false ), 15 | ], 16 | "shipments": null, 17 | "discounts": 0, 18 | "discount_code": "", 19 | "order_description": null, 20 | "transaction_reference": null, 21 | "cart_url": null, 22 | "is_shopify_hosted_checkout": false 23 | }; 24 | } -------------------------------------------------------------------------------- /Test/Load/inputs/shippingtax_payload.js: -------------------------------------------------------------------------------- 1 | import { address } from "./address.js"; 2 | import { create_shippingtax_cart } from "./shippingtax_cart.js"; 3 | 4 | export function create_shipping_info( order_token, order_reference ) { 5 | return { 6 | "order_token": order_token, 7 | "cart": create_shippingtax_cart( order_reference, false ), 8 | "shipping_address": address, 9 | "shipping_options": [], 10 | "request_source": "checkout" 11 | }; 12 | } -------------------------------------------------------------------------------- /Test/Load/rpcs/cartdata.js: -------------------------------------------------------------------------------- 1 | import http from "k6/http"; 2 | import { URL, CART_PATH, create_header } from "../config.js"; 3 | 4 | export function cart_data() { 5 | const cart_url = URL + CART_PATH; 6 | const cart = { "cart": [ { "sku": "MJ03-S-Green" } ] }; 7 | const header = create_header( cart ); 8 | return http.post( cart_url, JSON.stringify( cart ), { headers: header } ); 9 | } -------------------------------------------------------------------------------- /Test/Load/rpcs/create_order.js: -------------------------------------------------------------------------------- 1 | import http from "k6/http"; 2 | import { URL, PREAUTH_PATH, create_header } from "../config.js"; 3 | import { create_preauth_payload } from "../inputs/preauth_payload.js"; 4 | 5 | export function create_order( order_token, order_reference ) { 6 | const create_order_url = URL + PREAUTH_PATH; 7 | const data = create_preauth_payload( order_token, order_reference ); 8 | const header = create_header( data ); 9 | return http.post( create_order_url, JSON.stringify( data ), { headers: header } ); 10 | } -------------------------------------------------------------------------------- /Test/Load/rpcs/shippingtax.js: -------------------------------------------------------------------------------- 1 | import http from "k6/http"; 2 | import { create_shipping_info } from "../inputs/shippingtax_payload.js"; 3 | import { URL, SHIPPING_PATH, create_header } from "../config.js"; 4 | 5 | export function shipping_and_tax( order_token, order_reference ) { 6 | const shipping_url = URL + SHIPPING_PATH; 7 | const data = create_shipping_info( order_token, order_reference ); 8 | const header = create_header( data ); 9 | return http.post( shipping_url, JSON.stringify( data ), { headers: header }); 10 | } -------------------------------------------------------------------------------- /Test/Load/setup-files/LoadTestCartDataInterface.php: -------------------------------------------------------------------------------- 1 | 9 | ``` 10 | Add it below the comment: 11 | ``` 12 | 13 | ``` 14 | 4. In `bolt-magento2/etc/webapi.xml` add the following block of code between the `routes` tag: 15 | ``` 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ``` 24 | NOTE: Make sure that you use spaces instead of tabs when indenting in the xml files 25 | 26 | 5. In `bolt-magento2/etc/webapi_rest` add the following block of code between the `config` tag: 27 | ``` 28 | 29 | 30 | Magento\Checkout\Model\Session 31 | 32 | 33 | ``` 34 | 35 | 6. Switch over to `bolt-magento2/Test/Load/setup-files` directory and run `source setup.sh` 36 | -------------------------------------------------------------------------------- /Test/Load/setup-files/setup.sh: -------------------------------------------------------------------------------- 1 | cp LoadTestCartDataInterface.php /var/www/html/vendor/boltpay/bolt-magento2/Api/ 2 | cp LoadTestCartData.php /var/www/html/vendor/boltpay/bolt-magento2/Model/Api/ 3 | php /var/www/html/bin/magento setup:di:compile 4 | php /var/www/html/bin/magento cache:clean 5 | php /var/www/html/bin/magento cache:flush -------------------------------------------------------------------------------- /Test/Load/user_flow.js: -------------------------------------------------------------------------------- 1 | import { cart_data } from "./rpcs/cartdata.js"; 2 | import { shipping_and_tax } from "./rpcs/shippingtax.js"; 3 | import { create_order } from "./rpcs/create_order.js"; 4 | import { check, sleep } from "k6"; 5 | import { Rate } from "k6/metrics"; 6 | 7 | const errorRate = new Rate( "errors" ); 8 | 9 | // Num of seconds to sleep for. Need this when testing load of less than 1 user per second 10 | const SLEEP = parseFloat(__ENV.SLEEP) || 0; 11 | 12 | export default function test() { 13 | // cart page 14 | const cart_page_response = cart_data(); 15 | check( cart_page_response, { status_200: r => r.status == 200 } ) || errorRate.add(1); 16 | if ( cart_page_response.status == 200 ) { 17 | const json_body = JSON.parse( cart_page_response.body ); 18 | const order_token = json_body.order_token; 19 | const order_reference = json_body.order_reference; 20 | 21 | // shipping and tax 22 | const shipping_response = shipping_and_tax( order_token, order_reference ); 23 | check( shipping_response, { status_200: r => r.status == 200 } ) || errorRate.add(1); 24 | // pre-auth 25 | const preauth_response = create_order( order_token, order_reference ); 26 | check( preauth_response, { status_200: r => r.status == 200 } ) || errorRate.add(1); 27 | sleep(SLEEP); 28 | } 29 | else { 30 | console.log("Error on cart_data request: " + cart_page_response.body); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Test/Unit/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | coverage/ 3 | -------------------------------------------------------------------------------- /Test/Unit/Block/Adminhtml/Customer/CreditCard/Tab/View/CreditCardTest.php: -------------------------------------------------------------------------------- 1 | block = $this->createMock(CreditCard::class); 33 | } 34 | 35 | /** 36 | * @test 37 | */ 38 | public function _prepareColumns() 39 | { 40 | $this->block->expects(self::exactly(4)) 41 | ->method('addColumn') 42 | ->withAnyParameters() 43 | ->willReturnSelf(); 44 | 45 | $testMethod = new \ReflectionMethod(CreditCard::class, '_prepareColumns'); 46 | $testMethod->setAccessible(true); 47 | $testMethod->invokeArgs($this->block, []); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Test/Unit/Exception/BoltExceptionTest.php: -------------------------------------------------------------------------------- 1 | assertEquals($code, $exception->getCode()); 52 | $this->assertEquals($phrase, $exception->getMessage()); 53 | } 54 | 55 | public function provider_construct() 56 | { 57 | return [ 58 | ['test', null], 59 | ['test1', 1], 60 | ]; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Test/Unit/Helper/MetricTest.php: -------------------------------------------------------------------------------- 1 | '2222']; 27 | 28 | /** 29 | * @var \Bolt\Boltpay\Helper\Metric 30 | */ 31 | protected $metric; 32 | 33 | protected function setUpInternal() 34 | { 35 | $this->metric = new Metric(self::KEY, self::DATA); 36 | } 37 | 38 | /** 39 | * @test 40 | */ 41 | public function getMetricJson() 42 | { 43 | $this->assertEquals('{"key":{"value":"2222"}}', $this->metric->getMetricJson()); 44 | } 45 | 46 | /** 47 | * @test 48 | */ 49 | public function jsonSerialize() 50 | { 51 | $this->assertEquals(['key' => ['value' => '2222']], $this->metric->jsonSerialize()); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Test/Unit/Helper/SecretObscurerTest.php: -------------------------------------------------------------------------------- 1 | assertEquals('', SecretObscurer::obscure('')); 31 | } 32 | 33 | /** 34 | * @test 35 | */ 36 | public function obscure_short_string() 37 | { 38 | $this->assertEquals('***', SecretObscurer::obscure('abcde')); 39 | } 40 | 41 | /** 42 | * @test 43 | */ 44 | public function obscure_long_string() 45 | { 46 | $this->assertEquals('aaa***bbb', SecretObscurer::obscure('aaaabbbb')); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Test/Unit/Model/Api/Data/ShippingTaxTest.php: -------------------------------------------------------------------------------- 1 | shippingTax = new \Bolt\Boltpay\Model\Api\Data\ShippingTax; 38 | } 39 | 40 | /** 41 | * @test 42 | */ 43 | public function setAndGetAmount() 44 | { 45 | $this->shippingTax->setAmount(self::TAX_AMOUNT); 46 | $this->assertEquals(self::TAX_AMOUNT, $this->shippingTax->getAmount()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Test/Unit/Model/Api/_files/magento_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BoltApp/bolt-magento2/8c5f6eb34d1860217b466bf075b38cec94d1003f/Test/Unit/Model/Api/_files/magento_image.jpg -------------------------------------------------------------------------------- /Test/Unit/Model/ListenerMock.php: -------------------------------------------------------------------------------- 1 | methodCalled = true; 26 | } 27 | public function moduleDoesNotEnabled() 28 | { 29 | $this->methodCalled = true; 30 | } 31 | public function classDoesNotExist() 32 | { 33 | $this->methodCalled = true; 34 | } 35 | 36 | public function runFilter($result, $classInstance) 37 | { 38 | return ($classInstance instanceof \Bolt\Boltpay\Model\EventsForThirdPartyModules) && is_null($result); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Test/Unit/Model/ResourceModel/WebhookLogTest.php: -------------------------------------------------------------------------------- 1 | objectManager = Bootstrap::getObjectManager(); 42 | $this->webhookLog = $this->objectManager->create(WebhookLog::class); 43 | } 44 | 45 | /** 46 | * @test 47 | */ 48 | public function construct() 49 | { 50 | self::assertEquals('bolt_webhook_log', $this->webhookLog->getMainTable()); 51 | self::assertEquals('id', $this->webhookLog->getIdFieldName()); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Test/Unit/README.md: -------------------------------------------------------------------------------- 1 | ## Magento 2 Integration tests 2 | 3 | Unit test flow is deprecated. We are running all tests - magento unit and magento integration - in magento integration test flow 4 | 5 | ### Run integration tests locally 6 | 7 | Create dedicated database for running the test 8 | 9 | `CREATE DATABASE magento_integration_tests;` 10 | `GRANT ALL ON magento_integration_tests.* TO 'magento2_test_user'@'localhost' IDENTIFIED BY '';` 11 | 12 | Copy configuration file template `mage2ce/dev/tests/integration/etc/install-config-mysql.php.dist` to 'install-config-mysql.php' in the same directory and add your test database access credentials. 13 | 14 | Copy xml configuration file 15 | 16 | `cp app/code/Bolt/Boltpay/Test/Unit/integration_phpunit.xml dev/tests/integration/bolt_phpunit.xml` 17 | 18 | Run integration tests 19 | 20 | `cd dev/tests/integration/` 21 | `../../../vendor/bin/phpunit -c bolt_phpunit.xml` 22 | 23 | ### Notes: 24 | 1. Magento should be in developer mode. 25 | 2. When we run tests first time it works slowly because magento makes installation. 26 | 3. Change const TESTS_CLEANUP in file bolt_phpunit.xml to enabled when need to clean up. 27 | 28 | Additional infomation: 29 | https://devdocs.magento.com/guides/v2.4/test/integration/integration_test_execution.html 30 | -------------------------------------------------------------------------------- /Test/Unit/UnirgyMock.php: -------------------------------------------------------------------------------- 1 | 2 | DocumentRoot /home/circleci/magento 3 | 4 | Options FollowSymLinks 5 | AllowOverride All 6 | order allow,deny 7 | allow from all 8 | 9 | -------------------------------------------------------------------------------- /Test/scripts/apache2.conf: -------------------------------------------------------------------------------- 1 | 2 | Options Indexes FollowSymLinks Includes ExecCGI 3 | DirectoryIndex index.html index.php 4 | AllowOverride ALL 5 | Require all granted 6 | -------------------------------------------------------------------------------- /Test/scripts/ci-unit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -u 5 | set -x 6 | 7 | trap '>&2 echo Error: Command \`$BASH_COMMAND\` on line $LINENO failed with exit code $?' ERR 8 | 9 | Test/scripts/install_magento.sh 10 | 11 | cd .. 12 | mkdir -p magento/app/code/Bolt/Boltpay 13 | # magento requires the code to be in the magento installation dir 14 | # However if we copy codecov gets confused because of multiple sources. 15 | # So a quick fix is to keep a copy of the composer.json 16 | # TODO(roopakv): Initialize circle with the repo in the right place 17 | mv project/* magento/app/code/Bolt/Boltpay/ 18 | mkdir -p project 19 | cp magento/app/code/Bolt/Boltpay/composer.json project/composer.json 20 | cp magento/app/code/Bolt/Boltpay/Test/Unit/phpunit.xml magento/dev/tests/unit/bolt_phpunit.xml 21 | echo "Starting Bolt Unit Tests" 22 | XDEBUG_MODE=coverage php magento/vendor/phpunit/phpunit/phpunit -d memory_limit=5G --verbose -c magento/dev/tests/unit/bolt_phpunit.xml --coverage-clover=./artifacts/coverage.xml 23 | -------------------------------------------------------------------------------- /Test/scripts/phpcs_meqp2.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -u 5 | set -x 6 | 7 | composer show -i 8 | 9 | cd .. 10 | 11 | composer create-project magento/magento-coding-standard --stability=dev magento-coding-standard 12 | 13 | cd magento-coding-standard 14 | 15 | vendor/bin/phpcs ../project --standard=Magento2 --colors --severity=10 -p 16 | 17 | cd ../project 18 | export MAGENTO_VERSION="2.3.0" 19 | 20 | Test/scripts/install_magento.sh 21 | cd .. 22 | 23 | 24 | mkdir -p magento/app/code/Bolt/Boltpay 25 | mv project/.circleci/phpstan/* magento/app/code/Bolt/Boltpay/ 26 | mv project/* magento/app/code/Bolt/Boltpay/ 27 | cd magento 28 | 29 | # generate classes for phpstan 30 | php -dmemory_limit=5G bin/magento module:enable Bolt_Boltpay 31 | php -dmemory_limit=5G bin/magento setup:di:compile 32 | cd .. 33 | cd magento/app/code/Bolt/Boltpay 34 | wget https://github.com/phpstan/phpstan/releases/download/1.10.3/phpstan.phar 35 | chmod +x phpstan.phar 36 | 37 | # rename .mock files extension to .php 38 | MOCK_FILES=`find . -type f \( -name '*.mock' \)` 39 | for file in $MOCK_FILES 40 | do 41 | mv -- "$file" "${file%.mock}.php" 42 | done 43 | php -dmemory_limit=5G ./phpstan.phar analyse --level=0 --xdebug 44 | -------------------------------------------------------------------------------- /ThirdPartyModules/MageWorx/ShippingRules.php: -------------------------------------------------------------------------------- 1 | getRequest()->setParam('collect_shipping_rates', '1'); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ThirdPartyModules/Magento/SalesRuleStaging.php: -------------------------------------------------------------------------------- 1 | coreRegistry = $coreRegistry; 34 | } 35 | 36 | public function afterLoadSession($quote) 37 | { 38 | $this->coreRegistry->register('mp_shippingrestriction_cart', $quote->getBoltParentQuoteId()); 39 | $this->coreRegistry->register('mp_shippingrestriction_address', $quote->getShippingAddress()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | fixes: 2 | - "/home/circleci/magento/app/code/Bolt/Boltpay/::" 3 | - "magento/app/code/Bolt/Boltpay/::" 4 | - "./magento/app/code/Bolt/Boltpay/::" 5 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "boltpay/bolt-magento2", 3 | "description": "Bolt payment gateway integration", 4 | "require": { 5 | "magento/module-sales": "100.*|101.*|102.*|103.*", 6 | "magento/module-checkout": "100.*|101.*|102.*|103.*", 7 | "magento/module-payment": "100.*|101.*|102.*|103.*", 8 | "magento/module-tax": "100.*|101.*|102.*|103.*", 9 | "magento/framework": "100.*|101.*|102.*|103.*", 10 | "bugsnag/bugsnag": "^3.4" 11 | }, 12 | "require-dev": { 13 | "phpunit/phpunit": "~6.2.0", 14 | "mikey179/vfsstream": "^1.6", 15 | "magento/magento-coding-standard": "^5.0" 16 | }, 17 | "type": "magento2-module", 18 | "version": "2.27.7", 19 | "license": "MIT", 20 | "autoload": { 21 | "files": [ "registration.php" ], 22 | "psr-4": { 23 | "Bolt\\Boltpay\\": "" 24 | } 25 | }, 26 | "scripts": { 27 | "post-install-cmd": [ 28 | "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)" 29 | ], 30 | "post-update-cmd": [ 31 | "([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)" 32 | ] 33 | }, 34 | "repositories": [ 35 | { 36 | "type": "composer", 37 | "url": "https://repo.magento.com/" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /create_release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -le 0 ]; then 4 | echo "You must specify version number. \nExample: ./create_release.sh 2.14.0" 5 | exit -1 6 | fi 7 | 8 | rm -fr /tmp/bolt_magento_module 9 | 10 | mkdir /tmp/bolt_magento_module 11 | cp -r * /tmp/bolt_magento_module/. 12 | find /tmp/bolt_magento_module -name ".DS_Store" -type f -delete 13 | rm /tmp/bolt_magento_module/create_release.sh 14 | rm /tmp/bolt_magento_module/.gitignore 15 | rm /tmp/bolt_magento_module/.eslintignore 16 | rm /tmp/bolt_magento_module/.eslintrc.json 17 | rm /tmp/bolt_magento_module/*.zip 18 | rm -r /tmp/bolt_magento_module/Test 19 | rm -r /tmp/bolt_magento_module/docker-container 20 | 21 | current_dir=$(pwd) 22 | cd /tmp/bolt_magento_module 23 | zip -r boltpay_bolt-magento2-$1.zip * 24 | cp boltpay_bolt-magento2-$1.zip $current_dir/. 25 | 26 | echo "\n\nZip file boltpay_bolt-magento2-$1.zip created." -------------------------------------------------------------------------------- /docker-container/auth-format.py: -------------------------------------------------------------------------------- 1 | import json 2 | import sys 3 | 4 | """ 5 | This script formats the auth.json based off of the credentials provided in the config.sh 6 | """ 7 | 8 | data = { 9 | "http-basic": { 10 | "repo.magento.com": { 11 | "username": sys.argv[1], 12 | "password": sys.argv[2] 13 | } 14 | } 15 | } 16 | 17 | with open('auth.json', 'w') as outfile: 18 | json.dump(data, outfile, indent=4) -------------------------------------------------------------------------------- /docker-container/compose-format.py: -------------------------------------------------------------------------------- 1 | import json 2 | import sys 3 | """ 4 | This script adds the bolt repository dependencies to the compose file needed for installation 5 | """ 6 | 7 | 8 | data = {} 9 | with open('../../magento-cloud/composer.json') as json_file: 10 | data = json.load(json_file) 11 | repositories = [] 12 | try: 13 | composer = data["repositories"]["repo"] 14 | repositories.append(composer) 15 | except: 16 | repositories = data["repositories"] 17 | bolt_repo = {"type": sys.argv[3], "url": sys.argv[2]} 18 | if bolt_repo not in repositories: 19 | repositories.append(bolt_repo) 20 | data["repositories"] = repositories 21 | data["require"]["boltpay/bolt-magento2"] = sys.argv[1] 22 | 23 | with open('../../magento-cloud/composer.json', 'w') as outfile: 24 | json.dump(data, outfile, indent=4) -------------------------------------------------------------------------------- /docker-container/config.sh: -------------------------------------------------------------------------------- 1 | #VARIABLES 2 | m2Version="master" 3 | phpVersion="7.1" 4 | boltBranch="dev-develop" 5 | boltRepo="/Users/ewayda/Documents/GitHub/bolt-magento2" 6 | magentoCloudPublicKey="" 7 | magentoCloudPrivateKey="" 8 | buildCompose=true 9 | localRepo=false 10 | boltApiKey="" 11 | boltSigningSecret="" 12 | boltPublishableKey="" 13 | ngrokUrlHTTP="http://ethan-m2.ngrok.io/" 14 | ngrokUrlHTTPS="https://ethan-m2.ngrok.io/" 15 | installSampleData=true -------------------------------------------------------------------------------- /docker-container/configure-store.sh: -------------------------------------------------------------------------------- 1 | set -x 2 | source config.sh 3 | 4 | cd ../../magento-cloud 5 | 6 | # Creates Admin user for magento 7 | docker-compose run cron php bin/magento admin:user:create --admin-user=bolt --admin-password=admin123 --admin-email=dev@bolt.com --admin-firstname=admin --admin-lastname=admin 8 | 9 | # Sets up Bolt on the Magento 2 store 10 | docker-compose run cron php bin/magento config:set payment/boltpay/active 1 11 | docker-compose run cron php bin/magento config:set payment/boltpay/api_key $boltApiKey 12 | docker-compose run cron php bin/magento config:set payment/boltpay/signing_secret $boltSigningSecret 13 | docker-compose run cron php bin/magento config:set payment/boltpay/publishable_key_checkout $boltPublishableKey 14 | 15 | # Changes store url to the ngrok address 16 | docker-compose run cron php bin/magento config:set web/unsecure/base_url $ngrokUrlHTTP 17 | docker-compose run cron php bin/magento config:set web/secure/base_url $ngrokUrlHTTPS 18 | docker-compose run cron php bin/magento config:set web/unsecure/base_link_url $ngrokUrlHTTP 19 | docker-compose run cron php bin/magento config:set web/secure/base_link_url $ngrokUrlHTTPS 20 | docker-compose run cron php bin/magento cache:flush -------------------------------------------------------------------------------- /docker-container/docker-format.py: -------------------------------------------------------------------------------- 1 | import yaml 2 | import sys 3 | import re 4 | """ 5 | Edits docker-compose.yml to use containers based off of the specified php version 6 | """ 7 | data_map = {} 8 | 9 | with open('docker-compose.yml') as yml_file: 10 | data_map = yaml.safe_load(yml_file) 11 | new_php_version = sys.argv[1] 12 | fpm_image = data_map["services"]["fpm"]["image"] 13 | old_php_version = re.findall("\d+\.\d+", fpm_image)[0] 14 | data_map["services"]["fpm"]["image"] = data_map["services"]["fpm"]["image"].replace(old_php_version, new_php_version) 15 | data_map["services"]["build"]["image"] = data_map["services"]["build"]["image"].replace(old_php_version, new_php_version) 16 | data_map["services"]["deploy"]["image"] = data_map["services"]["deploy"]["image"].replace(old_php_version, new_php_version) 17 | data_map["services"]["cron"]["image"] = data_map["services"]["cron"]["image"].replace(old_php_version, new_php_version) 18 | data_map["services"]["cron"]["volumes"][1] = data_map["services"]["cron"]["volumes"][1][:-3] 19 | 20 | 21 | with open('docker-compose.yml', "w") as output_file: 22 | yaml.dump(data_map, output_file, default_flow_style=False) 23 | -------------------------------------------------------------------------------- /docker-container/install.sh: -------------------------------------------------------------------------------- 1 | # Initialize Magento2 Enviroment 2 | set -x 3 | source config.sh 4 | currentPhpVersion=$(php -v | head -n 1 | cut -d " " -f 2) 5 | if [[ $currentPhpVersion != *"7.0"* && $currentPhpVersion != *"7.1"* && $currentPhpVersion != *"7.2"* ]]; then 6 | brew update 7 | brew install php@7.2 8 | echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile 9 | source ~/.bash_profile 10 | fi 11 | rm -rf ../../magento-cloud/ 12 | git clone -b $m2Version https://github.com/magento/magento-cloud.git ../../magento-cloud 13 | python auth-format.py $magentoCloudPublicKey $magentoCloudPrivateKey 14 | cp auth.json ../../magento-cloud/ 15 | -------------------------------------------------------------------------------- /docker-container/launch-magento.sh: -------------------------------------------------------------------------------- 1 | # Create Docker Envrioment 2 | set -x 3 | source config.sh 4 | rm -rf ../../magento-cloud/bolt-magento2 5 | cp -R $boltRepo ../../magento-cloud/ 6 | if [ "$localRepo" = true ] ; then 7 | python compose-format.py "*@dev" "./bolt-magento2" "path" 8 | else 9 | python compose-format.py $boltBranch "./bolt-magento2" "vcs" 10 | fi 11 | cd ../../magento-cloud 12 | composer install 13 | if [ "$buildCompose" = true ] ; then 14 | yes | ./vendor/bin/ece-tools docker:build 15 | python bolt-magento2/docker-container/docker-format.py $phpVersion 16 | fi 17 | if [ "$installSampleData" = true ] ; then 18 | php -dmemory_limit=5G bin/magento sampledata:deploy 19 | fi 20 | cp docker/config.php.dist docker/config.php 21 | cp docker/global.php.dist docker/global.php 22 | ./vendor/bin/ece-tools docker:config:convert 23 | docker-compose down -v 24 | docker-compose up -d 25 | docker-compose run build cloud-build 26 | docker-compose run deploy cloud-deploy -------------------------------------------------------------------------------- /docker-container/m2-update.sh: -------------------------------------------------------------------------------- 1 | docker-compose down -v 2 | docker-compose up -d 3 | docker-compose run build cloud-build 4 | docker-compose run deploy cloud-deploy -------------------------------------------------------------------------------- /docker-container/php-init.sh: -------------------------------------------------------------------------------- 1 | brew update 2 | brew install php@7.2 3 | echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile 4 | source ~/.bash_profile -------------------------------------------------------------------------------- /etc/adminhtml/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /etc/adminhtml/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /etc/catalog_attributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /etc/crontab.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 0 * * * * 7 | 8 | 9 | 0 1 * * * 10 | 11 | 12 | 13 | 14 | payment/boltpay/catalog_ingestion_cron_expr 15 | 16 | 17 | 18 | 19 | 0 0 * * * 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /etc/extension_attributes.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /etc/frontend/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /etc/frontend/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /etc/integration/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | integrations@bolt.com 23 | https://api.bolt.com/v1/magento2/bolt-checkout/authorize 24 | https://status.bolt.com 25 | 26 | -------------------------------------------------------------------------------- /etc/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /operations/docker/README.md: -------------------------------------------------------------------------------- 1 | # Docker Images for CI 2 | 3 | In order to speed up our build pipeline, we pre-build the images we need with all the stuff pre-installed. The docker files for the images we use are in this directory. 4 | 5 | ## Updating an Image 6 | 7 | If you want add a dependency to one of these images you need update the image by following the steps below 8 | 9 | - Update the docker file corresponding to the image you are interested in. Let us assume php70 in this case 10 | - `cd operations/docker/php70` 11 | - `docker build -f Dockerfile . --tag bolt boltdev/m2-plugin-ci-php70:v2` 12 | Note: Make sure you update the version number to be one higher than what is currently be used in the circle yml 13 | - `docker push boltdev/m2-plugin-ci-php70:v2` 14 | Note: you need to be logged into docker with a user who has push rights to the dockerhub repo. 15 | - Update circle config yml to use the new image. 16 | -------------------------------------------------------------------------------- /operations/docker/php71/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile 2 | FROM circleci/php:7.1-apache-node-browsers-legacy 3 | 4 | USER root 5 | ENV LANG=C.UTF-8 6 | 7 | RUN cd /usr/local/etc/php/conf.d/ && echo 'memory_limit = -1' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini 8 | 9 | RUN MAGENTO_VERSION=2.2.8 10 | 11 | RUN apt-get update && apt-get -y install curl default-mysql-client libmcrypt-dev mcrypt libpng-dev libjpeg-dev libxml2-dev libxslt-dev 12 | RUN pecl channel-update pecl.php.net 13 | RUN pecl install zip && docker-php-ext-enable zip 14 | RUN docker-php-ext-enable xdebug 15 | RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ 16 | RUN docker-php-ext-install gd 17 | RUN docker-php-ext-install soap 18 | RUN docker-php-ext-install xsl 19 | RUN docker-php-ext-install mcrypt && docker-php-ext-enable mcrypt 20 | RUN docker-php-ext-install bcmath && docker-php-ext-enable bcmath 21 | RUN docker-php-ext-install pdo_mysql && docker-php-ext-enable pdo_mysql 22 | RUN composer self-update 1.4.1 23 | 24 | COPY auth.json /home/circleci/.composer/auth.json 25 | USER circleci 26 | WORKDIR /home/circleci 27 | RUN composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.2.8 magento/ 28 | WORKDIR /home/circleci/magento 29 | RUN composer install 30 | RUN composer require "bugsnag/bugsnag:^3.0" 31 | 32 | WORKDIR /home/circleci -------------------------------------------------------------------------------- /operations/docker/php71/auth-sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "http-basic":{ 3 | "repo.magento.com":{ 4 | "username":"", 5 | "password":"" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /operations/docker/php72/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile 2 | FROM circleci/php:7.2-apache-node-browsers-legacy 3 | 4 | USER root 5 | ENV LANG=C.UTF-8 6 | 7 | RUN MAGENTO_VERSION=2.3.0 8 | 9 | RUN apt-get update && apt-get -y install curl mysql-client libmcrypt-dev mcrypt libpng-dev libjpeg-dev libxml2-dev libxslt-dev 10 | RUN pecl channel-update pecl.php.net 11 | RUN pecl install zip && docker-php-ext-enable zip 12 | RUN docker-php-ext-enable xdebug 13 | RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/include/ 14 | RUN docker-php-ext-install gd 15 | RUN docker-php-ext-install soap 16 | RUN docker-php-ext-install xsl 17 | RUN apt-get install -y libmcrypt-dev 18 | RUN pecl install mcrypt-1.0.2 19 | RUN docker-php-ext-enable mcrypt 20 | RUN docker-php-ext-install bcmath && docker-php-ext-enable bcmath 21 | RUN docker-php-ext-install pdo_mysql && docker-php-ext-enable pdo_mysql 22 | RUN composer self-update -q 23 | 24 | COPY auth.json /home/circleci/.composer/auth.json 25 | USER circleci 26 | WORKDIR /home/circleci 27 | RUN composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.3.0 magento/ 28 | WORKDIR /home/circleci/magento 29 | RUN composer install 30 | RUN composer require "bugsnag/bugsnag:^3.0" 31 | 32 | WORKDIR /home/circleci -------------------------------------------------------------------------------- /operations/docker/php72/auth-sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "http-basic":{ 3 | "repo.magento.com":{ 4 | "username":"", 5 | "password":"" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /operations/docker/php72_integration/auth-sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "http-basic":{ 3 | "repo.magento.com":{ 4 | "username":"", 5 | "password":"" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /operations/docker/php74/auth-sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "http-basic":{ 3 | "repo.magento.com":{ 4 | "username":"", 5 | "password":"" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bolt-magento2", 3 | "dependencies": {}, 4 | "devDependencies": { 5 | "eslint": "^7.1.0", 6 | "eslint-plugin-exclude-php-tags": "0.0.1", 7 | "eslint-plugin-html": "^6.0.2", 8 | "husky": "^4.3.8" 9 | }, 10 | "scripts": { 11 | "pretest": "./node_modules/.bin/eslint --ignore-path .eslintignore --ext .js,.html,.phtml ." 12 | }, 13 | "husky": { 14 | "hooks": { 15 | "pre-commit": "echo 'Checking for ES5 compatibility' && npm run pretest", 16 | "post-commit": "echo 'All green ✅'" 17 | } 18 | }, 19 | "repository": { 20 | "type": "git", 21 | "url": "git+https://github.com/BoltApp/bolt-magento2.git" 22 | }, 23 | "keywords": [], 24 | "author": "", 25 | "license": "ISC", 26 | "bugs": { 27 | "url": "https://github.com/BoltApp/bolt-magento2/issues" 28 | }, 29 | "homepage": "https://github.com/BoltApp/bolt-magento2#readme" 30 | } 31 | -------------------------------------------------------------------------------- /phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Magento2 Coding Standard 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /registration.php: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /view/adminhtml/layout/boltpay_customer_creditcard.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /view/adminhtml/layout/customer_index_edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | 24 | 25 | Bolt Customer Credit Cards 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_create_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | boltpay 28 | Bolt_Boltpay::boltpay/button.phtml 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /view/adminhtml/layout/sales_order_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 30 | 31 | Bolt\Boltpay\ViewModel\OrderComment 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /view/adminhtml/requirejs-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bolt magento2 plugin 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @category Bolt 12 | * @package Bolt_Boltpay 13 | * @copyright Copyright (c) 2017-2023 Bolt Financial, Inc (https://www.bolt.com) 14 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 15 | */ 16 | 17 | var config = { 18 | 'shim': { 19 | 'es6-collections': [ 20 | 'Bolt_Boltpay/js/shims/es6-collections-shim', 21 | ], 22 | }, 23 | }; 24 | -------------------------------------------------------------------------------- /view/adminhtml/templates/boltpay/js/transaction.phtml: -------------------------------------------------------------------------------- 1 | isEnabled()) { return; 26 | } 27 | ?> 28 | 29 | 43 | renderTag('script', ['type' => 'text/javascript'], $scriptString, false) ?> -------------------------------------------------------------------------------- /view/adminhtml/templates/info/default.phtml: -------------------------------------------------------------------------------- 1 | getSpecificInformation(); 12 | $paymentTitle = $block->displayPaymentMethodTitle(); 13 | ?> 14 | escapeHtml($paymentTitle) ?> 15 | 16 | 17 | 18 | $value): ?> 19 | 20 | 21 | 24 | 25 | 26 |
escapeHtml($label) ?>: 22 | escapeHtml(implode("\n", $block->getValueAsArray($value, true)))) ?> 23 |
27 | 28 | 29 | getChildHtml() ?> 30 | -------------------------------------------------------------------------------- /view/adminhtml/templates/info/pdf/default.phtml: -------------------------------------------------------------------------------- 1 | 23 | escapeHtml($block->displayPaymentMethodTitle()) ?>{{pdf_row_separator}} 24 | 25 | getSpecificInformation()) : ?> 26 | $value) : ?> 27 | escapeHtml($label) ?>: 28 | escapeHtml(implode(' ', $block->getValueAsArray($value))) ?> 29 | {{pdf_row_separator}} 30 | 31 | 32 | 33 | escapeHtml(implode('{{pdf_row_separator}}', $block->getChildPdfAsArray())) ?> 34 | -------------------------------------------------------------------------------- /view/adminhtml/templates/js/replacejs-cart-api-driven.phtml: -------------------------------------------------------------------------------- 1 |  23 | 24 | getSettings()} 29 | } 30 | } 31 | } 32 | 33 | script; 34 | ?> 35 | renderTag('script', ['type' => 'text/x-magento-init'], $scriptString, false) ?> 36 | -------------------------------------------------------------------------------- /view/adminhtml/templates/order/comment.phtml: -------------------------------------------------------------------------------- 1 | getOrder(); 23 | /** @var \Bolt\Boltpay\ViewModel\OrderComment $orderCommentModel */ 24 | $orderCommentModel = $block->getOrderComment(); 25 | if (!$orderCommentModel->shouldDisplayForOrder($order)) { 26 | return; 27 | } 28 | ?> 29 |
30 |
31 | escapeHtml(__('Order Comment')) ?> 32 |
33 |
34 |
35 | escapeHtml($orderCommentModel->getCommentForOrder($order))); ?> 36 |
37 |
38 |
39 | -------------------------------------------------------------------------------- /view/adminhtml/web/js/shims/es6-collections-shim.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bolt magento2 plugin 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @category Bolt 12 | * @package Bolt_Boltpay 13 | * @copyright Copyright (c) 2017-2023 Bolt Financial, Inc (https://www.bolt.com) 14 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 15 | */ 16 | 17 | define([], function () { 18 | if (typeof window.isMapPolyfilled == 'undefined') { 19 | window.isMapPolyfilled = typeof Map == 'undefined' || typeof ((new Map).values) !== 'function' || !(new Map).values().next; 20 | } 21 | }); -------------------------------------------------------------------------------- /view/adminhtml/web/js/validation.js: -------------------------------------------------------------------------------- 1 | require([ 2 | 'jquery', 3 | 'mage/translate', 4 | 'jquery/validate'], 5 | function ($) { 6 | $.validator.addMethod( 7 | 'validate-color', function (v) { 8 | return v == "" || /^#[0-9A-F]{6}$/i.test(v); 9 | }, $.mage.__('Please enter hex color code like "#00cccc"') 10 | ); 11 | 12 | $.validator.addMethod( 13 | 'validate-custom-url-api', function (v) { 14 | return (v == "" || /^https?:\/\/([a-zA-Z0-9]+\.)?bolt.me\/?$/.test(v)); 15 | }, $.mage.__('Please enter custom url like "https://test.bolt.me"') 16 | ); 17 | } 18 | ); -------------------------------------------------------------------------------- /view/frontend/layout/boltpay_customer_creditcard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Credit Cards 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /view/frontend/layout/catalog_product_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /view/frontend/layout/catalog_product_view_type_bundle.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /view/frontend/layout/checkout_onepage_success.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /view/frontend/layout/customer_account.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | 25 | 26 | boltpay/customer/creditcard 27 | Credit Cards 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /view/frontend/layout/customer_account_create.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /view/frontend/layout/customer_account_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /view/frontend/layout/hyva_catalog_product_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /view/frontend/layout/hyva_catalog_product_view_type_bundle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /view/frontend/requirejs-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bolt magento2 plugin 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @category Bolt 12 | * @package Bolt_Boltpay 13 | * @copyright Copyright (c) 2017-2024 Bolt Financial, Inc (https://www.bolt.com) 14 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 15 | */ 16 | var config = { 17 | config: { 18 | mixins: { 19 | 'Magento_Reward/js/view/payment/reward': { 20 | 'Bolt_Boltpay/js/mixins/payment/reward': true 21 | } 22 | } 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /view/frontend/templates/authorization.phtml: -------------------------------------------------------------------------------- 1 | shouldDisableBoltCheckout()) { 26 | return; 27 | } 28 | if (!$block->isBoltSSOEnabled()) { 29 | return; 30 | } 31 | 32 | $accountJsUrl = $block->getAccountJsUrl(); 33 | $checkoutKey = $block->getCheckoutKey(); 34 | ?> 35 | 36 | 46 | -------------------------------------------------------------------------------- /view/frontend/templates/boltaccount.phtml: -------------------------------------------------------------------------------- 1 | shouldDisableBoltCheckout()) { 24 | return; 25 | } 26 | if (!$block->isOrderManagementEnabled()) { 27 | return; 28 | } 29 | // If CSS selector is set we want to insert button via frontend after this selector. 30 | if ($block->getOrderManagementSelector()) { 31 | return; 32 | } 33 | if ($block->isBlockAlreadyShown('account')) { 34 | return; 35 | } 36 | $accountJsUrl = $block->getAccountJsUrl(); 37 | $checkoutKey = $block->getCheckoutKey(); 38 | ?> 39 | 40 | 50 | -------------------------------------------------------------------------------- /view/frontend/templates/checkout/cart/discounts.phtml: -------------------------------------------------------------------------------- 1 | getViewModel(); 6 | $jsLayout = $cartDiscounts->getJsLayout(); 7 | if (!$jsLayout) { 8 | return; 9 | } 10 | ?> 11 |
14 | 15 | 22 |
23 | -------------------------------------------------------------------------------- /view/frontend/templates/checkout/success.phtml: -------------------------------------------------------------------------------- 1 | shouldDisableBoltCheckout()) { return; 20 | } 21 | ?> 22 | 23 | shouldTrackCheckoutFunnel()): ?> 24 | 27 | 28 | 40 | -------------------------------------------------------------------------------- /view/frontend/templates/customer/login.phtml: -------------------------------------------------------------------------------- 1 | shouldDisableBoltCheckout()) { 25 | return; 26 | } 27 | if (!$block->isBoltSSOEnabled()) { 28 | return; 29 | } 30 | 31 | ?> 32 | 33 | -------------------------------------------------------------------------------- /view/frontend/templates/customer/register.phtml: -------------------------------------------------------------------------------- 1 | shouldDisableBoltCheckout()) { 25 | return; 26 | } 27 | if (!$block->isBoltSSOEnabled()) { 28 | return; 29 | } 30 | 31 | ?> 32 | 33 | -------------------------------------------------------------------------------- /view/frontend/templates/info/default.phtml: -------------------------------------------------------------------------------- 1 | getSpecificInformation(); 12 | $paymentTitle = $block->displayPaymentMethodTitle(); 13 | $title = $block->escapeHtml($paymentTitle); 14 | ?> 15 |
16 |
17 | 18 |
19 | 20 | 21 | $value): ?> 22 | 23 | 24 | 29 | 30 | 31 |
escapeHtml($label) ?> 25 | escapeHtml(implode("\n", $block->getValueAsArray($value, true)))) 27 | ?> 28 |
32 |
33 | 34 |
35 | getChildHtml() ?> 36 | -------------------------------------------------------------------------------- /view/frontend/templates/js/checkout_funnel.js.phtml: -------------------------------------------------------------------------------- 1 | shouldDisableBoltCheckout()) { return; 23 | } 24 | if (!$block->shouldTrackCheckoutFunnel()) { return; 25 | } 26 | ?> 27 | 31 | renderTag('script', ['type' => 'text/x-magento-init'], $scriptString, false) ?> -------------------------------------------------------------------------------- /view/frontend/templates/js/custom_sso_buttons.phtml: -------------------------------------------------------------------------------- 1 | shouldDisableBoltCheckout()) { 25 | return; 26 | } 27 | 28 | if (!$block->isBoltSSOEnabled()) { 29 | return; 30 | } 31 | 32 | if (!$block->featureSwitches->isInitializeBoltCustomSsoButtons()) { 33 | return; 34 | } 35 | 36 | $customSSOSelectors = json_encode($block->getCustomSSOSelectors()); 37 | ?> 38 | 47 | -------------------------------------------------------------------------------- /view/frontend/templates/js/replacejs-cart-api-driven.phtml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 34 | renderTag('script', ['type' => 'text/x-magento-init'], $scriptString, false) ?> 35 | displayRewardPointsInMinicartConfig()): ?> 36 | renderTag('script', [], $scriptString, false) ?> 37 | 38 | -------------------------------------------------------------------------------- /view/frontend/templates/js/sso_button.phtml: -------------------------------------------------------------------------------- 1 | shouldDisableBoltCheckout()) { 25 | return; 26 | } 27 | if (!$block->isBoltSSOEnabled()) { 28 | return; 29 | } 30 | 31 | ?> 32 | 33 | 36 | -------------------------------------------------------------------------------- /view/frontend/templates/popup.phtml: -------------------------------------------------------------------------------- 1 | shouldDisableBoltCheckout()) { return; 25 | } 26 | ?> 27 | 30 | 50 | renderTag('style', [], $styles, false) ?> 51 | -------------------------------------------------------------------------------- /view/frontend/web/js/view/payment/boltpay.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bolt magento2 plugin 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @category Bolt 12 | * @package Bolt_Boltpay 13 | * @copyright Copyright (c) 2017-2023 Bolt Financial, Inc (https://www.bolt.com) 14 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 15 | */ 16 | 17 | /** 18 | * Bolt payment method register renderer 19 | */ 20 | define( 21 | [ 22 | 'uiComponent', 23 | 'Magento_Checkout/js/model/payment/renderer-list' 24 | ], 25 | function ( 26 | Component, 27 | rendererList 28 | ) { 29 | 'use strict'; 30 | rendererList.push( 31 | { 32 | type: 'boltpay', 33 | component: 'Bolt_Boltpay/js/view/payment/method-renderer/boltpay' 34 | } 35 | ); 36 | /** Add view logic here if needed */ 37 | return Component.extend({}); 38 | } 39 | ); 40 | -------------------------------------------------------------------------------- /view/frontend/web/js/view/popup.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Bolt magento2 plugin 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * 11 | * @category Bolt 12 | * @package Bolt_Boltpay 13 | * @copyright Copyright (c) 2017-2023 Bolt Financial, Inc (https://www.bolt.com) 14 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 15 | */ 16 | define([ 17 | 'jquery', 18 | 'Magento_Ui/js/modal/modal', 19 | 'mage/translate', 20 | 'jquery-ui-modules/widget' 21 | ], function ($, modal, $t) { 22 | 'use strict'; 23 | 24 | $.widget('bolt.popup', { 25 | options: { 26 | popupSelector: '#bolt-modal', 27 | }, 28 | 29 | /** @inheritdoc */ 30 | _create: function () { 31 | var options = { 32 | type: 'popup', 33 | responsive: true, 34 | innerScroll: true, 35 | modalClass: 'bolt-error-modal', 36 | title: '', 37 | buttons: [{ 38 | text: $t('Close'), 39 | class: 'bolt-error-close-button', 40 | click: function () { 41 | this.closeModal(); 42 | } 43 | }] 44 | }; 45 | modal(options, $(this.element)); 46 | }, 47 | }); 48 | 49 | return $.bolt.popup; 50 | }); 51 | -------------------------------------------------------------------------------- /view/frontend/web/template/third-party-modules/mageworx/reward-points/cart/rewardpoints.html: -------------------------------------------------------------------------------- 1 | 7 |
8 |
9 | 10 |
11 |
12 | 13 | 14 | 15 |
16 | 17 |
18 |
19 |
20 | 21 | 24 | 25 | 26 | 29 | 30 |
31 |
32 |
33 |
34 | --------------------------------------------------------------------------------