├── .github ├── ISSUE-TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── RELEASE-NOTES-TEMPLATE.md ├── data │ ├── master │ │ └── Dockerfile │ ├── php8 │ │ └── Dockerfile │ ├── stg │ │ └── Dockerfile │ └── test │ │ └── Dockerfile └── workflows │ ├── cd_master.yml │ ├── cd_reusable.yml │ ├── cd_stg.yml │ ├── cd_test.yml │ └── ci.yml ├── .gitignore ├── .phpcs.xml ├── Api ├── BaseRequestDataProviderInterface.php ├── BilletCreditCardRequestDataProviderInterface.php ├── BilletRequestDataProviderInterface.php ├── BulkApiInterface.php ├── BulkSingleResponseInterface.php ├── CardsManagementInterface.php ├── CardsRepositoryInterface.php ├── CartItemRequestDataProviderInterface.php ├── ChargeApiInterface.php ├── ChargesRepositoryInterface.php ├── CreditCardRequestDataProviderInterface.php ├── CustomerRepositoryInterface.php ├── Data │ ├── CardsInterface.php │ ├── CardsSearchResultsInterface.php │ ├── ChargesInterface.php │ ├── ChargesSearchResultsInterface.php │ ├── CustomerInterface.php │ ├── CustomerSearchResultsInterface.php │ ├── InstallmentInterface.php │ ├── RecurrencePriceInterface.php │ ├── RecurrenceProductsSubscriptionInterface.php │ ├── RecurrenceProductsSubscriptionSearchResultsInterface.php │ ├── RecurrenceSubscriptionRepetitionsInterface.php │ ├── RecurrenceSubscriptionRepetitionsSearchResultsInterface.php │ ├── SavedCardInterface.php │ └── SavedCardSearchResultsInterface.php ├── GooglePayRequestDataProviderInterface.php ├── HubCommandInterface.php ├── InstallmentsByBrandAndAmountManagementInterface.php ├── InstallmentsByBrandManagementInterface.php ├── InstallmentsManagementInterface.php ├── InvoiceApiInterface.php ├── KycLinkResponseInterface.php ├── MaintenanceInterface.php ├── ObjectMapper │ ├── ProductPlan │ │ ├── ProductPlanMapperInterface.php │ │ └── SubProduct.php │ └── ProductSubscription │ │ ├── ProductSubscriptionMapperInterface.php │ │ └── RepetitionInterface.php ├── PagarmeServiceApiInterface.php ├── PixRequestDataProviderInterface.php ├── ProductPlanApiInterface.php ├── ProductPlanInterface.php ├── ProductSubscriptionApiInterface.php ├── ProductSubscriptionInterface.php ├── RecipientInterface.php ├── RecurrenceProductsSubscriptionRepositoryInterface.php ├── RecurrenceSubscriptionRepetitionsRepositoryInterface.php ├── SavedCardRepositoryInterface.php ├── SubscriptionApiInterface.php ├── SystemInterface.php ├── TdsTokenInterface.php ├── TwoCreditCardRequestDataProviderInterface.php └── WebhookManagementInterface.php ├── Block ├── Adminhtml │ ├── Customer │ │ └── Cards.php │ ├── Form │ │ ├── Field │ │ │ ├── CreditCardPspField.php │ │ │ ├── EnableAdvanceSettings.php │ │ │ ├── GatewayField.php │ │ │ ├── InstallmentsNumber.php │ │ │ └── SoftDescriptor.php │ │ └── Fieldset │ │ │ ├── CreditCardGatewayFieldset.php │ │ │ └── CustomPaymentFieldset.php │ ├── Marketplace │ │ └── Recipient.php │ ├── Order │ │ └── Charge │ │ │ └── Tab │ │ │ └── View.php │ ├── Recurrence │ │ ├── Plans │ │ │ └── Plan.php │ │ └── Subscriptions │ │ │ └── Subscription.php │ └── System │ │ └── Config │ │ └── Form │ │ ├── Field │ │ ├── HubEnvironment.php │ │ ├── HubIntegration.php │ │ ├── MarketplaceMessage.php │ │ ├── ModuleVersion.php │ │ └── SearchRecipient.php │ │ └── Fieldset │ │ ├── CycleDiscount.php │ │ ├── Group.php │ │ └── Payment.php ├── BaseTemplateWithCurrency.php ├── Customer │ ├── Cards.php │ ├── Cards │ │ └── Container.php │ ├── Invoice.php │ ├── Marketplace │ │ └── Kyc.php │ └── Subscription.php ├── Form.php ├── Form │ └── CreditCard.php ├── Payment │ ├── Billet.php │ ├── Info │ │ ├── BaseCardInfo.php │ │ ├── Billet.php │ │ ├── BilletCreditCard.php │ │ ├── CreditCard.php │ │ ├── Debit.php │ │ ├── GooglePay.php │ │ ├── Pix.php │ │ ├── TwoCreditCard.php │ │ └── Voucher.php │ ├── Pix.php │ └── Tds.php └── Product │ └── View │ └── Price │ └── Recurrence.php ├── CONTRIBUTING.md ├── Concrete ├── Magento2CoreSetup.php ├── Magento2DataService.php ├── Magento2DatabaseDecorator.php ├── Magento2PlatformCreditmemoDecorator.php ├── Magento2PlatformCustomerDecorator.php ├── Magento2PlatformInvoiceDecorator.php ├── Magento2PlatformOrderDecorator.php ├── Magento2PlatformPaymentMethodDecorator.php ├── Magento2PlatformProductDecorator.php ├── Magento2SavedCardAdapter.php └── integrityData ├── Console ├── Command │ ├── MigrateExecute.php │ └── MigrateList.php └── MigrateData.php ├── Controller ├── Adminhtml │ ├── Cards │ │ └── Index.php │ ├── Charges │ │ ├── Cancel.php │ │ ├── Capture.php │ │ ├── ChargeAction.php │ │ └── Index.php │ ├── Hub │ │ └── Index.php │ ├── Invoices │ │ ├── Delete.php │ │ └── Index.php │ ├── Plans │ │ ├── Create.php │ │ ├── Delete.php │ │ ├── Index.php │ │ ├── PlanAction.php │ │ └── SearchProduct.php │ ├── Recipients │ │ ├── Create.php │ │ ├── Delete.php │ │ ├── Index.php │ │ └── RecipientAction.php │ ├── RecurrenceProducts │ │ ├── Create.php │ │ ├── Delete.php │ │ └── Index.php │ └── Subscriptions │ │ ├── Delete.php │ │ ├── Details.php │ │ └── Index.php ├── Cards │ └── Remove.php └── Customer │ ├── Cards.php │ ├── Invoice.php │ ├── Remove.php │ └── Subscription.php ├── Factories └── BulkSingleResponseFactory.php ├── Gateway └── Transaction │ ├── Base │ ├── Command │ │ ├── AbstractApiCommand.php │ │ ├── AuthorizeCommand.php │ │ └── InitializeCommand.php │ ├── Config │ │ ├── AbstractConfig.php │ │ ├── Config.php │ │ ├── ConfigInterface.php │ │ ├── CustomerConfigInterface.php │ │ └── TdsConfigInterface.php │ └── ResourceGateway │ │ ├── AbstractAddressDataProvider.php │ │ ├── AbstractRequestDataProvider.php │ │ ├── CartItemRequestDataProvider.php │ │ └── Response │ │ ├── AbstractHandler.php │ │ └── AbstractValidator.php │ ├── Billet │ ├── Command │ │ └── AuthorizeCommand.php │ ├── Config │ │ ├── Config.php │ │ └── ConfigInterface.php │ └── ResourceGateway │ │ └── Create │ │ ├── RequestDataProvider.php │ │ └── Response │ │ └── Validator.php │ ├── BilletCreditCard │ ├── Command │ │ ├── AuthorizeCommand.php │ │ ├── CaptureCommand.php │ │ └── RefundCommand.php │ ├── Config │ │ ├── Config.php │ │ └── ConfigInterface.php │ └── ResourceGateway │ │ ├── Capture │ │ └── Response │ │ │ └── Validator.php │ │ ├── Create │ │ ├── RequestDataProvider.php │ │ └── Response │ │ │ └── Validator.php │ │ └── Refund │ │ └── Response │ │ └── Validator.php │ ├── CreditCard │ ├── Command │ │ ├── AuthorizeCommand.php │ │ ├── CaptureCommand.php │ │ └── RefundCommand.php │ ├── Config │ │ ├── Config.php │ │ └── ConfigInterface.php │ └── ResourceGateway │ │ ├── Capture │ │ └── Response │ │ │ ├── GeneralHandler.php │ │ │ └── Validator.php │ │ ├── Create │ │ ├── RequestDataProvider.php │ │ └── Response │ │ │ └── Validator.php │ │ └── Refund │ │ └── Response │ │ ├── GeneralHandler.php │ │ └── Validator.php │ ├── DebitCard │ └── Config │ │ ├── Config.php │ │ └── ConfigInterface.php │ ├── GooglePay │ ├── Config │ │ ├── Config.php │ │ └── ConfigInterface.php │ └── Create │ │ ├── RequestDataProvider.php │ │ └── Response │ │ └── Validator.php │ ├── Pix │ └── ResourceGateway │ │ └── Create │ │ ├── RequestDataProvider.php │ │ └── Response │ │ └── Validator.php │ └── TwoCreditCard │ ├── Command │ ├── AuthorizeCommand.php │ ├── CaptureCommand.php │ └── RefundCommand.php │ ├── Config │ ├── Config.php │ └── ConfigInterface.php │ └── ResourceGateway │ ├── Capture │ └── Response │ │ └── Validator.php │ ├── Create │ ├── RequestDataProvider.php │ └── Response │ │ └── Validator.php │ └── Refund │ └── Response │ └── Validator.php ├── Helper ├── AbstractHelper.php ├── Adminhtml │ └── CheckoutHelper.php ├── BuildChargeAddtionalInformationHelper.php ├── Cards │ └── CreateCard.php ├── CustomerAddress.php ├── CustomerAddressInterface.php ├── CustomerCustomAttributesHelper.php ├── CustomerUpdatePagarmeHelper.php ├── Marketplace │ ├── Handlers │ │ ├── ExtrasAndDiscountsHandler.php │ │ ├── MarketplaceHandler.php │ │ └── SplitRemainderHandler.php │ ├── Traits │ │ ├── SplitExtrasAndDiscountsRuleTrait.php │ │ └── SplitRemainderRuleTrait.php │ └── WebkulHelper.php ├── ModuleHelper.php ├── MultiBuyerDataAssign.php ├── Payment │ ├── Billet.php │ └── Pix.php ├── Product │ └── Configuration │ │ └── Plugin │ │ └── Plan.php ├── ProductHelper.php ├── ProductPlanHelper.php ├── ProductSubscriptionHelper.php ├── RecurrenceProductHelper.php └── RulesCartRun.php ├── LICENSE ├── Makefile ├── Model ├── AbstractInstallmentManagement.php ├── Account.php ├── Api │ ├── Bulk.php │ ├── BulkSingleResponse.php │ ├── Charge.php │ ├── HubCommand.php │ ├── Invoice.php │ ├── KycLinkResponse.php │ ├── ProductsPlan.php │ ├── ProductsSubscription.php │ ├── Recipient.php │ ├── ResponseMessage.php │ └── Subscription.php ├── Cards.php ├── CardsRepository.php ├── Charges.php ├── ChargesRepository.php ├── ConfigNotification.php ├── CoreAuth.php ├── Customer.php ├── CustomerRepository.php ├── Enum │ ├── BankEnum.php │ ├── CountryEnum.php │ ├── CreditCardBrandEnum.php │ ├── CreditCardOperationEnum.php │ ├── DocumentTypeEnum.php │ └── PersonTypeEnum.php ├── Graphql │ └── PixDataProvider.php ├── Installment.php ├── Installments │ ├── Builder.php │ ├── BuilderByBrand.php │ ├── BuilderByBrandAndAmount.php │ └── Config │ │ ├── Config.php │ │ ├── ConfigByBrand.php │ │ ├── ConfigByBrandInterface.php │ │ └── ConfigInterface.php ├── InstallmentsByBrandAndAmountManagement.php ├── InstallmentsByBrandManagement.php ├── InstallmentsManagement.php ├── Invoices.php ├── Maintenance.php ├── Notifications.php ├── PagarmeConfigProvider.php ├── Payment.php ├── Product │ ├── OnlyPlanItem.php │ ├── ProductPlan │ │ ├── Cart │ │ │ └── Configuration │ │ │ │ └── Plugin │ │ │ │ └── Plan.php │ │ ├── CopyConstructor │ │ │ └── Plan.php │ │ ├── Initialization │ │ │ └── Helper │ │ │ │ └── ProductLinks │ │ │ │ └── Plugin │ │ │ │ └── Plan.php │ │ ├── Plan.php │ │ └── Type │ │ │ └── Plugin.php │ └── Recurrence.php ├── ProductsPlan.php ├── ProductsSubscription.php ├── Recipient.php ├── RecurrenceProductsSubscription.php ├── RecurrenceProductsSubscriptionRepository.php ├── RecurrenceSubscriptionRepetitions.php ├── RecurrenceSubscriptionRepetitionsRepository.php ├── ResourceModel │ ├── Cards.php │ ├── Cards │ │ └── Collection.php │ ├── Charges.php │ ├── Charges │ │ └── Collection.php │ ├── Customer.php │ ├── Customer │ │ └── Collection.php │ ├── Invoices.php │ ├── Invoices │ │ └── Collection.php │ ├── ProductsPlan.php │ ├── ProductsPlan │ │ └── Collection.php │ ├── ProductsSubscription.php │ ├── ProductsSubscription │ │ └── Collection.php │ ├── Recipients.php │ ├── Recipients │ │ └── Collection.php │ ├── RecurrenceProductsSubscription.php │ ├── RecurrenceProductsSubscription │ │ └── Collection.php │ ├── RecurrenceSubscriptionRepetitions.php │ ├── RecurrenceSubscriptionRepetitions │ │ └── Collection.php │ ├── SavedCard.php │ ├── SavedCard │ │ ├── Collection.php │ │ ├── CollectionFactory.php │ │ └── CollectionFactoryInterface.php │ ├── Subscriptions.php │ └── Subscriptions │ │ └── Collection.php ├── SavedCard.php ├── SavedCardRepository.php ├── Source │ ├── Bank.php │ ├── BilletTypes.php │ ├── Billing.php │ ├── BrandTypes.php │ ├── Cctype.php │ ├── CctypePSP.php │ ├── Debittype.php │ ├── DocumentType.php │ ├── EavBillingType.php │ ├── EavInterval.php │ ├── EavPaymentMethods.php │ ├── Interval.php │ ├── Marketplace │ │ └── Recipient.php │ ├── PaymentAction.php │ ├── PaymentMethods.php │ ├── Sequence.php │ ├── SequenceCriteria.php │ ├── Status │ │ ├── NewPending.php │ │ └── Review.php │ └── Vouchertype.php ├── Subscriptions.php ├── TdsToken.php ├── Ui │ ├── Base │ │ └── GenericInstallmentsConfigProvider.php │ ├── Billet │ │ └── ConfigProvider.php │ ├── BilletCreditCard │ │ ├── ConfigProvider.php │ │ └── InstallmentsConfigProvider.php │ ├── CreditCard │ │ ├── ConfigProvider.php │ │ └── InstallmentsConfigProvider.php │ ├── Debit │ │ └── ConfigProvider.php │ ├── GooglePay │ │ └── ConfigProvider.php │ ├── Pix │ │ └── ConfigProvider.php │ ├── TwoCreditCard │ │ ├── ConfigProvider.php │ │ └── InstallmentsConfigProvider.php │ └── Voucher │ │ └── ConfigProvider.php ├── Validation │ └── GenericValidation.php └── WebhookManagement.php ├── Observer ├── AdminCustomerBeforeSave.php ├── BilletCreditCardDataAssignObserver.php ├── BilletDataAssignObserver.php ├── CartAddProductAfterObserver.php ├── CreditCardDataAssignObserver.php ├── CreditCardOrderPlaceBeforeObserver.php ├── CustomerAddressSaveBefore.php ├── CustomerLogin.php ├── DashConfigValidatorObserver.php ├── DataValidateAdmin.php ├── DebitDataAssignObserver.php ├── GooglePayDataAssignObserver.php ├── HubIntegrationObserver.php ├── OrderCancelAfter.php ├── OrderPlaceBeforeObserver.php ├── PaymentMethodAvailable.php ├── PixDataAssignObserver.php ├── SalesOrderPlaceAfter.php ├── TwoCreditCardDataAssignObserver.php ├── UpdateProductPlanObserver.php └── VoucherDataAssignObserver.php ├── Plugin ├── Admin │ └── CustomerPlugin.php ├── Cart │ └── CartConflict.php ├── CatalogWidget │ └── Block │ │ └── Product │ │ └── ProductsList.php ├── Framework │ └── Webapi │ │ └── ServicePayloadConverterInterface.php ├── GraphQl │ └── PlaceOrder.php ├── Sales │ └── AdminOrder │ │ └── Product │ │ └── Quote │ │ └── Initializer.php └── Webapi │ └── RestResponse │ └── JsonPlugin.php ├── README.md ├── Service ├── AccountService.php ├── Client │ └── Api.php ├── Config │ ├── AbstractSystem.php │ ├── Path.php │ └── System.php ├── Customer │ └── CardsManagement.php ├── Data │ └── RecurrencePrice.php ├── Marketplace │ └── RecipientService.php ├── Order │ └── ChargeService.php └── Transaction │ ├── TdsTokenService.php │ └── ThreeDSService.php ├── Setup ├── InstallData.php ├── InstallSchema.php ├── UpgradeData.php └── UpgradeSchema.php ├── Test ├── .gitignore └── Unit │ ├── BaseTest.php │ ├── Block │ └── Adminhtml │ │ └── Marketplace │ │ └── RecipientTest.php │ ├── Controller │ └── Adminhtml │ │ └── Recipients │ │ └── CreateTest.php │ ├── Gateway │ └── Transaction │ │ └── GooglePay │ │ └── Config │ │ └── ConfigTest.php │ ├── Model │ ├── Api │ │ ├── RecipientTest.php │ │ └── SubscriptionTest.php │ └── WebhookManagementTest.php │ └── Service │ └── Transaction │ └── ThreeDSServiceTest.php ├── Ui ├── Component │ ├── Column │ │ ├── Actions.php │ │ ├── Invoices │ │ │ ├── Actions.php │ │ │ └── Boleto.php │ │ ├── RecipientActions.php │ │ └── Subscriptions │ │ │ └── Actions.php │ ├── Listing │ │ └── Column │ │ │ ├── BrazilCurrency.php │ │ │ └── Translate.php │ └── Recurrence │ │ └── Column │ │ ├── CreatedAt.php │ │ ├── CustomerName.php │ │ ├── Interval.php │ │ ├── PaymentMethodColumn.php │ │ ├── ProductRecurrenceName.php │ │ ├── RepetitionsColumn.php │ │ └── TotalCyclesByProduct.php └── DataProvider │ └── Product │ ├── Form │ └── Modifier │ │ └── Plan.php │ └── GroupedProductDataProvider.php ├── composer.json ├── e2e ├── .gitignore ├── Dockerfile ├── README.md ├── helper │ ├── checkout_helper.js │ ├── data_helper.js │ ├── pagarme_helper.js │ └── product_helper.js ├── package-lock.json ├── package.json ├── playwright.config.js └── tests │ └── cartao-de-credito.e2e.test.js ├── etc ├── _product_types.xml ├── acl.xml ├── adminhtml │ ├── di.xml │ ├── menu.xml │ ├── routes.xml │ ├── system.xml │ ├── system │ │ ├── antifraud.xml │ │ ├── customer-address.xml │ │ ├── global.xml │ │ ├── marketplace.xml │ │ ├── recurrence.xml │ │ └── transaction │ │ │ ├── billet.xml │ │ │ ├── creditcard.xml │ │ │ ├── creditcard │ │ │ ├── antifraud.xml │ │ │ ├── installments.xml │ │ │ ├── installments │ │ │ │ ├── amex.xml │ │ │ │ ├── aura.xml │ │ │ │ ├── banese.xml │ │ │ │ ├── cabal.xml │ │ │ │ ├── credz.xml │ │ │ │ ├── diners.xml │ │ │ │ ├── discover.xml │ │ │ │ ├── elo.xml │ │ │ │ ├── hipercard.xml │ │ │ │ ├── jcb.xml │ │ │ │ ├── mastercard.xml │ │ │ │ └── visa.xml │ │ │ └── tds.xml │ │ │ ├── debit.xml │ │ │ ├── googlepay.xml │ │ │ ├── multipleactionscreditcardbillet.xml │ │ │ ├── multipleactionstwocreditcard.xml │ │ │ ├── pix.xml │ │ │ └── voucher.xml │ └── ui_component │ │ └── plan_product_listing.xml ├── config.xml ├── csp_whitelist.xml ├── db_schema.xml ├── db_schema_whitelist.json ├── di.xml ├── events.xml ├── frontend │ ├── di.xml │ └── routes.xml ├── graphql │ └── di.xml ├── module.xml ├── payment.xml ├── schema.graphqls ├── webapi.xml ├── webapi_rest │ └── di.xml └── webapi_soap │ └── di.xml ├── i18n ├── en_US.csv └── pt_BR.csv ├── phpcs.xml.dist ├── phpmd.xml.dist ├── phpunit.xml ├── registration.php ├── sonar-project.properties └── view ├── adminhtml ├── layout │ ├── adminhtml_system_config_edit.xml │ ├── default.xml │ ├── pagarme_pagarme_cards_index.xml │ ├── pagarme_pagarme_charges_index.xml │ ├── pagarme_pagarme_invoices_index.xml │ ├── pagarme_pagarme_plans_create.xml │ ├── pagarme_pagarme_plans_index.xml │ ├── pagarme_pagarme_recipients_create.xml │ ├── pagarme_pagarme_recipients_index.xml │ ├── pagarme_pagarme_recurrenceproducts_create.xml │ ├── pagarme_pagarme_recurrenceproducts_index.xml │ ├── pagarme_pagarme_subscriptions_details.xml │ ├── pagarme_pagarme_subscriptions_index.xml │ ├── sales_order_create_index.xml │ ├── sales_order_create_load_block_billing_method.xml │ └── sales_order_view.xml ├── requirejs-config.js ├── templates │ ├── customer │ │ └── cards.phtml │ ├── form │ │ └── creditcard.phtml │ ├── info │ │ ├── billet.phtml │ │ ├── billetCreditCard.phtml │ │ ├── card.phtml │ │ ├── pix.phtml │ │ └── twoCreditCard.phtml │ ├── marketplace │ │ └── recipients │ │ │ └── create.phtml │ ├── payment │ │ └── info │ │ │ └── billet.phtml │ ├── recurrence │ │ ├── plans │ │ │ └── create.phtml │ │ └── subscriptions │ │ │ ├── create.phtml │ │ │ └── details.phtml │ └── tab │ │ └── view │ │ └── order_charge.phtml ├── ui_component │ ├── pagarme_pagarme_cards_index.xml │ ├── pagarme_pagarme_charges_index.xml │ ├── pagarme_pagarme_invoices_listing.xml │ ├── pagarme_pagarme_plans_listing.xml │ ├── pagarme_pagarme_recipients_listing.xml │ ├── pagarme_pagarme_recurrenceproducts_listing.xml │ └── pagarme_pagarme_subscriptions_listing.xml └── web │ ├── css │ ├── integration_buttons.css │ ├── menu.css │ ├── pagarme_order_create.css │ ├── pagarme_style.css │ ├── soft_description.css │ └── warnings.css │ ├── images │ ├── avatar-pagarme-white.svg │ └── avatar-pagarme.svg │ ├── js │ ├── core │ │ ├── checkout │ │ │ ├── CreditCardToken.js │ │ │ ├── CreditCardValidator.js │ │ │ ├── Listeners.js │ │ │ └── PlatformFormBiding.js │ │ └── models │ │ │ └── creditCardModel.js │ ├── global.js │ ├── grid │ │ └── columns │ │ │ └── recipientStatus.js │ ├── integrationType.js │ ├── mainRecipient.js │ ├── payment.js │ ├── recipients.js │ ├── recurrence.js │ └── view │ │ ├── form │ │ └── creditCard.js │ │ └── order │ │ └── orderCharge.js │ └── template │ └── ui │ └── grid │ └── cells │ └── recipientStatus.html ├── base ├── requirejs-config.js └── web │ ├── images │ ├── cc │ │ ├── Alelo.png │ │ ├── Amex.png │ │ ├── AndarAki.png │ │ ├── Aura.png │ │ ├── Banese.png │ │ ├── Cabal.png │ │ ├── CasaShow.png │ │ ├── Credz.png │ │ ├── Diners.png │ │ ├── Discover.png │ │ ├── Elo.png │ │ ├── Havan.png │ │ ├── HiperCard.png │ │ ├── Hipercard.png │ │ ├── HugCard.png │ │ ├── JCB2.png │ │ ├── LeaderCard.png │ │ ├── Mais.png │ │ ├── Mastercard.png │ │ ├── Paqueta.png │ │ ├── Pernambucanas.png │ │ ├── RennerCard.png │ │ ├── Senff.png │ │ ├── Sodexo.png │ │ ├── SodexoAlimentacao.png │ │ ├── SodexoCombustivel.png │ │ ├── SodexoCultura.png │ │ ├── SodexoGift.png │ │ ├── SodexoPremium.png │ │ ├── SodexoRefeicao.png │ │ ├── Ticket.png │ │ ├── VR.png │ │ ├── Visa.png │ │ ├── no-brand.png │ │ ├── sm.png │ │ └── so.png │ └── logo-pix.svg │ └── js │ ├── helper │ └── numberFormatter.js │ └── jquery.mask.min.js └── frontend ├── layout ├── catalog_product_view.xml ├── checkout_index_index.xml ├── checkout_onepage_success.xml ├── customer_account.xml ├── marketplace_account_dashboard.xml ├── pagarme_customer_cards.xml ├── pagarme_customer_invoice.xml ├── pagarme_customer_subscription.xml └── pagarme_pagarme_product_list.xml ├── requirejs-config.js ├── templates ├── customer │ ├── cards.phtml │ ├── invoice.phtml │ ├── marketplace │ │ └── kyc.phtml │ └── subscription.phtml ├── info │ ├── billet.phtml │ ├── billetCreditCard.phtml │ ├── card.phtml │ ├── pix.phtml │ └── twoCreditCard.phtml ├── payment │ ├── billet.phtml │ ├── pix.phtml │ └── tds.phtml └── product │ └── price │ └── recurrence.phtml └── web ├── css ├── pagarme_kyc.css ├── pagarme_style.css ├── pagarme_success_page.css └── pagarme_tds.css ├── js ├── action │ ├── installments.js │ ├── installmentsByBrand.js │ ├── installmentsByBrandAndAmount.js │ └── redirect-after-placeorder.js ├── core │ ├── checkout │ │ ├── Bin.js │ │ ├── CreditCardToken.js │ │ ├── FormObject.js │ │ ├── PaymentMethodController.js │ │ ├── PaymentModuleBootstrap.js │ │ ├── PlatformConfig.js │ │ ├── PlatformFormHandler.js │ │ ├── PlatformPlaceOrder.js │ │ └── Tds.js │ ├── models │ │ ├── BoletoCreditcardModel.js │ │ ├── BoletoModel.js │ │ ├── CreditCardModel.js │ │ ├── DebitModel.js │ │ ├── GooglePayModel.js │ │ ├── PixModel.js │ │ ├── TwoCreditcardsModel.js │ │ └── VoucherModel.js │ └── validators │ │ ├── CreditCardValidator.js │ │ ├── CustomerValidator.js │ │ ├── MultibuyerValidator.js │ │ └── VoucherCardValidator.js ├── helper │ └── address-helper.js ├── mixin │ └── billing-address-mixin.js ├── model │ └── credit-card-validation │ │ ├── credit-card-number-validator.js │ │ └── credit-card-number-validator │ │ └── credit-card-type.js └── view │ ├── marketplace │ └── kyc.js │ └── payment │ ├── boleto.js │ ├── boletocreditcard.js │ ├── checkout │ └── success │ │ └── pix.js │ ├── creditcard.js │ ├── debit.js │ ├── default.js │ ├── googlepay.js │ ├── payments.js │ ├── pix.js │ ├── twocreditcards.js │ └── voucher.js └── template └── payment ├── boleto-form.html ├── boleto.html ├── boletocreditcard.html ├── creditcard-form.html ├── creditcard.html ├── debit.html ├── default.html ├── googlepay.html ├── multibuyer-form.html ├── pix-form.html ├── pix.html ├── twocreditcards.html └── voucher.html /.github/ISSUE-TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ``` 2 | Please use the following template to submit your issue. 3 | Following this template will allow us to quickly investigate and help you with your issue. 4 | Please be aware that issues which do not conform to this template may be closed. 5 | 6 | DO NOT FORGET TO REMOVE THIS BLOCK 7 | ``` 8 | 9 | ### Status 10 | 11 | BUG REPORT / TASK 12 | 13 | ### Checklist 14 | 15 | Add checklist if this is a task 16 | 17 | - [x] Add slack integration 18 | - [_] Support xyz 19 | 20 | ### Steps 21 | 22 | 1. First step 23 | 2. Second step 24 | 3. Third step 25 | 26 | ### Expected behaviour 27 | 28 | How do you think the program should work? Add screenshots and code blocks if necessary. 29 | 30 | ### Actual behaviour 31 | 32 | How does the program work in its current state? 33 | 34 | ### Environment 35 | 36 | You may write here the specifications like the version of the project, services, operating system, or hardware if applicable. 37 | 38 | ### Logs / Stack trace 39 | 40 | ``` 41 | Insert your log/stack trace here 42 | ``` 43 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | | Questions | Answers 2 | | ------------- | ------------------------------------------------------- 3 | | **Issue** | https://mundipagg.atlassian.net/browse/MC-{ISSUE-NUMBER} 4 | | **What?** | Describe in an objective way what has been done. 5 | | **Why?** | Why do you need this implementation/fix? 6 | | **How?** | How did you solve the problem? What are the main flows? Any technical information regarding infrastructure or architecture? 7 | 8 | 9 | 10 | #### :package: Attachments (if appropriate) 11 | Add additional informations like screenshots, issue link, etc 12 | 13 | #### :speech_balloon: Important guidelines 14 | 15 | * Add pull request labels. 16 | * Check base branch. 17 | * Make sure [your local branch is up to date](https://help.github.com/articles/syncing-a-fork/) before commiting your changes! 18 | -------------------------------------------------------------------------------- /.github/RELEASE-NOTES-TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## :sparkles: New Features 2 | #### Feature 1 3 | Feature 1 description. 4 | 5 | #### Feature 2 6 | Feature 2 description. 7 | 8 | ## :bug: Bug fixes 9 | #### Bug 1 10 | Bug 1 description. 11 | 12 | #### Bug 2 13 | Bug 2 description. 14 | 15 | ## :rocket: Improvements 16 | #### Improvement 1 17 | Improvement 1 description. 18 | 19 | #### Improvement 2 20 | Improvement 2 description. -------------------------------------------------------------------------------- /.github/data/master/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bitnami/magento:2.4.5 2 | MAINTAINER Open Source Team 3 | 4 | ENV COMPOSER_ALLOW_SUPERUSER=1 5 | 6 | WORKDIR /opt/bitnami/magento 7 | ARG MAGENTO_KEY 8 | ARG MAGENTO_SECRET 9 | ARG MARKETPLACE_KEY 10 | ARG MARKETPLACE_SECRET 11 | ARG MARKETPLACE_REPO 12 | ARG MARKETPLACE_NAME 13 | ARG MARKETPLACE_VERSION 14 | ARG MARKETPLACE_REPO_URL 15 | 16 | RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} 17 | RUN composer require pagarme/pagarme-magento2-module:dev-master 18 | 19 | RUN apt update 20 | RUN apt install git -y 21 | 22 | RUN composer config -g repositories.marketplace_repo composer ${MARKETPLACE_REPO} 23 | RUN composer config -g http-basic.${MARKETPLACE_REPO_URL} ${MARKETPLACE_KEY} ${MARKETPLACE_SECRET} 24 | RUN composer require ${MARKETPLACE_NAME}:${MARKETPLACE_VERSION} -------------------------------------------------------------------------------- /.github/data/php8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bitnami/magento:2.4.5 2 | MAINTAINER Open Source Team 3 | 4 | ENV COMPOSER_ALLOW_SUPERUSER=1 5 | 6 | WORKDIR /opt/bitnami/magento 7 | ARG MAGENTO_KEY 8 | ARG MAGENTO_SECRET 9 | ARG MARKETPLACE_KEY 10 | ARG MARKETPLACE_SECRET 11 | ARG MARKETPLACE_REPO 12 | ARG MARKETPLACE_NAME 13 | ARG MARKETPLACE_VERSION 14 | ARG MARKETPLACE_REPO_URL 15 | RUN composer config minimum-stability dev 16 | RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} 17 | RUN composer require pagarme/pagarme-magento2-module:dev-stg 18 | 19 | RUN apt update 20 | RUN apt install git -y 21 | 22 | RUN composer config -g repositories.marketplace_repo composer ${MARKETPLACE_REPO} 23 | RUN composer config -g http-basic.${MARKETPLACE_REPO_URL} ${MARKETPLACE_KEY} ${MARKETPLACE_SECRET} 24 | RUN composer require ${MARKETPLACE_NAME}:${MARKETPLACE_VERSION} -------------------------------------------------------------------------------- /.github/data/stg/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bitnami/magento:2.4.3 2 | MAINTAINER Open Source Team 3 | 4 | ENV COMPOSER_ALLOW_SUPERUSER=1 5 | 6 | WORKDIR /opt/bitnami/magento 7 | ARG MAGENTO_KEY 8 | ARG MAGENTO_SECRET 9 | ARG MARKETPLACE_KEY 10 | ARG MARKETPLACE_SECRET 11 | ARG MARKETPLACE_REPO 12 | ARG MARKETPLACE_NAME 13 | ARG MARKETPLACE_VERSION 14 | ARG MARKETPLACE_REPO_URL 15 | RUN composer config minimum-stability dev 16 | RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} 17 | RUN composer require pagarme/pagarme-magento2-module:dev-stg 18 | 19 | RUN apt update 20 | RUN apt install git -y 21 | 22 | RUN composer config -g repositories.marketplace_repo composer ${MARKETPLACE_REPO} 23 | RUN composer config -g http-basic.${MARKETPLACE_REPO_URL} ${MARKETPLACE_KEY} ${MARKETPLACE_SECRET} 24 | RUN composer require ${MARKETPLACE_NAME}:${MARKETPLACE_VERSION} -------------------------------------------------------------------------------- /.github/data/test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM bitnami/magento:2.4.3 2 | MAINTAINER Open Source Team 3 | 4 | ENV COMPOSER_ALLOW_SUPERUSER=1 5 | 6 | WORKDIR /opt/bitnami/magento 7 | 8 | ARG MAGENTO_KEY 9 | ARG MAGENTO_SECRET 10 | 11 | RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} 12 | 13 | RUN composer require pagarme/pagarme-magento2-module:dev-test -------------------------------------------------------------------------------- /.github/workflows/cd_master.yml: -------------------------------------------------------------------------------- 1 | name: CD Master 2 | 3 | on: 4 | pull_request: 5 | branches: ["master"] 6 | types: closed 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.ref }} 9 | cancel-in-progress: true 10 | 11 | jobs: 12 | call-workflow-cd: 13 | uses: pagarme/magento2/.github/workflows/cd_reusable.yml@master 14 | with: 15 | matrix_tags: "['master']" 16 | secrets: 17 | inherit -------------------------------------------------------------------------------- /.github/workflows/cd_stg.yml: -------------------------------------------------------------------------------- 1 | name: CD STG AND PHP8 2 | 3 | on: 4 | pull_request: 5 | branches: ["stg"] 6 | types: closed 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.ref }} 9 | cancel-in-progress: true 10 | 11 | jobs: 12 | call-workflow-cd: 13 | uses: pagarme/magento2/.github/workflows/cd_reusable.yml@master 14 | with: 15 | matrix_tags: "['stg', 'php8']" 16 | secrets: 17 | inherit -------------------------------------------------------------------------------- /.github/workflows/cd_test.yml: -------------------------------------------------------------------------------- 1 | name: CD TEST 2 | 3 | on: 4 | pull_request: 5 | branches: ["develop"] 6 | types: closed 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.ref }} 9 | cancel-in-progress: true 10 | 11 | jobs: 12 | call-workflow-cd: 13 | uses: pagarme/magento2/.github/workflows/cd_reusable.yml@master 14 | with: 15 | matrix_tags: "['test']" 16 | secrets: 17 | inherit -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | /vendor/ 3 | *.lock 4 | -------------------------------------------------------------------------------- /.phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Generally-applicable sniffs for Pagar.me Gateway Module 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | ./Test/* 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Api/BilletRequestDataProviderInterface.php: -------------------------------------------------------------------------------- 1 | account = $account; 30 | } 31 | 32 | /** 33 | * @param AbstractElement $element 34 | * @return string 35 | */ 36 | public function render(AbstractElement $element) 37 | { 38 | if ($this->account->isGateway(PagarmeConfigProvider::CREDIT_CARD_PAYMENT_CONFIG)) { 39 | return ''; 40 | } 41 | 42 | return parent::render($element); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Block/Adminhtml/Form/Field/EnableAdvanceSettings.php: -------------------------------------------------------------------------------- 1 | getAccountId())) { 22 | return ''; 23 | } 24 | return parent::render($element); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Field/HubEnvironment.php: -------------------------------------------------------------------------------- 1 | getHubEnvironment(); 20 | 21 | return '' . $environment . ''; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Field/MarketplaceMessage.php: -------------------------------------------------------------------------------- 1 | moduleManager = $moduleManager; 19 | } 20 | 21 | 22 | /** 23 | * @param AbstractElement $element 24 | * @return string 25 | */ 26 | public function render(AbstractElement $element) 27 | { 28 | $html = ""; 29 | if(!$this->moduleManager->isEnabled("Webkul_Marketplace")){ 30 | $html = __("

You need to activate the " . 31 | "" . 32 | "Webkul Marketplace extension.

"); 33 | } 34 | return $html; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Field/ModuleVersion.php: -------------------------------------------------------------------------------- 1 | '; 23 | $html .= $this->_getElementHtml($element); 24 | $html .= "

{$versionService->getModuleVersion()}

"; 25 | $html .= ''; 26 | 27 | return $html; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Field/SearchRecipient.php: -------------------------------------------------------------------------------- 1 | '; 14 | $html .= $this->_getElementHtml($element); 15 | $html .= __('

Pagar.me recipient id that represents your marketplace

'); 16 | $html .= ''; 17 | $html .= ''; 18 | $html .= sprintf( 19 | '', 22 | $this->getSearchUrl(), 23 | __('Get info') 24 | ); 25 | $html .= ''; 26 | 27 | return $html; 28 | } 29 | 30 | protected function getSearchUrl(): string 31 | { 32 | return $this->getBaseUrl() . 'rest/V1/pagarme/marketplace/recipient/searchRecipient'; 33 | } 34 | 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Fieldset/CycleDiscount.php: -------------------------------------------------------------------------------- 1 | addColumn('cycle', ['label' => __('Cycle')]); 19 | $this->addColumn('discount', ['label' => __('(%)')]); 20 | $this->_addAfter = false; 21 | $this->_addButtonLabel = __('+'); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Block/BaseTemplateWithCurrency.php: -------------------------------------------------------------------------------- 1 | priceHelper = $priceHelper; 35 | } 36 | 37 | /** 38 | * @param mixed $number 39 | * @return float|string 40 | */ 41 | public function formatToCurrency($number) 42 | { 43 | return $this->priceHelper->currency(($number) / 100); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Block/Payment/Info/Debit.php: -------------------------------------------------------------------------------- 1 | setTemplate(self::TEMPLATE); 14 | } 15 | /** 16 | * @return mixed 17 | */ 18 | public function getTitle() 19 | { 20 | return $this->getInfo()->getAdditionalInformation('method_title'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Block/Payment/Info/GooglePay.php: -------------------------------------------------------------------------------- 1 | setTemplate(self::TEMPLATE); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Block/Payment/Info/Voucher.php: -------------------------------------------------------------------------------- 1 | resultPageFactory = $resultPageFactory; 22 | parent::__construct($context); 23 | } 24 | 25 | /** 26 | * Index action 27 | * 28 | * @return \Magento\Framework\Controller\ResultInterface 29 | */ 30 | public function execute() 31 | { 32 | $resultPage = $this->resultPageFactory->create(); 33 | $resultPage->getConfig()->getTitle()->prepend(__("Cards")); 34 | 35 | return $resultPage; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Charges/Index.php: -------------------------------------------------------------------------------- 1 | resultPageFactory = $resultPageFactory; 22 | parent::__construct($context); 23 | } 24 | 25 | /** 26 | * Index action 27 | * 28 | * @return \Magento\Framework\Controller\ResultInterface 29 | */ 30 | public function execute() 31 | { 32 | $resultPage = $this->resultPageFactory->create(); 33 | $resultPage->getConfig()->getTitle()->prepend(__("Charges")); 34 | 35 | return $resultPage; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Invoices/Index.php: -------------------------------------------------------------------------------- 1 | resultPageFactory = $resultPageFactory; 25 | } 26 | 27 | /** 28 | * Index action 29 | * 30 | * @return \Magento\Framework\Controller\ResultInterface 31 | */ 32 | public function execute() 33 | { 34 | $resultPage = $this->resultPageFactory->create(); 35 | $resultPage->getConfig()->getTitle()->prepend(__("Invoices")); 36 | 37 | return $resultPage; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Plans/Index.php: -------------------------------------------------------------------------------- 1 | resultPageFactory->create(); 17 | $resultPage->getConfig()->getTitle()->prepend(__("Plans")); 18 | 19 | return $resultPage; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Recipients/Index.php: -------------------------------------------------------------------------------- 1 | resultPageFactory = $resultPageFactory; 25 | parent::__construct($context); 26 | } 27 | 28 | /** 29 | * Index action 30 | * 31 | * @return ResultInterface 32 | */ 33 | public function execute() 34 | { 35 | $resultPage = $this->resultPageFactory->create(); 36 | $resultPage->getConfig()->getTitle()->prepend(__("Recipients")); 37 | 38 | return $resultPage; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Controller/Adminhtml/RecurrenceProducts/Index.php: -------------------------------------------------------------------------------- 1 | resultPageFactory = $resultPageFactory; 22 | parent::__construct($context); 23 | } 24 | 25 | /** 26 | * Index action 27 | * 28 | * @return \Magento\Framework\Controller\ResultInterface 29 | */ 30 | public function execute() 31 | { 32 | $resultPage = $this->resultPageFactory->create(); 33 | $resultPage->getConfig()->getTitle()->prepend(__("Recurrence Products")); 34 | 35 | return $resultPage; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Subscriptions/Index.php: -------------------------------------------------------------------------------- 1 | resultPageFactory = $resultPageFactory; 24 | parent::__construct($context); 25 | } 26 | 27 | /** 28 | * Index action 29 | * 30 | * @return \Magento\Framework\Controller\ResultInterface 31 | */ 32 | public function execute() 33 | { 34 | $resultPage = $this->resultPageFactory->create(); 35 | $resultPage->getConfig()->getTitle()->prepend(__("Subscriptions")); 36 | 37 | return $resultPage; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Controller/Customer/Subscription.php: -------------------------------------------------------------------------------- 1 | pageFactory = $pageFactory; 34 | $this->customerSession = $customerSession; 35 | } 36 | 37 | public function execute() 38 | { 39 | if (!$this->customerSession->isLoggedIn()) { 40 | $this->_redirect('customer/account/login'); 41 | return; 42 | } 43 | 44 | $result = $this->pageFactory->create(); 45 | $result->getConfig()->getTitle()->set("Subscription"); 46 | 47 | return $result; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Factories/BulkSingleResponseFactory.php: -------------------------------------------------------------------------------- 1 | getBody(), true); 13 | 14 | if (!is_array($body)) { 15 | $body = ['message' => $body]; 16 | } 17 | 18 | $bulkSingleResponse = new BulkSingleResponse; 19 | $bulkSingleResponse->setStatus($curlResponse->getStatus()); 20 | $bulkSingleResponse->setBody($body); 21 | return $bulkSingleResponse; 22 | } 23 | 24 | public function createFromArrayData(array $arrayData): BulkSingleResponse 25 | { 26 | $bulkSingleResponse = new BulkSingleResponse; 27 | $bulkSingleResponse->setStatus($arrayData['code']); 28 | $bulkSingleResponse->setBody(['message' => $arrayData['message']]); 29 | return $bulkSingleResponse; 30 | } 31 | } -------------------------------------------------------------------------------- /Gateway/Transaction/Base/Command/AuthorizeCommand.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/BilletCreditCard/Command/AuthorizeCommand.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/BilletCreditCard/ResourceGateway/Create/Response/Validator.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/BilletCreditCard/ResourceGateway/Refund/Response/Validator.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/CreditCard/Command/AuthorizeCommand.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/CreditCard/ResourceGateway/Create/Response/Validator.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/CreditCard/ResourceGateway/Refund/Response/Validator.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/GooglePay/Config/ConfigInterface.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/Pix/ResourceGateway/Create/Response/Validator.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/TwoCreditCard/Command/AuthorizeCommand.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/TwoCreditCard/ResourceGateway/Create/Response/Validator.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gateway/Transaction/TwoCreditCard/ResourceGateway/Refund/Response/Validator.php: -------------------------------------------------------------------------------- 1 | createResult($isValid, $fails); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Helper/AbstractHelper.php: -------------------------------------------------------------------------------- 1 | scopeConfig->getValue($path, $scopeType, $scopeCode); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Helper/CustomerAddress.php: -------------------------------------------------------------------------------- 1 | getConfigValue(static::PATH_STREET_ATTRIBUTE); 23 | } 24 | 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | public function getNumberAttribute() 29 | { 30 | return $this->getConfigValue(static::PATH_NUMBER_ATTRIBUTE); 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | */ 36 | public function getComplementAttribute() 37 | { 38 | return $this->getConfigValue(static::PATH_COMPLEMENT_ATTRIBUTE); 39 | } 40 | 41 | /** 42 | * {@inheritdoc} 43 | */ 44 | public function getDistrictAttribute() 45 | { 46 | return $this->getConfigValue(static::PATH_DISTRICT_ATTRIBUTE); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Helper/CustomerAddressInterface.php: -------------------------------------------------------------------------------- 1 | moduleConfig = Magento2CoreSetup::getModuleConfiguration(); 18 | } 19 | 20 | abstract protected function divideBetweenMarkeplaceAndSellers($amount, &$arrayData); 21 | abstract protected function divideBetweenSellers($amount, &$arrayData); 22 | abstract protected function onlyMarketplaceResponsible($amount, &$arrayData); 23 | } 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Pagar.me 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | sonar: 2 | docker run -ti -v $(shell pwd):/usr/src/ pagarme/sonar-scanner -Dsonar.branch.name=${BRANCH} 3 | .PHONY: sonar 4 | 5 | sonar-check-quality-gate: 6 | docker run -v $(shell pwd):/usr/src/sonar pagarme/check-sonar-quality-gate 7 | .PHONY: sonar-check-quality-gate 8 | -------------------------------------------------------------------------------- /Model/Api/BulkSingleResponse.php: -------------------------------------------------------------------------------- 1 | status = $status; 16 | return $this; 17 | } 18 | 19 | public function getStatus(): int 20 | { 21 | return $this->status; 22 | } 23 | 24 | public function setBody(array $body): BulkSingleResponse 25 | { 26 | $this->body = $body; 27 | return $this; 28 | } 29 | 30 | public function getBody(): array 31 | { 32 | return $this->body; 33 | } 34 | } -------------------------------------------------------------------------------- /Model/Api/KycLinkResponse.php: -------------------------------------------------------------------------------- 1 | _getData(self::DATA_URL); 13 | } 14 | 15 | public function getQrCode() 16 | { 17 | return $this->_getData(self::DATA_QR_CODE); 18 | } 19 | 20 | public function setUrl(string $url) 21 | { 22 | return $this->setData(self::DATA_URL, $url); 23 | } 24 | 25 | public function setQrCode(string $qrCode) 26 | { 27 | return $this->setData(self::DATA_QR_CODE, $qrCode); 28 | } 29 | } -------------------------------------------------------------------------------- /Model/Api/ResponseMessage.php: -------------------------------------------------------------------------------- 1 | message = $message; 13 | } 14 | 15 | /** 16 | * @return string 17 | */ 18 | public function getMessage() 19 | { 20 | return $this->message; 21 | } 22 | } -------------------------------------------------------------------------------- /Model/ConfigNotification.php: -------------------------------------------------------------------------------- 1 | get("\Magento\AdminNotification\Model\Inbox"); 14 | $lastNotify = $messageManager->loadLatestNotice(); 15 | if ($lastNotify->getDescription() != $error->getMessage()){ 16 | $messageManager->addCritical("Pagar.me - Há configurações incorretas", $error->getMessage()); 17 | $this->addLog($error); 18 | } 19 | } 20 | 21 | private function addLog($logMessage) 22 | { 23 | $logService = new LogService( 24 | 'Config', 25 | true 26 | ); 27 | 28 | $logService->exception($logMessage); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Model/CoreAuth.php: -------------------------------------------------------------------------------- 1 | get(\Pagarme\Pagarme\Gateway\Transaction\Base\Config\Config::class); 15 | return $config->getSecretKey(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Model/Enum/BankEnum.php: -------------------------------------------------------------------------------- 1 | _init('Pagarme\Pagarme\Model\ResourceModel\Invoices'); 13 | } 14 | 15 | /** 16 | * Return unique ID(s) for each object in system 17 | * 18 | * @return string[] 19 | */ 20 | public function getIdentities() 21 | { 22 | return $this->getId(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Model/Maintenance.php: -------------------------------------------------------------------------------- 1 | buildInfoFromQueryArray($coreParams); 35 | 36 | $response = $info; 37 | if (is_array($info)) { 38 | $response = json_encode($info, JSON_PRETTY_PRINT); 39 | } 40 | 41 | echo $response; 42 | 43 | die(0); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Model/Product/OnlyPlanItem.php: -------------------------------------------------------------------------------- 1 | getTypeId() == \Pagarme\Pagarme\Model\Product\ProductPlan\Plan::TYPE_CODE) { 30 | return isset($config['super_group']); 31 | } 32 | 33 | return $proceed($product, $config); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Model/Product/ProductPlan/Type/Plugin.php: -------------------------------------------------------------------------------- 1 | moduleManager = $moduleManager; 24 | } 25 | 26 | /** 27 | * Remove grouped product from list of visible product types 28 | * 29 | * @param \Magento\Catalog\Model\Product\Type $subject 30 | * @param array $result 31 | * 32 | * @return array 33 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) 34 | */ 35 | public function afterGetOptionArray(\Magento\Catalog\Model\Product\Type $subject, array $result) 36 | { 37 | if (!$this->moduleManager->isOutputEnabled('Magento_GroupedProduct')) { 38 | unset($result[Grouped::TYPE_CODE]); 39 | } 40 | return $result; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Model/Product/Recurrence.php: -------------------------------------------------------------------------------- 1 | _init('Pagarme\Pagarme\Model\ResourceModel\ProductsPlan'); 13 | } 14 | 15 | /** 16 | * Return unique ID(s) for each object in system 17 | * 18 | * @return string[] 19 | */ 20 | public function getIdentities() 21 | { 22 | return $this->getId(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Model/ProductsSubscription.php: -------------------------------------------------------------------------------- 1 | _init('Pagarme\Pagarme\Model\ResourceModel\ProductsSubscription'); 13 | } 14 | 15 | /** 16 | * Return unique ID(s) for each object in system 17 | * 18 | * @return string[] 19 | */ 20 | public function getIdentities() 21 | { 22 | return $this->getId(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Model/Recipient.php: -------------------------------------------------------------------------------- 1 | _init('Pagarme\Pagarme\Model\ResourceModel\Recipients'); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Model/ResourceModel/Cards.php: -------------------------------------------------------------------------------- 1 | _init('pagarme_pagarme_cards', 'id'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Model/ResourceModel/Cards/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 17 | 'Pagarme\Pagarme\Model\Cards', 18 | 'Pagarme\Pagarme\Model\ResourceModel\Cards' 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Model/ResourceModel/Charges.php: -------------------------------------------------------------------------------- 1 | _init('pagarme_module_core_charge', 'id'); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Model/ResourceModel/Charges/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 17 | 'Pagarme\Pagarme\Model\Charges', 18 | 'Pagarme\Pagarme\Model\ResourceModel\Charges' 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Model/ResourceModel/Customer.php: -------------------------------------------------------------------------------- 1 | _init(self::TABLE, self::ENTITY_ID); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/ResourceModel/Customer/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 32 | \Pagarme\Pagarme\Model\Customer::class, 33 | \Pagarme\Pagarme\Model\ResourceModel\Customer::class 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/ResourceModel/Invoices.php: -------------------------------------------------------------------------------- 1 | _init('pagarme_module_core_recurrence_charge', 'id'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Model/ResourceModel/ProductsPlan.php: -------------------------------------------------------------------------------- 1 | _init('pagarme_module_core_products_plan', 'id'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Model/ResourceModel/ProductsPlan/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 19 | 'Pagarme\Pagarme\Model\ProductsPlan', 20 | 'Pagarme\Pagarme\Model\ResourceModel\ProductsPlan' 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Model/ResourceModel/ProductsSubscription.php: -------------------------------------------------------------------------------- 1 | _init('pagarme_module_core_products_subscription', 'id'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Model/ResourceModel/ProductsSubscription/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 19 | 'Pagarme\Pagarme\Model\ProductsSubscription', 20 | 'Pagarme\Pagarme\Model\ResourceModel\ProductsSubscription' 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Model/ResourceModel/Recipients.php: -------------------------------------------------------------------------------- 1 | _init('pagarme_module_core_recipients', 'id'); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Model/ResourceModel/Recipients/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 19 | 'Pagarme\Pagarme\Model\Recipient', 20 | 'Pagarme\Pagarme\Model\ResourceModel\Recipients' 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Model/ResourceModel/RecurrenceProductsSubscription.php: -------------------------------------------------------------------------------- 1 | _init(self::TABLE, self::ENTITY_ID); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/ResourceModel/RecurrenceProductsSubscription/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 32 | \Pagarme\Pagarme\Model\RecurrenceProductsSubscription::class, 33 | \Pagarme\Pagarme\Model\ResourceModel\RecurrenceProductsSubscription::class 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/ResourceModel/RecurrenceSubscriptionRepetitions.php: -------------------------------------------------------------------------------- 1 | _init(self::TABLE, self::ENTITY_ID); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/ResourceModel/RecurrenceSubscriptionRepetitions/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 32 | \Pagarme\Pagarme\Model\RecurrenceSubscriptionRepetitions::class, 33 | \Pagarme\Pagarme\Model\ResourceModel\RecurrenceSubscriptionRepetitions::class 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/ResourceModel/SavedCard.php: -------------------------------------------------------------------------------- 1 | _init(self::TABLE, self::ENTITY_ID); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/ResourceModel/SavedCard/Collection.php: -------------------------------------------------------------------------------- 1 | _init( 32 | \Pagarme\Pagarme\Model\SavedCard::class, 33 | \Pagarme\Pagarme\Model\ResourceModel\SavedCard::class 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/ResourceModel/SavedCard/CollectionFactoryInterface.php: -------------------------------------------------------------------------------- 1 | _init('pagarme_module_core_recurrence_subscription', 'id'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Model/ResourceModel/Subscriptions/Collection.php: -------------------------------------------------------------------------------- 1 | getAllOptions(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Model/Source/BrandTypes.php: -------------------------------------------------------------------------------- 1 | 'individual', 14 | 'label' => __('CPF'), 15 | ], 16 | [ 17 | 'value' => 'company', 18 | 'label' => __('CNPJ') 19 | ], 20 | ]; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Model/Source/Interval.php: -------------------------------------------------------------------------------- 1 | getAllOptions(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /Model/Source/Marketplace/Recipient.php: -------------------------------------------------------------------------------- 1 | 'marketplace_sellers', 14 | 'label' => __('Marketplace and Sellers'), 15 | ], 16 | [ 17 | 'value' => 'marketplace', 18 | 'label' => __('Marketplace') 19 | ], 20 | [ 21 | 'value' => 'sellers', 22 | 'label' => __('Sellers') 23 | ] 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Model/Source/PaymentAction.php: -------------------------------------------------------------------------------- 1 | 'authorize', 24 | 'label' => __('Authorize Only'), 25 | ], 26 | [ 27 | 'value' => 'authorize_capture', 28 | 'label' => __('Authorize and Capture') 29 | ] 30 | ]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Model/Source/PaymentMethods.php: -------------------------------------------------------------------------------- 1 | getAllOptions(); 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Model/Source/Sequence.php: -------------------------------------------------------------------------------- 1 | 'AnalyseFirst', 25 | 'label' => __('Analyse First'), 26 | ], 27 | [ 28 | 'value' => 'AuthorizeFirst', 29 | 'label' => __('Authorize First') 30 | ] 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Model/Source/SequenceCriteria.php: -------------------------------------------------------------------------------- 1 | 'OnSuccess', 25 | 'label' => __('On Success'), 26 | ], 27 | [ 28 | 'value' => 'AuthorizeFirst', 29 | 'label' => __('Always') 30 | ] 31 | ]; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Model/Source/Status/NewPending.php: -------------------------------------------------------------------------------- 1 | _init('Pagarme\Pagarme\Model\ResourceModel\Subscriptions'); 13 | } 14 | 15 | /** 16 | * Return unique ID(s) for each object in system 17 | * 18 | * @return string[] 19 | */ 20 | public function getIdentities() 21 | { 22 | return $this->getId(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Model/TdsToken.php: -------------------------------------------------------------------------------- 1 | pagarmeConfig = $pagarmeConfig; 27 | $this->tdsTokenService = $tdsTokenService; 28 | } 29 | public function getToken() 30 | { 31 | $accountId = $this->pagarmeConfig->getAccountId(); 32 | if (empty($accountId)) { 33 | return []; 34 | } 35 | return $this->tdsTokenService->getTdsToken($accountId); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Model/Ui/BilletCreditCard/InstallmentsConfigProvider.php: -------------------------------------------------------------------------------- 1 | googlePayConfig = $googlePayConfig; 22 | } 23 | 24 | public function getConfig() 25 | { 26 | return [ 27 | 'payment' => [ 28 | self::CODE => [ 29 | 'active' => true, 30 | 'title' => $this->googlePayConfig->getTitle(), 31 | 'merchantId' => $this->googlePayConfig->getMerchantId(), 32 | 'merchantName' => $this->googlePayConfig->getMerchantName(), 33 | 'cardBrands' => $this->googlePayConfig->getCardBrands() 34 | ] 35 | ] 36 | ]; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Model/Ui/TwoCreditCard/InstallmentsConfigProvider.php: -------------------------------------------------------------------------------- 1 | readMethodArgument($observer); 26 | $info = $method->getInfoInstance(); 27 | $data = $this->readDataArgument($observer); 28 | 29 | $additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA); 30 | 31 | if (!is_object($additionalData)) { 32 | $additionalData = new DataObject($additionalData ?: []); 33 | } 34 | $multiBuyerDataAssign = new MultiBuyerDataAssign(); 35 | $multiBuyerDataAssign->setBilletMultiBuyer($info, $additionalData); 36 | 37 | return $this; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Observer/GooglePayDataAssignObserver.php: -------------------------------------------------------------------------------- 1 | readMethodArgument($observer); 15 | $info = $method->getInfoInstance(); 16 | $data = $this->readDataArgument($observer); 17 | 18 | $additionalData = $data->getData(PaymentInterface::KEY_ADDITIONAL_DATA); 19 | 20 | if (!is_object($additionalData)) { 21 | $additionalData = new DataObject($additionalData ?: []); 22 | } 23 | 24 | $info->setAdditionalInformation('googlepayData', $additionalData->getData('googlepayData')); 25 | 26 | return $this; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugin/Webapi/RestResponse/JsonPlugin.php: -------------------------------------------------------------------------------- 1 | request = $request; 22 | } 23 | 24 | /** 25 | * @param Json $jsonRenderer 26 | * @param callable $proceed 27 | * @param $data 28 | * @return mixed 29 | */ 30 | public function aroundRender(Json $jsonRenderer, callable $proceed, $data) 31 | { 32 | if ($this->request->getPathInfo() == "/V1/pagarme/recurrence/plan/product") { 33 | return json_encode($data); 34 | } 35 | return $proceed($data); 36 | } 37 | 38 | /** 39 | * @param $data 40 | * @return bool 41 | */ 42 | private function isJson($data) 43 | { 44 | if (!is_string($data)) { 45 | return false; 46 | } 47 | json_decode($data); 48 | return (json_last_error() == JSON_ERROR_NONE); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Service/Marketplace/RecipientService.php: -------------------------------------------------------------------------------- 1 | coreAuth = new CoreAuth(); 19 | } 20 | 21 | public function createRecipient($recipient) 22 | { 23 | $recipientProxy = new RecipientProxy($this->coreAuth); 24 | return $recipientProxy->create($recipient); 25 | } 26 | 27 | public function searchRecipient($recipientId) 28 | { 29 | $recipientProxy = new RecipientProxy($this->coreAuth); 30 | $recipient = $recipientProxy->getFromPagarme($recipientId); 31 | $kycStatus = $recipient->kyc_details->status ?? ''; 32 | $recipient->status = Recipient::parseStatus($recipient->status, $kycStatus); 33 | return $recipient; 34 | } 35 | 36 | public function createKycLink($recipientId) 37 | { 38 | $recipientProxy = new RecipientProxy($this->coreAuth); 39 | return $recipientProxy->createKycLink($recipientId); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Service/Order/ChargeService.php: -------------------------------------------------------------------------------- 1 | findByPlatformId($incrementId); 22 | 23 | if ($order === null) { 24 | return []; 25 | } 26 | 27 | $chargeRepository = new ChargeRepository(); 28 | return $chargeRepository->findByOrderId( 29 | new OrderId($order->getPagarmeId()->getValue()) 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Service/Transaction/TdsTokenService.php: -------------------------------------------------------------------------------- 1 | coreAuth = new CoreAuth(''); 25 | $this->config = $config; 26 | } 27 | 28 | public function getTdsToken($accountId) 29 | { 30 | $tdsTokenProxy = new TdsTokenProxy($this->coreAuth); 31 | $environment = 'live'; 32 | if ($this->config->isSandboxMode()) { 33 | $environment = 'test'; 34 | } 35 | return $tdsTokenProxy->getTdsToken($environment, $accountId)->tdsToken; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Test/.gitignore: -------------------------------------------------------------------------------- 1 | /output/ 2 | /scripts/ 3 | /Test/log/ 4 | /Test/clover.xml -------------------------------------------------------------------------------- /Test/Unit/BaseTest.php: -------------------------------------------------------------------------------- 1 | getData('name'); 29 | foreach ($dataSource['data']['items'] as &$item) { 30 | $item[$fieldName] = $numberFormatter->format(($item[$fieldName]) / 100); 31 | } 32 | 33 | return $dataSource; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Ui/Component/Recurrence/Column/CreatedAt.php: -------------------------------------------------------------------------------- 1 | getData('name'); 27 | foreach ($dataSource['data']['items'] as &$item) { 28 | $item['created_at'] = $this->formatDate($item['created_at']) ; 29 | } 30 | 31 | return $dataSource; 32 | } 33 | 34 | private function formatDate($item) 35 | { 36 | $date = new \DateTime($item); 37 | return $date->format('d/m/Y H:i:s'); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /e2e/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/playwright:v1.31.0-focal 2 | 3 | COPY . /e2e 4 | 5 | WORKDIR /e2e 6 | 7 | RUN npm install 8 | RUN npx playwright install --with-deps 9 | 10 | CMD [ "npx", "playwright", "test"] 11 | -------------------------------------------------------------------------------- /e2e/helper/product_helper.js: -------------------------------------------------------------------------------- 1 | 2 | const searchProduct = async (page, productName) => { 3 | await page.click('#search') 4 | await page.type('#search', productName) 5 | await page.locator('#search').press('Enter'); 6 | 7 | } 8 | 9 | const selectProduct = async page => { 10 | await page.click('.product-item-info') 11 | } 12 | 13 | const addToCart = async page => { 14 | await page.click('#product-addtocart-button') 15 | } 16 | 17 | const proceedCheckout = async page => { 18 | await page.waitForTimeout(2000); //ninguem gosta disso, imagina ter que usar ne? 19 | await page.click('.counter:nth-child(2)') 20 | await page.waitForTimeout(1000); //ninguem gosta disso, imagina ter que usar ne? 21 | await page.click('#top-cart-btn-checkout') 22 | } 23 | 24 | module.exports = { 25 | searchProduct, 26 | selectProduct, 27 | addToCart, 28 | proceedCheckout 29 | } 30 | -------------------------------------------------------------------------------- /e2e/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "playwright-magento2-e2e", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "author": "Ramses Almeida ", 6 | "license": "MIT", 7 | "private": false, 8 | "devDependencies": { 9 | "@playwright/test": "1.29.2", 10 | "allure-commandline": "2.20.1", 11 | "allure-playwright": "2.0.0-beta.24", 12 | "eslint": "8.32.0", 13 | "eslint-plugin-playwright": "0.12.0", 14 | "expect-playwright": "0.8.0", 15 | "playwright": "1.29.2", 16 | "@faker-js/faker": "7.6.0", 17 | "wait-on": "7.0.1" 18 | }, 19 | "scripts": { 20 | "allure:generate": "npx allure generate ./allure-results --clean -o allure-report", 21 | "allure:history": "mv -f allure-report/history allure-results/history && rm -r allure-report || true", 22 | "allure:open": "npx playwright show-report allure-report", 23 | "test:e2e": "npx playwright test --project e2e --config playwright.config.js", 24 | "test:e2e:headed": "npx playwright test --project e2e --config playwright.config.js --headed", 25 | "test:e2e:ci": "npx test:e2e --workers 2" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /e2e/playwright.config.js: -------------------------------------------------------------------------------- 1 | const { matchers } = require('expect-playwright') 2 | const { expect } = require('@playwright/test') 3 | 4 | expect.extend(matchers) 5 | 6 | process.env.PLAYWRIGHT_EXPERIMENTAL_FEATURES = '1' 7 | 8 | module.exports = { 9 | retries: process.env.CI ? 1 : 0, 10 | reporter: [ ['allure-playwright'], ['list'], ['html', { open: 'never', outputFolder: 'reports' }]], 11 | projects: [ 12 | { 13 | name: 'e2e', 14 | outputDir: 'test-results', 15 | testMatch: '**/*.e2e.test.js', 16 | timeout: 100000, 17 | expect: { 18 | timeout: 10 * 1000, 19 | }, 20 | use: { 21 | baseURL: process.env.URL, 22 | browsers: ['chromium'], 23 | viewport: { width: 1440, height: 900 }, 24 | screenshot: 'only-on-failure', 25 | trace: 'retain-on-failure', 26 | bypassCSP: true, 27 | launchOptions: { 28 | args: [ 29 | '--no-sandbox', 30 | '--disable-setuid-sandbox', 31 | '--disable-web-security', 32 | '--disable-gpu', 33 | '--disable-dev-shm-usage' 34 | ], 35 | headless: true 36 | } 37 | } 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /etc/_product_types.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /etc/adminhtml/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /etc/frontend/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /etc/graphql/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Pagarme\Pagarme\Model\Graphql\PixDataProvider 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /etc/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /etc/schema.graphqls: -------------------------------------------------------------------------------- 1 | type PlaceOrderOutput { 2 | pagarme_pix: PagarmePix 3 | } 4 | 5 | type PagarmePix { 6 | qr_code: String, 7 | qr_code_url: String 8 | } -------------------------------------------------------------------------------- /etc/webapi_rest/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /etc/webapi_soap/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /i18n/en_US.csv: -------------------------------------------------------------------------------- 1 | "Please enter a valid $ amount. For example $100.00.", "Please enter a valid $ amount. For example: 1000.00" 2 | -------------------------------------------------------------------------------- /phpcs.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | Pagar.me coding standards 13 | 14 | 15 | 16 | 17 | */Test/* 18 | */vendor/* 19 | 20 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 15 | 16 | Test/Unit 17 | 18 | 19 | 20 | ./* 21 | 22 | 23 | ./Test/ 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /registration.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /view/adminhtml/layout/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /view/adminhtml/layout/pagarme_pagarme_cards_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /view/adminhtml/layout/pagarme_pagarme_charges_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /view/adminhtml/layout/pagarme_pagarme_invoices_index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /view/adminhtml/layout/pagarme_pagarme_plans_create.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 19 | -------------------------------------------------------------------------------- /view/frontend/templates/product/price/recurrence.phtml: -------------------------------------------------------------------------------- 1 | 16 | getRecurrencePrice($block->getProduct())) : ?> 17 |
18 | 19 | formatPrice($recurrencePrice->getPrice())) . ' ' . __($recurrencePrice->getInterval()) ?> 20 | 21 |
22 | 23 | -------------------------------------------------------------------------------- /view/frontend/web/css/pagarme_kyc.css: -------------------------------------------------------------------------------- 1 | .wk-mp-design .mp-widgets.pagarme-kyc { 2 | width: 100%; 3 | } 4 | 5 | .pagarme-kyc .container { 6 | padding-bottom: 15px; 7 | } 8 | 9 | .pagarme-kyc-box { 10 | border:1px solid #ccc; 11 | } 12 | 13 | .pagarme-kyc-box-title { 14 | border-bottom: 1px solid #ccc; 15 | display: inline-block; 16 | width: 100%; 17 | } 18 | 19 | .pagarme-kyc-box-content { 20 | padding:5px; 21 | } 22 | 23 | .pagarme-kyc-box-content > div { 24 | display: flex; 25 | flex-direction: column; 26 | align-items: center; 27 | } 28 | 29 | .pagarme-kyc-box-content > div button { 30 | margin: 2.5rem; 31 | } 32 | 33 | .pagarme-kyc-modal { 34 | display: none; 35 | padding-top: 3rem; 36 | text-align: center; 37 | } 38 | 39 | .pagarme-kyc-modal img { 40 | width: 220px; 41 | } 42 | 43 | .pagarme-alert-text { 44 | font-weight: bold; 45 | color: #cd0909; 46 | } -------------------------------------------------------------------------------- /view/frontend/web/css/pagarme_style.css: -------------------------------------------------------------------------------- 1 | .payment-full{ 2 | width: 100%; 3 | display: flex; 4 | justify-content: space-between; 5 | } 6 | .form-creditcard-one, .form-creditcard-two { 7 | padding-right: 30px; 8 | box-sizing: border-box; 9 | } 10 | 11 | .checkout-payment-method .payment-method-content { 12 | padding: 0; 13 | } 14 | .checkout-payment-method .checkout-billing-address { 15 | margin: 20px 0; 16 | } 17 | .actions-toolbar { 18 | margin-bottom: 10px; 19 | } 20 | 21 | .multibuyer { 22 | width: 335px; 23 | display: none; 24 | } 25 | 26 | .field.hidden-element, 27 | .field-error.hidden-element { 28 | display: none; 29 | } 30 | 31 | .field .control .fields .field .control .cc_saved_creditcards, 32 | .field .control .fields .field .control .cc_installments { 33 | width: 335px; 34 | } 35 | 36 | .field .control .cc_amount, 37 | .field .control .cc_owner { 38 | width: 225px; 39 | } 40 | 41 | .pagarme-pix-logo { 42 | width: 120px; 43 | } -------------------------------------------------------------------------------- /view/frontend/web/css/pagarme_tds.css: -------------------------------------------------------------------------------- 1 | .challengeIframeElement { 2 | display: none; 3 | position: fixed; 4 | z-index: 99999; 5 | padding-top: 100px; 6 | left: 0; 7 | top: 0; 8 | width: 100%; 9 | height: 100%; 10 | overflow: auto; 11 | background-color: rgb(0, 0, 0); 12 | background-color: rgba(0, 0, 0, 0.4); 13 | } 14 | 15 | .modal-content { 16 | background-color: #fefefe; 17 | margin: auto; 18 | padding: 20px; 19 | border: 1px solid #888; 20 | max-width: fit-content; 21 | } 22 | 23 | #challengeIframe { 24 | display: none; 25 | width: 500px; 26 | height: 600px; 27 | border: 0; 28 | } -------------------------------------------------------------------------------- /view/frontend/web/js/action/installments.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Open Source Team 3 | * @copyright 2021 Pagar.me (https://pagar.me) 4 | * @license https://pagar.me Copyright 5 | * 6 | * @link https://pagar.me 7 | */ 8 | /*browser:true*/ 9 | /*global define*/ 10 | define( 11 | [ 12 | 'mage/storage', 13 | 'Magento_Checkout/js/model/url-builder' 14 | ], 15 | function ( 16 | storage, 17 | urlBuilder 18 | ) { 19 | return function () { 20 | var serviceUrl; 21 | return urlBuilder.createUrl('/pagarme/creditcard/installments/', {}); 22 | }; 23 | } 24 | ); 25 | -------------------------------------------------------------------------------- /view/frontend/web/js/action/installmentsByBrand.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Open Source Team 3 | * @copyright 2021 Pagar.me (https://pagar.me) 4 | * @license https://pagar.me Copyright 5 | * 6 | * @link https://pagar.me 7 | */ 8 | /*browser:true*/ 9 | /*global define*/ 10 | define( 11 | [ 12 | 'mage/storage', 13 | 'Magento_Checkout/js/model/url-builder' 14 | ], 15 | function ( 16 | storage, 17 | urlBuilder 18 | ) { 19 | 20 | return function (brand) { 21 | var serviceUrl; 22 | return urlBuilder.createUrl('/pagarme/installments/brandbyamount/', {}); 23 | }; 24 | } 25 | ); 26 | -------------------------------------------------------------------------------- /view/frontend/web/js/action/installmentsByBrandAndAmount.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Open Source Team 3 | * @copyright 2021 Pagar.me (https://pagar.me) 4 | * @license https://pagar.me Copyright 5 | * 6 | * @link https://pagar.me 7 | */ 8 | /*browser:true*/ 9 | /*global define*/ 10 | define( 11 | [ 12 | 'mage/storage', 13 | 'Magento_Checkout/js/model/url-builder' 14 | ], 15 | function ( 16 | storage, 17 | urlBuilder 18 | ) { 19 | 20 | return function (brand, amount) { 21 | var serviceUrl; 22 | serviceUrl = urlBuilder.createUrl('/pagarme/installments/brandbyamount/' + brand + '/' + amount, {}); 23 | return storage.get( 24 | serviceUrl, false 25 | ) 26 | }; 27 | } 28 | ); 29 | -------------------------------------------------------------------------------- /view/frontend/web/js/action/redirect-after-placeorder.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Open Source Team 3 | * @copyright 2021 Pagar.me (https://pagar.me) 4 | * @license https://pagar.me Copyright 5 | * 6 | * @link https://pagar.me 7 | */ 8 | /*browser:true*/ 9 | /*global define*/ 10 | define( 11 | [ 12 | 'mage/storage', 13 | 'Magento_Checkout/js/model/url-builder' 14 | ], 15 | function ( 16 | storage, 17 | urlBuilder 18 | ) { 19 | 20 | return function (orderId) { 21 | var serviceUrl; 22 | serviceUrl = urlBuilder.createUrl('/pagarme/redirect-after-placeorder/:orderId/link', { 23 | orderId: orderId 24 | }); 25 | 26 | return storage.post( 27 | serviceUrl, false 28 | ); 29 | }; 30 | } 31 | ); 32 | -------------------------------------------------------------------------------- /view/frontend/web/js/core/checkout/PlatformPlaceOrder.js: -------------------------------------------------------------------------------- 1 | define([], () => { 2 | return class PlatformPlaceOrder { 3 | constructor(platformObject, data, event) { 4 | this.platformObject = platformObject; 5 | this.data = data; 6 | this.event = event; 7 | } 8 | placeOrder = function() { 9 | return this.platformObject.placeOrder( 10 | this.data, 11 | this.event 12 | ); 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /view/frontend/web/js/core/models/GooglePayModel.js: -------------------------------------------------------------------------------- 1 | define(['Pagarme_Pagarme/js/core/validators/MultibuyerValidator'], (MultibuyerValidator) => { 2 | return class GooglePayModel { 3 | constructor(formObject) { 4 | this.formObject = formObject; 5 | this.errors = []; 6 | } 7 | 8 | placeOrder(placeOrderObject) { 9 | this.placeOrderObject = placeOrderObject; 10 | this.placeOrderObject.placeOrder(); 11 | } 12 | 13 | validate() { 14 | return true; 15 | } 16 | 17 | addErrors(error) { 18 | this.errors.push({ 19 | message: error 20 | }) 21 | } 22 | 23 | getData() { 24 | 25 | const data = { 26 | 'method': "pagarme_googlepay", 27 | 'additional_data': { 28 | "googlepayData": this.placeOrderObject?.data 29 | } 30 | }; 31 | return data; 32 | } 33 | }; 34 | }); 35 | -------------------------------------------------------------------------------- /view/frontend/web/js/core/validators/CustomerValidator.js: -------------------------------------------------------------------------------- 1 | define([], () => { 2 | return class CustomerValidator { 3 | constructor(addressObject) { 4 | this.addressObject = addressObject; 5 | this.errors = []; 6 | } 7 | validate() { 8 | const address = this.addressObject; 9 | 10 | if (address == null) { 11 | this.errors.push("Customer address is required"); 12 | return; 13 | } 14 | 15 | if (address.vatId <= 0 && address.vatId != null) { 16 | this.errors.push("O campo CPF/CNPJ é obrigatório."); 17 | } 18 | 19 | if (address.street.length < 3) { 20 | this.errors.push( 21 | "O endereço fornecido está diferente do esperado. " + 22 | "Verifique se você preencheu os campos " + 23 | "rua, número e bairro e tente novamente." 24 | ); 25 | } 26 | } 27 | getErrors() { 28 | return this.errors; 29 | } 30 | } 31 | }); 32 | -------------------------------------------------------------------------------- /view/frontend/web/js/mixin/billing-address-mixin.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'jquery', 3 | 'Magento_Checkout/js/checkout-data', 4 | 'Magento_Checkout/js/model/quote', 5 | 'Magento_Checkout/js/action/create-billing-address' 6 | ],function ($, checkoutData, quote, createBillingAddress) { 7 | 'use strict'; 8 | 9 | return function (Component) { 10 | return Component.extend({ 11 | updateAddress: function () { 12 | this._super(); 13 | 14 | var addressData = null; 15 | if (!this.source.get('params.invalid')) { 16 | addressData = checkoutData.getBillingAddressFromData(); 17 | } 18 | 19 | if (addressData != null) { 20 | platFormConfig.addresses.billingAddress = createBillingAddress(addressData); 21 | } 22 | 23 | return this; 24 | } 25 | }); 26 | }; 27 | }); -------------------------------------------------------------------------------- /view/frontend/web/template/payment/boleto-form.html: -------------------------------------------------------------------------------- 1 |
2 | 5 |
6 | 12 |
13 |
14 | 15 |
16 | 17 |
18 | -------------------------------------------------------------------------------- /view/frontend/web/template/payment/boleto.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
-------------------------------------------------------------------------------- /view/frontend/web/template/payment/boletocreditcard.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 |
6 | 7 | 8 | 9 |
10 |
-------------------------------------------------------------------------------- /view/frontend/web/template/payment/creditcard.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
-------------------------------------------------------------------------------- /view/frontend/web/template/payment/debit.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
-------------------------------------------------------------------------------- /view/frontend/web/template/payment/pix-form.html: -------------------------------------------------------------------------------- 1 |
2 | 5 |
6 | 12 |
13 |
14 | 15 | 16 | 17 |
18 | 19 |
20 | -------------------------------------------------------------------------------- /view/frontend/web/template/payment/pix.html: -------------------------------------------------------------------------------- 1 |
3 | 4 | 5 |
6 |
-------------------------------------------------------------------------------- /view/frontend/web/template/payment/twocreditcards.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 |
6 | 7 | 8 |
9 | -------------------------------------------------------------------------------- /view/frontend/web/template/payment/voucher.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
--------------------------------------------------------------------------------