+# This is a unnoficial plugin mantained by Link Nacional
-The Mercado Pago payments for WooCommerce plugin allows you to expand the functionalities of your online store and offer a unique payment experience for your customers.
+The Link Nacional Mercado Pago payments for WooCommerce plugin allows you to expand the functionalities of your online store and offer a unique payment experience for your customers.
diff --git a/assets/css/index.php b/assets/css/index.php
index a33130a51..891711d6d 100644
--- a/assets/css/index.php
+++ b/assets/css/index.php
@@ -1,14 +1,5 @@
enabled."
msgstr "O checkout está ativo."
#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:262,
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:921
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:934
msgid "The checkout is disabled."
msgstr "O checkout está inativo."
@@ -353,7 +347,7 @@ msgstr ""
"Pago."
#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:298,
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:269
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:348
msgid "Advanced settings"
msgstr "Configuração Avançada"
@@ -462,120 +456,119 @@ msgstr "O comprador não será redirecionado automaticamente à loja."
msgid "Available payment methods"
msgstr "Meios de pagamento disponíveis"
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:535,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:521,
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:426,
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:411,
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:698,
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:418,
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:404,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:434,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:419,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:520,
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:441,
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:403,
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:418,
#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:174,
#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:172
msgid "discount of"
msgstr "desconto de"
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:541,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:527,
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:432,
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:417,
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:704,
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:691,
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:424,
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:410,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:440,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:425,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:526,
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:447,
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:683,
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:409,
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:424,
#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:176
msgid "fee of"
msgstr "taxa de"
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:641,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:667,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:719
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:626,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:652,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:704
msgid "Easy login"
msgstr "Entre fácil"
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:642,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:668,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:720
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:627,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:653,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:705
msgid "Log in with the same email and password you use in Mercado Libre."
msgstr "Inicie sessão com seu mesmo e-mail e senha do Mercado Livre."
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:649,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:675,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:693,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:727
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:634,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:660,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:678,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:712
msgid "Quick payments"
msgstr "Pague rápido"
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:650
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:635
msgid "Use your saved cards, Pix or available balance."
msgstr "Use seus cartões salvos, Pix ou saldo disponível."
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:657,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:683
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:642,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:668
msgid "Protected purchases"
msgstr "Proteja sua compra"
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:658,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:684
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:643,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:669
msgid "Get your money back in case you don't receive your product."
msgstr "Receba o dinheiro de volta se você não receber o produto."
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:676
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:661
msgid "Use your available Mercado Pago Wallet balance or saved cards."
msgstr "Use seu saldo disponível no Mercado Pago Wallet ou cartões salvos."
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:694,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:728
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:679,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:713
msgid "Use your available money or saved cards."
msgstr "Use seu dinheiro disponível e cartões salvos."
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:701,
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:735
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:686,
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:720
msgid "Installments option"
msgstr "Use parcelas"
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:702
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:687
msgid "Pay with or without a credit card."
msgstr "Pague com ou sem cartão de crédito."
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:709
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:694
msgid "Reliable purchases"
msgstr "Compre com confiança"
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:710
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:695
msgid "Get help if you have a problem with your purchase."
msgstr "Receba ajuda se tiver algum problema com sua compra."
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:736
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:721
msgid "Interest-free installments with selected banks."
msgstr "Parcelas sem juros em bancos selecionados."
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:30,
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:31,
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:245
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:42,
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:43,
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:324
msgid "Installments without card"
msgstr "Parcelado sem cartão"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:32
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:44
msgid "Customers who buy on spot and pay later in up to 12 installments"
msgstr "Clientes compram na hora e pagam depois em até 12x"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:40
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:54
msgid "Mercado Pago - Installments without card"
msgstr "Mercado Pago - Parcelamento sem cartão"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:42
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:56
msgid "Checkout without card"
msgstr "Parcelado sem cartão com Mercado Pago"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:182
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:112,
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:288
+msgid "Banner on the product page | Computer version"
+msgstr "Informativo na página do produto | Versão para computador"
+
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:113
+msgid "Banner on the product page | Cellphone version"
+msgstr "Informativo na página do produto | Versão para celular"
+
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:249
msgid "Activate installments without card in your store checkout "
msgstr "Ativar parcelamento sem cartão no checkout da loja "
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:183
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:250
msgid ""
"Offer the option to pay in installments without card directly from your "
"store's checkout."
@@ -583,34 +576,46 @@ msgstr ""
"Ofereça a opção de pagamento parcelado sem cartão através do checkout da sua "
"loja."
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:187
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:254
msgid ""
"Payment in installments without card in the store checkout is active"
msgstr "Parcelamento sem cartão no checkout da loja está ativo"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:188
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:255
msgid ""
"Payment in installments without card in the store checkout is inactive"
msgstr "Parcelamento sem cartão no checkout da loja está desativado"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:205
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:273
msgid "Checkout visualization"
msgstr "Visualização no checkout"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:206,
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:367
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:274,
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:290
msgid "Check below how this feature will be displayed to your customers:"
msgstr "Confira como aparecerá este recurso para seus clientes:"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:207
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:275
msgid "Checkout Preview"
msgstr "Visualização no checkout"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:208
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:276
msgid "PREVIEW"
msgstr "PRÉ-VISUALIZAÇÃO"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:249
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:286
+msgid "Computer"
+msgstr "Computador"
+
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:287
+msgid "Mobile"
+msgstr "Celular"
+
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:289
+msgid "Component visualization"
+msgstr "Visualização do componente"
+
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:328
msgid ""
"Reach millions of buyers by offering Mercado Credito as a payment method. "
"Our flexible payment options give your customers the possibility to buy "
@@ -623,17 +628,17 @@ msgstr ""
"clientes a possibilidade de comprar o que querem hoje em até 12x sem ter que "
"usar cartão."
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:252
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:331
msgid ""
"For your business, the approval of the purchase is immediate and guaranteed."
msgstr "Para o seu negócio, a aprovação da compra é imediata e está garantida."
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:311
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:394
msgid ""
"Inform your customers about the option of paying in installments without card"
msgstr "Informe aos seus clientes sobre a opção de parcelamento sem cartão"
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:314
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:397
msgid ""
"By activating the installments without card component, you increase "
"your chances of selling."
@@ -641,35 +646,14 @@ msgstr ""
"Ativando o componente de parcelamento sem cartão, você aumentará suas "
"possibilidades de venda. "
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:316
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:399
msgid "The installments without card component is active."
msgstr "O componente de parcelamento sem cartão está ativo."
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:317
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:400
msgid "The installments without card component is inactive."
msgstr "O componente de parcelamento sem cartão está desativado."
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:355,
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:365
-msgid "Banner on the product page | Computer version"
-msgstr "Informativo na página do produto | Versão para computador"
-
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:356
-msgid "Banner on the product page | Cellphone version"
-msgstr "Informativo na página do produto | Versão para celular"
-
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:363
-msgid "Computer"
-msgstr "Computador"
-
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:364
-msgid "Mobile"
-msgstr "Celular"
-
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:366
-msgid "Component visualization"
-msgstr "Visualização do componente"
-
#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:41,
#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:42,
#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:52
@@ -705,11 +689,11 @@ msgid "Transparent checkout for credit cards is disabled."
msgstr ""
"O checkout transparente para cartões de crédito está desativado."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:191
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:184
msgid "Installments Fees"
msgstr "Taxas de parcelamento"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:192
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:185
msgid ""
"Set installment fees and whether they will be charged from the store or from "
"the buyer."
@@ -717,15 +701,15 @@ msgstr ""
"Configure as taxas de parcelamento e se elas serão cobradas da loja ou do "
"comprador."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:193
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:186
msgid "Set fees"
msgstr "Configurar taxas"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:218
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:211
msgid "Transparent Checkout | Credit card "
msgstr "Checkout Transparente | Cartão de Crédito "
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:222
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:215
msgid ""
"With the Transparent Checkout, you can sell inside your store environment, "
"without redirection and with the security from Mercado Pago."
@@ -733,15 +717,15 @@ msgstr ""
"Com o Checkout Transparente, você consegue vender dentro do ambiente da sua "
"loja, sem redirecionamento, com toda a segurança do Mercado Pago."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:240
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:233
msgid "Advanced configuration of the personalized payment experience"
msgstr "Configuração Avançada"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:254
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:247
msgid "Payments via Mercado Pago account"
msgstr "Pagamentos via conta Mercado Pago"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:255
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:248
msgid ""
"Your customers pay faster with saved cards, money balance or other available "
"methods in their Mercado Pago accounts."
@@ -749,23 +733,23 @@ msgstr ""
"Seus clientes pagam mais rapidamente com cartões salvos, saldo ou outros "
"meios disponíveis nas contas MP deles."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:259
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:252
msgid "Payments via Mercado Pago accounts are active."
msgstr "Pagamentos via conta Mercado Pago estão ativos."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:260
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:253
msgid "Payments via Mercado Pago accounts are inactive."
msgstr "Pagamentos via conta Mercado Pago estão desativados."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:279
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:272
msgid "Check an example of how it will appear in your store:"
msgstr "Confira um exemplo de como vai aparecer na loja:"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:310
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:303
msgid "That’s it, payment accepted!"
msgstr "Pronto, aceitamos seu pagamento!"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:312
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:305
msgid ""
"We are processing your payment. In less than an hour we will send you the "
"result by email."
@@ -773,7 +757,7 @@ msgstr ""
"Estamos processando seu pagamento. Em menos de uma hora você será notificado "
"por email."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:314
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:307
msgid ""
"We are processing your payment. In less than 2 days we will send you by "
"email if the payment has been approved or if additional information is "
@@ -783,31 +767,31 @@ msgstr ""
"notificado por email se o pagamento foi aprovado ou se são necessárias "
"informações adicionais."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:316
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:309
msgid "Check the card number."
msgstr "Verifique o número do cartão."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:318
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:311
msgid "Check the expiration date."
msgstr "Verifique a data de expiração."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:320
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:313
msgid "Check the information provided."
msgstr "Verifique as informações preenchidas."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:322
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:315
msgid "Check the informed security code."
msgstr "Verifique o código de segurança informado."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:325
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:318
msgid "Your payment cannot be processed."
msgstr "Não foi possível processar seu pagamento."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:327
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:320
msgid "You must authorize payments for your orders."
msgstr "Você deve autorizar o pagamento dos seus pedidos."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:329
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:322
msgid ""
"Contact your card issuer to activate it. The phone is on the back of your "
"card."
@@ -815,7 +799,7 @@ msgstr ""
"Contacte o emissor de seu cartão para ativá-lo. O telefone está no verso do "
"seu cartão."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:331
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:324
msgid ""
"You have already made a payment of this amount. If you have to pay again, "
"use another card or other method of payment."
@@ -823,7 +807,7 @@ msgstr ""
"Você já realizou o pagamento para esse valor. Se precisa pagar novamente, "
"use outro cartão ou outro método de pagamento."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:333
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:326
msgid ""
"Your payment was declined. Please select another payment method. It is "
"recommended in cash."
@@ -831,15 +815,15 @@ msgstr ""
"Seu pagamento foi rejeitado. Escolha outro método de pagamento. Recomenda-se "
"dinheiro."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:335
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:328
msgid "Your payment does not have sufficient funds."
msgstr "Seu pagamento não possui saldo suficiente."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:337
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:330
msgid "Payment cannot process the selected fee."
msgstr "Seu pagamento não pode processar o parcelamento selecionado."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:339
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:332
msgid ""
"You have reached the limit of allowed attempts. Choose another card or other "
"payment method."
@@ -847,55 +831,55 @@ msgstr ""
"Você atingiu o limite de tentativas permitidas. Escolha outro cartão ou "
"outro método de pagamento."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:341,
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:334,
#: ../../includes/module/preference/class-wc-woomercadopago-preference-abstract.php:204
msgid "This payment method cannot process your payment."
msgstr "Este método de pagamento não pôde processar o seu pagamento."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:396
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:389
msgid "Credit cards"
msgstr "Cartões de crédito"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:397
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:390
msgid "Up to "
msgstr "ATÉ "
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:397
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:390
msgid " installments"
msgstr " x"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:404
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:397
msgid "Debit cards"
msgstr "Cartões de débito"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:447,
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:448,
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:480,
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:481,
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:440,
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:441,
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:473,
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:474,
#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:401,
#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:402,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:562,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:563
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:543,
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:544
msgid "A problem was occurred when processing your payment. Please, try again."
msgstr ""
"Ocorreu um problema ao processar seu pagamento. Por favor, tente novamente."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:577
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:570
msgid "See your order form"
msgstr "Ver o resumo do pedido"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:588
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:581
msgid "Your payment was declined. You can try again."
msgstr "Seu pagamento foi rejeitado. Você pode tentar novamente."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:595,
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:588,
#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-basic.php:95,
#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-credits.php:93
msgid "Click to try again"
msgstr "Clique para tentar novamente"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:617,
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:618
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:610,
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:611
msgid ""
"A problem was occurred when processing your payment. Are you sure you have "
"correctly filled all information in the checkout form?"
@@ -903,15 +887,15 @@ msgstr ""
"Ocorreu um problema ao processar seu pagamento. Tem certeza de que preencheu "
"corretamente todas as informações no formulário de checkout?"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:642
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:635
msgid "Represents the installment fee charged by Mercado Pago."
msgstr "Representa a taxa de parcelamento cobrada pelo Mercado Pago."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:643
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:636
msgid "Mercado Pago Installment Fee:"
msgstr "Taxa de Parcelamento do Mercado Pago:"
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:648
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:641
msgid ""
"Represents the total purchase plus the installment fee charged by Mercado "
"Pago."
@@ -919,7 +903,7 @@ msgstr ""
"Representa a soma do total do pedido e da taxa de parcelamento cobrada pelo "
"Mercado Pago."
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:649
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:642
msgid "Mercado Pago Total:"
msgstr "Total no Mercado Pago:"
@@ -928,55 +912,55 @@ msgid "Configure your credentials to enable Mercado Pago payment methods."
msgstr ""
"Complete suas credenciais para habilitar os meios de pagamento Mercado Pago."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:773
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:786
msgid "Title in the store Checkout"
msgstr "Título no checkout da loja"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:775
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:788
msgid "Change the display text in Checkout, maximum characters: 85"
msgstr ""
"É possível modificar o título dentro da sua loja. Caracteres máximos: 85"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:777
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:790
msgid "The text inserted here will not be translated to other languages"
msgstr "O texto inserido aqui não será traduzido para outras línguas"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:791
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:804
msgid "Description"
msgstr "Descrição"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:828,
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:840,
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:841,
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:853,
#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:347
msgid "Important! To sell you must enter your credentials."
msgstr "Importante! Para vender você deve inserir suas credenciais."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:829
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:842
msgid "You must enter production credentials."
msgstr "É necessário inserir as credenciais de produção."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:830
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:843
msgid "Enter credentials"
msgstr "Inserir credenciais"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:840
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:853
msgid "Mercado Pago Plugin general settings"
msgstr "Configurações gerais do plugin do Mercado Pago"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:841
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:854
msgid ""
"Set the deadlines and fees, test your store or access the Plugin manual."
msgstr "Ajuste taxas e prazos, teste sua loja ou acesso o manual do plugin."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:842
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:855
msgid "Go to Settings"
msgstr "Ir para Configurações"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:866
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:879
msgid "Activate your credentials to be able to sell"
msgstr "Ative suas credenciais para conseguir vender"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:867
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:880
msgid ""
"Credentials are codes that you must enter to enable sales. Go below on "
"Activate Credentials. On the next screen, use again the Activate Credentials "
@@ -986,42 +970,42 @@ msgstr ""
"abaixo em Ativar credencias. Na tela seguinte, vá novamente no botão Ativar "
"credenciais e preencha os campos com os dados pedidos."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:868
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:881
msgid "Activate credentials"
msgstr "Ativar credenciais"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:916
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:929
msgid "By disabling it, you will disable all payment methods of this checkout."
msgstr ""
"Ao desativar, você desabilita todos os meios de pagamento deste checkout."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1029
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:989
msgid "Basic Configuration"
msgstr "Configuração Básica"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1042
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1002
msgid "Discount coupons"
msgstr "Cupons de desconto"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1045
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1005
msgid "Will you offer discount coupons to customers who buy with Mercado Pago?"
msgstr ""
"Você vai oferecer cupons de desconto para os clientes que comprarem com "
"Mercado Pago?"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1047
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1007
msgid "Discount coupons is active."
msgstr "Cupons de desconto estão habilitados."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1048
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1008
msgid "Discount coupons is disabled."
msgstr "Cupons de desconto estão desabilitados."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1060
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1020
msgid "Automatic decline of payments without instant approval"
msgstr "Recusa automática de pagamentos sem aprovação instantânea"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1061
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1021
msgid ""
"Enable it if you want to automatically decline payments that are not "
"instantly approved by banks or other institutions. "
@@ -1029,19 +1013,19 @@ msgstr ""
"Ative se quiser recusar automaticamente pagamentos que não são aprovados "
"instantaneamente por bancos ou outros adquirentes. "
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1065
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1025
msgid "Pending payments will be automatically declined."
msgstr "Pagamentos pendentes serão recusados automaticamente."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1066
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1026
msgid "Pending payments will not be automatically declined."
msgstr "Pagamentos pendentes não serão recusados automaticamente."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1078
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1038
msgid "Discount in Mercado Pago Checkouts"
msgstr "Desconto nos checkouts Mercado Pago"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1081
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1041
msgid ""
"Choose a percentage value that you want to discount your customers for "
"paying with Mercado Pago."
@@ -1049,16 +1033,16 @@ msgstr ""
"Selecione um valor percentual que quiser descontar para seus clientes por "
"pagar com Mercado Pago."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1082,
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1103
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1042,
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1063
msgid "Activate and show this information on Mercado Pago Checkout"
msgstr "Ativar e mostrar essa informação no checkout Mercado Pago"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1099
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1059
msgid "Commission in Mercado Pago Checkouts"
msgstr "Comissão nos checkouts Mercado Pago"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1102
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1062
msgid ""
"Choose an additional percentage value that you want to charge as commission "
"to your customers for paying with Mercado Pago."
@@ -1066,19 +1050,19 @@ msgstr ""
"Selecione um valor percentual adicional que quiser cobrar como tarifa dos "
"seus clientes por pagar com Mercado Pago."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1139
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1083
msgid "Convert Currency"
msgstr "Converter moeda"
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1144
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1088
msgid "Currency convertion is enabled."
msgstr "Conversão de moeda está ativa."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1145
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1089
msgid "Currency convertion is disabled."
msgstr "Conversão de moeda está inativa."
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1262
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1206
msgid ""
"Edit these advanced fields only when you want to modify the preset values."
msgstr ""
@@ -1266,13 +1250,13 @@ msgstr "Criamos uma página que explica seu funcionamento e vantagens."
msgid "Find out more about Pix"
msgstr "Saber mais sobre o Pix"
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:493
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:470
msgid "A problem occurred when processing your payment. Please try again."
msgstr ""
"Um problema ocorreu ao processar seu pagamento. Por favor, tente novamente."
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:478,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:547
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:455,
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:528
msgid ""
"A problem occurred when processing your payment. Are you sure you have "
"correctly filled in all the information on the checkout form?"
@@ -1280,16 +1264,16 @@ msgstr ""
"Um problema ocorreu ao processar seu pagamento. Você tem certeza que "
"preencheu corretamente todos os campos do formulário do checkout?"
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:456,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:522
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:433,
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:503
msgid "The customer has not paid yet."
msgstr "Cliente ainda não pagou."
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:461
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:438
msgid "Now you just need to pay with Pix to finalize your purchase."
msgstr "Agora é só pagar com o Pix para finalizar sua compra."
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:462
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:439
msgid ""
"Scan the QR code below or copy and paste the code into your bank's "
"application."
@@ -1297,7 +1281,7 @@ msgstr ""
"Escaneie o código QR abaixo ou copie e cole o código no aplicativo do seu "
"banco."
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:563
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:540
msgid ""
"Please note that to receive payments via Pix at our checkout, you must have "
"a Pix key registered in your Mercado Pago account."
@@ -1305,11 +1289,11 @@ msgstr ""
"Lembre-se de que para receber pagamentos via PIX em nosso checkout, você "
"precisa ter uma chave PIX cadastrada na sua conta Mercado Pago."
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:564
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:541
msgid "Register your Pix key at Mercado Pago."
msgstr "Cadastre sua chave PIX no Mercado Pago."
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:614,
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:601,
#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-pix.php:148
msgid "Code valid for "
msgstr "Código válido por "
@@ -1395,8 +1379,8 @@ msgstr "Habilite os meios de pagamento disponíveis para seus clientes."
msgid "All payment methods"
msgstr "Todos os meios de pagamento"
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:458,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:486
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:443,
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:471
msgid ""
"There was a problem processing your payment. Are you sure you have correctly "
"filled out all the information on the payment form?"
@@ -1404,45 +1388,45 @@ msgstr ""
"Ocorreu um problema ao processar seu pagamento. Tem certeza de que preencheu "
"corretamente todas as informações no formulário de pagamento?"
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:451,
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:479
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:436,
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:464
msgid "Your document data is invalid"
msgstr "Número de documento inválido"
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:527
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:508
msgid "To print the ticket again click"
msgstr "Para reimprimir o boleto clique"
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:530
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:511
msgid "here"
msgstr "aqui"
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:659
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:640
msgid " and "
msgstr " e "
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:113
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:117
msgid "Payment made"
msgstr "Pagamento realizado"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:114
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:118
msgid "Payment made by the buyer and already credited in the account."
msgstr "Pagamento realizado pelo comprador e já creditado na conta."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:117
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:121
msgid "Call resolved"
msgstr "Chamado resolvido"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:118,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:218
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:122,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:222
msgid "Please contact Mercado Pago for further details."
msgstr "Entre em contato com o Mercado Pago para consultar mais detalhes."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:121
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:125
msgid "Payment refunded"
msgstr "Pagamento devolvido"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:122
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:126
msgid ""
"Your refund request has been made. Please contact Mercado Pago for further "
"details."
@@ -1450,59 +1434,59 @@ msgstr ""
"Seu pedido de reembolso já foi realizado. Entre em contato com o Mercado "
"Pago para consultar mais detalhes."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:125,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:129
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:129,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:133
msgid "Payment returned"
msgstr "Pagamento devolvido"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:126
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:130
msgid "The payment has been returned to the client."
msgstr "O pagamento já foi devolvido ao cliente."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:130
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:134
msgid "The payment has been partially returned to the client."
msgstr "O pagamento já foi devolvido parcialmente ao cliente."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:133
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:137
msgid "Payment canceled"
msgstr "Pagamento cancelado"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:134
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:138
msgid "The payment has been successfully canceled."
msgstr "O pagamento foi cancelado com sucesso."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:137
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:141
msgid "Purchase canceled"
msgstr "Compra cancelada"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:138
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:142
msgid "The payment has been canceled by the customer."
msgstr "O pagamento foi cancelado pelo cliente."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:141,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:145,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:149,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:153,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:157,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:173,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:161,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:177,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:181,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:185,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:189,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:193,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:197,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:307
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:201,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:311
msgid "Pending payment"
msgstr "Pagamento pendente"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:142,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:146,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:150,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:154
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:154,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:158
msgid "Awaiting payment from the buyer."
msgstr "Aguardando pagamento do comprador."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:158
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:162
msgid ""
"We are veryfing the payment. We will notify you by email in up to 6 hours if "
"everything is fine so that you can deliver the product or provide the "
@@ -1512,19 +1496,18 @@ msgstr ""
"se está tudo certo para que você possa entregar o produto ou oferecer o "
"serviço."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:161,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:201,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:165,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:205,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:209,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:213,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:225,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:217,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:229,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:233,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:237,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:241,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:245,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:249,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:255,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:253,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:259,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:263,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:267,
@@ -1537,19 +1520,20 @@ msgstr ""
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:295,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:299,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:303,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:315,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:321,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:325
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:307,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:319,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:325,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:329
msgid "Declined payment"
msgstr "Pagamento recusado"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:162,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:206,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:166,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:210,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:214,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:226,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:246,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:256
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:218,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:230,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:250,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:260
msgid ""
"The card-issuing bank declined the payment. Please ask your client to use "
"another card or to get in touch with the bank."
@@ -1557,11 +1541,11 @@ msgstr ""
"O banco emissor do cartão recusou o pagamento. Peça para seu cliente usar "
"outro cartão ou entrar em contato com o banco."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:165
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:169
msgid "Payment authorized. Awaiting capture."
msgstr "Pagamento autorizado. Aguardando captura."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:166
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:170
msgid ""
"The payment has been authorized on the client's card. Please capture the "
"payment."
@@ -1569,17 +1553,17 @@ msgstr ""
"O pagamento já foi autorizado no cartão do cliente. Faça a captura do "
"pagamento."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:169
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:173
msgid "Payment in process"
msgstr "Pagamento em processamento"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:170,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:190
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:174,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:194
msgid "Please wait or contact Mercado Pago for further details"
msgstr ""
"Aguarde ou entre em contato com o Mercado Pago para consultar mais detalhes"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:174
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:178
msgid ""
"The bank is reviewing the payment. As soon as we have their confirmation, we "
"will notify you via email so that you can deliver the product or provide the "
@@ -1589,21 +1573,21 @@ msgstr ""
"recebermos a confirmação para que você possa entregar o produto ou oferecer "
"o serviço."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:178,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:182,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:186
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:186,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:190
msgid "Awaiting payment information validation."
msgstr "Aguardando validação das informações de pagamento."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:194
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:198
msgid "Waiting for the buyer."
msgstr "Aguardando o comprador."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:198
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:202
msgid "Waiting for the card issuer."
msgstr "Aguardando o emissor do cartão."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:202
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:206
msgid ""
"The payment could not be processed. Please ask your client to use another "
"card or to get in touch with the bank."
@@ -1611,21 +1595,21 @@ msgstr ""
"O pagamento não foi processado pelo banco. Peça para seu cliente usar outro "
"meio de pagamento ou entrar em contato com o banco."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:217
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:221
msgid "Mercado Pago did not process the payment"
msgstr "O Mercado Pago não processou o pagamento"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:221,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:311
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:225,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:315
msgid "Expired payment deadline"
msgstr "Prazo expirado para pagamento"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:222,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:312
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:226,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:316
msgid "The client did not pay within the time limit."
msgstr "O cliente não pagou dentro do limite de tempo."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:230
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:234
msgid ""
"The CVV is invalid. Please ask your client to review the details or use "
"another card."
@@ -1633,7 +1617,7 @@ msgstr ""
"O código de segurança é inválido. Por favor, peça para seu cliente revisar "
"os dados ou usar outro cartão."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:234
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:238
msgid ""
"The card is expired. Please ask your client to use another card or to "
"contact the bank."
@@ -1641,9 +1625,9 @@ msgstr ""
"O cartão está vencido. Por favor, peça para seu cliente usar outro cartão ou "
"entrar em contato com o banco."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:238,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:284,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:288
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:242,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:288,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:292
msgid ""
"This payment was declined because it did not pass Mercado Pago security "
"controls. Please ask your client to use another card."
@@ -1651,8 +1635,8 @@ msgstr ""
"Este pagamento foi recusado porque não passou pelos controles de segurança "
"do Mercado Pago. Peça para seu cliente usar outro cartão."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:242,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:280
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:246,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:284
msgid ""
"The buyer is suspended in our platform. Your client must contact us to check "
"what happened."
@@ -1660,7 +1644,7 @@ msgstr ""
"O comprador está suspenso no Mercado Pago. Seu cliente precisa entrar em "
"contato conosco para saber o que aconteceu."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:251
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:255
msgid ""
"The card does not have enough limit. Please ask your client to use another "
"card or to get in touch with the bank."
@@ -1668,7 +1652,7 @@ msgstr ""
"O cartão não tem saldo suficiente. Peça para seu cliente usar outro cartão "
"ou entrar em contato com o banco."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:252
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:256
msgid ""
"The card does not have sufficient balance. Please ask your client to use "
"another card or to get in touch with the bank."
@@ -1676,7 +1660,7 @@ msgstr ""
"O cartão não tem saldo suficiente. Peça para seu cliente usar outro cartão "
"ou entrar em contato com o banco."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:260
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:264
msgid ""
"The CVV was entered incorrectly several times. Please ask your client to use "
"another card or to get in touch with the bank."
@@ -1684,7 +1668,7 @@ msgstr ""
"O código de segurança do cartão foi inserido incorretamente várias vezes. "
"Peça para seu cliente trocar o cartão ou entrar em contato com o banco."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:264
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:268
msgid ""
"The card does not allow the number of installments entered. Please ask your "
"client to choose another installment plan or to use another card."
@@ -1692,7 +1676,7 @@ msgstr ""
"O cartão não aceita o número de parcelas escolhido. Peça para seu cliente "
"escolher um número diferente de parcelas ou usar outro cartão."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:268
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:272
msgid ""
"The card-issuing bank declined the payment. Please instruct your client to "
"ask the bank to authotize it or to use another card."
@@ -1701,7 +1685,7 @@ msgstr ""
"entrar em contato com o banco para pedir que o pagamento seja autorizado ou "
"peça que use outro cartão."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:272
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:276
msgid ""
"From Mercado Pago we have detected that this payment has already been made "
"before. If that is not the case, your client may try to pay again."
@@ -1710,7 +1694,7 @@ msgstr ""
"anteriormente. Se esse não for o caso, seu cliente pode tentar pagar "
"novamente."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:276
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:280
msgid ""
"The card is not active yet. Please ask your client to use another card or to "
"get in touch with the bank to activate it."
@@ -1718,7 +1702,7 @@ msgstr ""
"O cartão ainda não está desbloqueado. Peça para seu cliente usar outro "
"cartão ou entrar em contato com o banco para desbloqueá-lo."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:292
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:296
msgid ""
"The amount exceeded the card limit. Please ask your client to use another "
"card or to get in touch with the bank."
@@ -1726,9 +1710,9 @@ msgstr ""
"O valor excedeu o limite do cartão. Peça para seu cliente usar outro cartão "
"ou entrar em contato com o banco."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:296,
#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:300,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:304
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:304,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:308
msgid ""
"Please ask your client to use another card or to get in touch with the card "
"issuer."
@@ -1736,7 +1720,7 @@ msgstr ""
"Peça para seu cliente usar outro cartão ou entrar em contato com o emissor "
"do cartão."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:308
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:312
msgid ""
"The amount exceeded the card's limit. Please ask your client to use another "
"card or to get in touch with the bank."
@@ -1744,7 +1728,7 @@ msgstr ""
"O valor excedeu o limite do cartão. Peça para seu cliente usar outro cartão "
"ou entrar em contato com o banco."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:317
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:321
msgid ""
"The credit function is not enabled for the card. Please tell your client "
"that it is possible to pay with debit or to use another one."
@@ -1752,7 +1736,7 @@ msgstr ""
"A função crédito não está habilitada no cartão. Informe ao seu cliente que é "
"possível pagar no débito ou peça para usar outro cartão."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:318
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:322
msgid ""
"The debit function is not enabled for the card. Please tell your client that "
"it is possible to pay with credit or to use another one."
@@ -1760,7 +1744,7 @@ msgstr ""
"A função débito não está habilitada no cartão. Informe ao seu cliente que é "
"possível pagar no crédito ou peça para usar outro cartão."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:322
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:326
msgid ""
"The card-issuing bank declined the payment. Please instruct your client to "
"ask the bank to authorize it."
@@ -1768,7 +1752,7 @@ msgstr ""
"O banco emissor do cartão recusou o pagamento. Peça para seu cliente entrar "
"em contato com o banco para autorizar o pagamento."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:326
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:330
msgid ""
"The buyer does not have enough balance to make the purchase. Please ask your "
"client to deposit money to the Mercado Pago Account or to use a different "
@@ -1778,38 +1762,38 @@ msgstr ""
"para seu cliente adicionar saldo no Mercado Pago ou usar outro meio de "
"pagamento."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:329
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:333
msgid "There was an error"
msgstr "Houve um erro"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:330
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:334
msgid "The transaction could not be completed."
msgstr "Não foi possível completar a transação."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:413
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:417
msgid "Payment status on Mercado Pago"
msgstr "Status de pagamento no Mercado Pago"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:473,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:485
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:477,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:489
msgid "View purchase details at Mercado Pago"
msgstr "Ver detalhes da compra no Mercado Pago"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:474,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:486,
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:498
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:478,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:490,
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:502
msgid "Sync order status"
msgstr "Sincronizar status do pedido"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:497
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:501
msgid "Check the reasons why the purchase was declined."
msgstr "Consulte os motivos de recusa da sua compra."
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:606
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:608
msgid "Order update successfully. This page will be reloaded..."
msgstr "Pedido atualizado com sucesso. Esta página será recarregada…"
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:610
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:612
msgid "Unable to update order: "
msgstr "Não foi possível atualizar o pedido: "
@@ -2443,7 +2427,7 @@ msgstr "Desconto para o cupom %s"
msgid " and fee of"
msgstr " e taxa de"
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:547
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:545
msgid ""
"Public Key production credential is invalid. Review the field to "
"receive real payments."
@@ -2451,7 +2435,7 @@ msgstr ""
"A credencial de produção Public Key é inválida. Revise o campo para "
"poder receber pagamentos reais."
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:556
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:554
msgid ""
"Public Key test credential is invalid. Review the field to perform "
"tests in your store."
@@ -2459,7 +2443,7 @@ msgstr ""
"A credencial de teste Public Key é inválida. Revise o campo para "
"poder realizar testes em sua loja."
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:565
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:563
msgid ""
"Access Token production credential is invalid. Remember that it must "
"be complete to receive real payments."
@@ -2467,7 +2451,7 @@ msgstr ""
"A credencial de produção Access Token é inválida. Revise o campo para "
"poder receber pagamentos reais."
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:574
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:572
msgid ""
"Access Token test credential is invalid. Review the field to perform "
"tests in your store."
@@ -2475,7 +2459,7 @@ msgstr ""
"A credencial de teste Access Token é inválida. Revise o campo para "
"poder realizar testes em sua loja."
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:592
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:590
msgid ""
"Public Key test credential is blank. Review the field to perform "
"tests in your store."
@@ -2483,7 +2467,7 @@ msgstr ""
"A credencial de teste Public Key está em branco. Revise o campo para "
"poder realizar testes em sua loja."
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:601
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:599
msgid ""
"Public Key production credential is blank. Review the field to "
"receive real payments."
@@ -2491,7 +2475,7 @@ msgstr ""
"A credencial de produção Public Key está em branco. Revise o campo "
"para poder receber pagamentos reais."
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:610
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:608
msgid ""
"Access Token test credential is blank. Review the field to perform "
"tests in your store."
@@ -2499,7 +2483,7 @@ msgstr ""
"A credencial de teste Access Token está em branco. Revise o campo "
"para poder realizar testes em sua loja."
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:619
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:617
msgid ""
"Access Token production credential is blank. Remember that it must be "
"complete to receive real payments."
@@ -2757,7 +2741,7 @@ msgstr "Peça a linha de forma "
#: ../../includes/products/hooks/class-wc-woomercadopago-products-hook-credits.php:120
msgid ". Login to your account or create one in a few steps."
-msgstr "De forma 100% online e segura."
+msgstr "100% online e segura."
#: ../../includes/products/hooks/class-wc-woomercadopago-products-hook-credits.php:121
msgid "Search for"
diff --git a/i18n/languages/woocommerce-mercadopago.pot b/i18n/languages/woocommerce-mercadopago.pot
index 74631d3f8..c8658f12e 100644
--- a/i18n/languages/woocommerce-mercadopago.pot
+++ b/i18n/languages/woocommerce-mercadopago.pot
@@ -7,7 +7,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Last-Translator: MPB Desenvolvimento \n"
-"POT-Creation-Date: 2023-05-16 21:36+0000\n"
+"POT-Creation-Date: 2023-07-10 14:22+0000\n"
"Project-Id-Version: undefined\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
@@ -16,11 +16,11 @@ msgstr ""
"X-Poedit-SourceCharset: UTF-8\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: ../../includes/helpers/class-wc-woomercadopago-helper-links.php:141, ../../includes/module/class-wc-woomercadopago-module.php:352
+#: ../../includes/helpers/class-wc-woomercadopago-helper-links.php:140, ../../includes/module/class-wc-woomercadopago-module.php:352
msgid "By continuing, you agree to our "
msgstr ""
-#: ../../includes/helpers/class-wc-woomercadopago-helper-links.php:143, ../../includes/module/class-wc-woomercadopago-module.php:354
+#: ../../includes/helpers/class-wc-woomercadopago-helper-links.php:142, ../../includes/module/class-wc-woomercadopago-module.php:354
msgid "Terms and Conditions"
msgstr ""
@@ -139,7 +139,7 @@ msgstr ""
msgid "Update the WooCommerce order to "
msgstr ""
-#: ../../includes/module/class-wc-woomercadopago-module.php:821, ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:583
+#: ../../includes/module/class-wc-woomercadopago-module.php:821, ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:581
msgid "Fill in your credentials to enable payment methods."
msgstr ""
@@ -159,7 +159,7 @@ msgstr ""
msgid "By Mercado Pago"
msgstr ""
-#: ../../includes/notification/class-wc-woomercadopago-notification-core.php:109, ../../includes/notification/class-wc-woomercadopago-notification-ipn.php:171, ../../includes/notification/class-wc-woomercadopago-notification-ipn.php:140, ../../includes/notification/class-wc-woomercadopago-notification-webhook.php:189, ../../includes/notification/class-wc-woomercadopago-notification-webhook.php:167
+#: ../../includes/notification/class-wc-woomercadopago-notification-core.php:109, ../../includes/notification/class-wc-woomercadopago-notification-ipn.php:139, ../../includes/notification/class-wc-woomercadopago-notification-webhook.php:166
msgid "Buyer email"
msgstr ""
@@ -179,11 +179,11 @@ msgstr ""
msgid "Not found Payments into Merchant_Order"
msgstr ""
-#: ../../includes/notification/class-wc-woomercadopago-notification-ipn.php:174, ../../includes/notification/class-wc-woomercadopago-notification-ipn.php:143, ../../includes/notification/class-wc-woomercadopago-notification-webhook.php:192, ../../includes/notification/class-wc-woomercadopago-notification-webhook.php:170
+#: ../../includes/notification/class-wc-woomercadopago-notification-ipn.php:142, ../../includes/notification/class-wc-woomercadopago-notification-webhook.php:169
msgid "Payment type"
msgstr ""
-#: ../../includes/notification/class-wc-woomercadopago-notification-ipn.php:177, ../../includes/notification/class-wc-woomercadopago-notification-ipn.php:146, ../../includes/notification/class-wc-woomercadopago-notification-webhook.php:195, ../../includes/notification/class-wc-woomercadopago-notification-webhook.php:173
+#: ../../includes/notification/class-wc-woomercadopago-notification-ipn.php:145, ../../includes/notification/class-wc-woomercadopago-notification-webhook.php:172
msgid "Payment method"
msgstr ""
@@ -259,7 +259,7 @@ msgstr ""
msgid "24 installments"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:256, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:153, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:915, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:203, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:197
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:256, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:153, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:928, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:203, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:197
msgid "Enable the checkout"
msgstr ""
@@ -267,11 +267,11 @@ msgstr ""
msgid "By disabling it, you will disable all payments from Mercado Pago Checkout at Mercado Pago website by redirect."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:261, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:920
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:261, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:933
msgid "The checkout is enabled."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:262, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:921
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:262, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:934
msgid "The checkout is disabled."
msgstr ""
@@ -279,7 +279,7 @@ msgstr ""
msgid "With Checkout Pro you sell with all the safety inside Mercado Pago environment."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:298, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:269
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:298, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:348
msgid "Advanced settings"
msgstr ""
@@ -367,156 +367,156 @@ msgstr ""
msgid "Available payment methods"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:535, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:535, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:521, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:521, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:426, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:426, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:411, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:411, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:698, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:698, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:418, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:418, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:404, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:404, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:434, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:434, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:419, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:419, ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:174, ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:172
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:520, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:520, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:441, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:441, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:403, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:403, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:418, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:418, ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:174, ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:172
msgid "discount of"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:541, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:541, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:527, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:527, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:432, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:432, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:417, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:417, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:704, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:704, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:691, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:691, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:424, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:424, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:410, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:410, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:440, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:440, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:425, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:425, ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:176
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:526, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:526, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:447, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:447, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:683, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:683, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:409, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:409, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:424, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:424, ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:176
msgid "fee of"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:641, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:667, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:719
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:626, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:652, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:704
msgid "Easy login"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:642, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:668, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:720
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:627, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:653, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:705
msgid "Log in with the same email and password you use in Mercado Libre."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:649, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:675, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:693, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:727
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:634, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:660, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:678, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:712
msgid "Quick payments"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:650
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:635
msgid "Use your saved cards, Pix or available balance."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:657, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:683
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:642, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:668
msgid "Protected purchases"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:658, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:684
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:643, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:669
msgid "Get your money back in case you don't receive your product."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:676
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:661
msgid "Use your available Mercado Pago Wallet balance or saved cards."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:694, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:728
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:679, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:713
msgid "Use your available money or saved cards."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:701, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:735
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:686, ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:720
msgid "Installments option"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:702
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:687
msgid "Pay with or without a credit card."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:709
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:694
msgid "Reliable purchases"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:710
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:695
msgid "Get help if you have a problem with your purchase."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:736
+#: ../../includes/payments/class-wc-woomercadopago-basic-gateway.php:721
msgid "Interest-free installments with selected banks."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:30, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:31, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:245
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:42, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:43, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:324
msgid "Installments without card"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:32
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:44
msgid "Customers who buy on spot and pay later in up to 12 installments"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:40
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:54
msgid "Mercado Pago - Installments without card"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:42
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:56
msgid "Checkout without card"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:182
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:112, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:288
+msgid "Banner on the product page | Computer version"
+msgstr ""
+
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:113
+msgid "Banner on the product page | Cellphone version"
+msgstr ""
+
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:249
msgid "Activate installments without card in your store checkout "
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:183
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:250
msgid "Offer the option to pay in installments without card directly from your store's checkout."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:187
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:254
msgid "Payment in installments without card in the store checkout is active"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:188
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:255
msgid "Payment in installments without card in the store checkout is inactive"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:205
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:273
msgid "Checkout visualization"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:206, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:367
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:274, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:290
msgid "Check below how this feature will be displayed to your customers:"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:207
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:275
msgid "Checkout Preview"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:208
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:276
msgid "PREVIEW"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:249
-msgid "Reach millions of buyers by offering Mercado Credito as a payment method. Our flexible payment options give your customers the possibility to buy today whatever they want in up to 12 installments without the need to use a credit card."
-msgstr ""
-
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:252
-msgid "For your business, the approval of the purchase is immediate and guaranteed."
-msgstr ""
-
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:311
-msgid "Inform your customers about the option of paying in installments without card"
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:286
+msgid "Computer"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:314
-msgid "By activating the installments without card component, you increase your chances of selling."
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:287
+msgid "Mobile"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:316
-msgid "The installments without card component is active."
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:289
+msgid "Component visualization"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:317
-msgid "The installments without card component is inactive."
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:328
+msgid "Reach millions of buyers by offering Mercado Credito as a payment method. Our flexible payment options give your customers the possibility to buy today whatever they want in up to 12 installments without the need to use a credit card."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:355, ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:365
-msgid "Banner on the product page | Computer version"
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:331
+msgid "For your business, the approval of the purchase is immediate and guaranteed."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:356
-msgid "Banner on the product page | Cellphone version"
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:394
+msgid "Inform your customers about the option of paying in installments without card"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:363
-msgid "Computer"
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:397
+msgid "By activating the installments without card component, you increase your chances of selling."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:364
-msgid "Mobile"
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:399
+msgid "The installments without card component is active."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:366
-msgid "Component visualization"
+#: ../../includes/payments/class-wc-woomercadopago-credits-gateway.php:400
+msgid "The installments without card component is inactive."
msgstr ""
#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:41, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:42, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:52
@@ -543,163 +543,163 @@ msgstr ""
msgid "Transparent checkout for credit cards is disabled."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:191
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:184
msgid "Installments Fees"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:192
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:185
msgid "Set installment fees and whether they will be charged from the store or from the buyer."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:193
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:186
msgid "Set fees"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:218
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:211
msgid "Transparent Checkout | Credit card "
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:222
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:215
msgid "With the Transparent Checkout, you can sell inside your store environment, without redirection and with the security from Mercado Pago."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:240
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:233
msgid "Advanced configuration of the personalized payment experience"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:254
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:247
msgid "Payments via Mercado Pago account"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:255
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:248
msgid "Your customers pay faster with saved cards, money balance or other available methods in their Mercado Pago accounts."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:259
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:252
msgid "Payments via Mercado Pago accounts are active."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:260
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:253
msgid "Payments via Mercado Pago accounts are inactive."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:279
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:272
msgid "Check an example of how it will appear in your store:"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:310
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:303
msgid "That’s it, payment accepted!"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:312
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:305
msgid "We are processing your payment. In less than an hour we will send you the result by email."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:314
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:307
msgid "We are processing your payment. In less than 2 days we will send you by email if the payment has been approved or if additional information is needed."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:316
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:309
msgid "Check the card number."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:318
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:311
msgid "Check the expiration date."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:320
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:313
msgid "Check the information provided."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:322
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:315
msgid "Check the informed security code."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:325
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:318
msgid "Your payment cannot be processed."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:327
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:320
msgid "You must authorize payments for your orders."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:329
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:322
msgid "Contact your card issuer to activate it. The phone is on the back of your card."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:331
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:324
msgid "You have already made a payment of this amount. If you have to pay again, use another card or other method of payment."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:333
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:326
msgid "Your payment was declined. Please select another payment method. It is recommended in cash."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:335
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:328
msgid "Your payment does not have sufficient funds."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:337
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:330
msgid "Payment cannot process the selected fee."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:339
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:332
msgid "You have reached the limit of allowed attempts. Choose another card or other payment method."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:341, ../../includes/module/preference/class-wc-woomercadopago-preference-abstract.php:204
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:334, ../../includes/module/preference/class-wc-woomercadopago-preference-abstract.php:204
msgid "This payment method cannot process your payment."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:396
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:389
msgid "Credit cards"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:397
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:390
msgid "Up to "
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:397
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:390
msgid " installments"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:404
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:397
msgid "Debit cards"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:447, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:448, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:480, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:481, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:401, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:402, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:562, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:563
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:440, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:441, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:473, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:474, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:401, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:402, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:543, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:544
msgid "A problem was occurred when processing your payment. Please, try again."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:577
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:570
msgid "See your order form"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:588
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:581
msgid "Your payment was declined. You can try again."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:595, ../../includes/payments/hooks/class-wc-woomercadopago-hook-basic.php:95, ../../includes/payments/hooks/class-wc-woomercadopago-hook-credits.php:93
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:588, ../../includes/payments/hooks/class-wc-woomercadopago-hook-basic.php:95, ../../includes/payments/hooks/class-wc-woomercadopago-hook-credits.php:93
msgid "Click to try again"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:617, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:618
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:610, ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:611
msgid "A problem was occurred when processing your payment. Are you sure you have correctly filled all information in the checkout form?"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:642
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:635
msgid "Represents the installment fee charged by Mercado Pago."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:643
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:636
msgid "Mercado Pago Installment Fee:"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:648
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:641
msgid "Represents the total purchase plus the installment fee charged by Mercado Pago."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:649
+#: ../../includes/payments/class-wc-woomercadopago-custom-gateway.php:642
msgid "Mercado Pago Total:"
msgstr ""
@@ -707,131 +707,131 @@ msgstr ""
msgid "Configure your credentials to enable Mercado Pago payment methods."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:773
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:786
msgid "Title in the store Checkout"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:775
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:788
msgid "Change the display text in Checkout, maximum characters: 85"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:777
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:790
msgid "The text inserted here will not be translated to other languages"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:791
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:804
msgid "Description"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:828, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:840, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:347
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:841, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:853, ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:347
msgid "Important! To sell you must enter your credentials."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:829
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:842
msgid "You must enter production credentials."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:830
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:843
msgid "Enter credentials"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:840
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:853
msgid "Mercado Pago Plugin general settings"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:841
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:854
msgid "Set the deadlines and fees, test your store or access the Plugin manual."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:842
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:855
msgid "Go to Settings"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:866
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:879
msgid "Activate your credentials to be able to sell"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:867
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:880
msgid "Credentials are codes that you must enter to enable sales. Go below on Activate Credentials. On the next screen, use again the Activate Credentials button and fill in the fields with the requested information."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:868
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:881
msgid "Activate credentials"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:916
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:929
msgid "By disabling it, you will disable all payment methods of this checkout."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1029
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:989
msgid "Basic Configuration"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1042
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1002
msgid "Discount coupons"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1045
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1005
msgid "Will you offer discount coupons to customers who buy with Mercado Pago?"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1047
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1007
msgid "Discount coupons is active."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1048
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1008
msgid "Discount coupons is disabled."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1060
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1020
msgid "Automatic decline of payments without instant approval"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1061
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1021
msgid "Enable it if you want to automatically decline payments that are not instantly approved by banks or other institutions. "
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1065
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1025
msgid "Pending payments will be automatically declined."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1066
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1026
msgid "Pending payments will not be automatically declined."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1078
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1038
msgid "Discount in Mercado Pago Checkouts"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1081
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1041
msgid "Choose a percentage value that you want to discount your customers for paying with Mercado Pago."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1082, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1103
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1042, ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1063
msgid "Activate and show this information on Mercado Pago Checkout"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1099
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1059
msgid "Commission in Mercado Pago Checkouts"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1102
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1062
msgid "Choose an additional percentage value that you want to charge as commission to your customers for paying with Mercado Pago."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1139
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1083
msgid "Convert Currency"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1144
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1088
msgid "Currency convertion is enabled."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1145
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1089
msgid "Currency convertion is disabled."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1262
+#: ../../includes/payments/class-wc-woomercadopago-payment-abstract.php:1206
msgid "Edit these advanced fields only when you want to modify the preset values."
msgstr ""
@@ -983,35 +983,35 @@ msgstr ""
msgid "Find out more about Pix"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:493
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:470
msgid "A problem occurred when processing your payment. Please try again."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:478, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:547
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:455, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:528
msgid "A problem occurred when processing your payment. Are you sure you have correctly filled in all the information on the checkout form?"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:456, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:522
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:433, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:503
msgid "The customer has not paid yet."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:461
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:438
msgid "Now you just need to pay with Pix to finalize your purchase."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:462
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:439
msgid "Scan the QR code below or copy and paste the code into your bank's application."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:563
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:540
msgid "Please note that to receive payments via Pix at our checkout, you must have a Pix key registered in your Mercado Pago account."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:564
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:541
msgid "Register your Pix key at Mercado Pago."
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:614, ../../includes/payments/hooks/class-wc-woomercadopago-hook-pix.php:148
+#: ../../includes/payments/class-wc-woomercadopago-pix-gateway.php:601, ../../includes/payments/hooks/class-wc-woomercadopago-hook-pix.php:148
msgid "Code valid for "
msgstr ""
@@ -1079,247 +1079,247 @@ msgstr ""
msgid "All payment methods"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:458, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:486
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:443, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:471
msgid "There was a problem processing your payment. Are you sure you have correctly filled out all the information on the payment form?"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:451, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:479
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:436, ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:464
msgid "Your document data is invalid"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:527
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:508
msgid "To print the ticket again click"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:530
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:511
msgid "here"
msgstr ""
-#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:659
+#: ../../includes/payments/class-wc-woomercadopago-ticket-gateway.php:640
msgid " and "
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:113
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:117
msgid "Payment made"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:114
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:118
msgid "Payment made by the buyer and already credited in the account."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:117
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:121
msgid "Call resolved"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:118, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:218
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:122, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:222
msgid "Please contact Mercado Pago for further details."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:121
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:125
msgid "Payment refunded"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:122
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:126
msgid "Your refund request has been made. Please contact Mercado Pago for further details."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:125, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:129
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:129, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:133
msgid "Payment returned"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:126
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:130
msgid "The payment has been returned to the client."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:130
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:134
msgid "The payment has been partially returned to the client."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:133
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:137
msgid "Payment canceled"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:134
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:138
msgid "The payment has been successfully canceled."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:137
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:141
msgid "Purchase canceled"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:138
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:142
msgid "The payment has been canceled by the customer."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:141, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:145, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:149, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:153, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:157, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:173, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:177, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:181, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:185, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:189, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:193, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:197, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:307
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:145, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:149, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:153, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:157, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:161, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:177, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:181, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:185, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:189, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:193, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:197, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:201, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:311
msgid "Pending payment"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:142, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:146, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:150, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:154
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:146, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:150, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:154, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:158
msgid "Awaiting payment from the buyer."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:158
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:162
msgid "We are veryfing the payment. We will notify you by email in up to 6 hours if everything is fine so that you can deliver the product or provide the service."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:161, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:201, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:205, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:209, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:213, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:225, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:229, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:233, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:237, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:241, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:245, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:249, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:255, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:259, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:263, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:267, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:271, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:275, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:279, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:283, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:287, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:291, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:295, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:299, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:303, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:315, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:321, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:325
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:165, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:205, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:209, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:213, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:217, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:229, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:233, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:237, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:241, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:245, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:249, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:253, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:259, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:263, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:267, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:271, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:275, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:279, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:283, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:287, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:291, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:295, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:299, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:303, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:307, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:319, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:325, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:329
msgid "Declined payment"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:162, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:206, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:210, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:214, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:226, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:246, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:256
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:166, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:210, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:214, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:218, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:230, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:250, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:260
msgid "The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:165
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:169
msgid "Payment authorized. Awaiting capture."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:166
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:170
msgid "The payment has been authorized on the client's card. Please capture the payment."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:169
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:173
msgid "Payment in process"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:170, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:190
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:174, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:194
msgid "Please wait or contact Mercado Pago for further details"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:174
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:178
msgid "The bank is reviewing the payment. As soon as we have their confirmation, we will notify you via email so that you can deliver the product or provide the service."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:178, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:182, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:186
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:182, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:186, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:190
msgid "Awaiting payment information validation."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:194
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:198
msgid "Waiting for the buyer."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:198
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:202
msgid "Waiting for the card issuer."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:202
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:206
msgid "The payment could not be processed. Please ask your client to use another card or to get in touch with the bank."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:217
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:221
msgid "Mercado Pago did not process the payment"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:221, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:311
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:225, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:315
msgid "Expired payment deadline"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:222, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:312
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:226, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:316
msgid "The client did not pay within the time limit."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:230
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:234
msgid "The CVV is invalid. Please ask your client to review the details or use another card."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:234
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:238
msgid "The card is expired. Please ask your client to use another card or to contact the bank."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:238, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:284, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:288
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:242, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:288, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:292
msgid "This payment was declined because it did not pass Mercado Pago security controls. Please ask your client to use another card."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:242, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:280
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:246, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:284
msgid "The buyer is suspended in our platform. Your client must contact us to check what happened."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:251
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:255
msgid "The card does not have enough limit. Please ask your client to use another card or to get in touch with the bank."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:252
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:256
msgid "The card does not have sufficient balance. Please ask your client to use another card or to get in touch with the bank."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:260
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:264
msgid "The CVV was entered incorrectly several times. Please ask your client to use another card or to get in touch with the bank."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:264
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:268
msgid "The card does not allow the number of installments entered. Please ask your client to choose another installment plan or to use another card."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:268
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:272
msgid "The card-issuing bank declined the payment. Please instruct your client to ask the bank to authotize it or to use another card."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:272
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:276
msgid "From Mercado Pago we have detected that this payment has already been made before. If that is not the case, your client may try to pay again."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:276
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:280
msgid "The card is not active yet. Please ask your client to use another card or to get in touch with the bank to activate it."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:292
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:296
msgid "The amount exceeded the card limit. Please ask your client to use another card or to get in touch with the bank."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:296, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:300, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:304
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:300, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:304, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:308
msgid "Please ask your client to use another card or to get in touch with the card issuer."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:308
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:312
msgid "The amount exceeded the card's limit. Please ask your client to use another card or to get in touch with the bank."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:317
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:321
msgid "The credit function is not enabled for the card. Please tell your client that it is possible to pay with debit or to use another one."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:318
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:322
msgid "The debit function is not enabled for the card. Please tell your client that it is possible to pay with credit or to use another one."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:322
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:326
msgid "The card-issuing bank declined the payment. Please instruct your client to ask the bank to authorize it."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:326
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:330
msgid "The buyer does not have enough balance to make the purchase. Please ask your client to deposit money to the Mercado Pago Account or to use a different payment method."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:329
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:333
msgid "There was an error"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:330
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:334
msgid "The transaction could not be completed."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:413
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:417
msgid "Payment status on Mercado Pago"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:473, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:485
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:477, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:489
msgid "View purchase details at Mercado Pago"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:474, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:486, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:498
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:478, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:490, ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:502
msgid "Sync order status"
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:497
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:501
msgid "Check the reasons why the purchase was declined."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:606
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:608
msgid "Order update successfully. This page will be reloaded..."
msgstr ""
-#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:610
+#: ../../includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php:612
msgid "Unable to update order: "
msgstr ""
@@ -1885,35 +1885,35 @@ msgstr ""
msgid " and fee of"
msgstr ""
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:547
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:545
msgid "Public Key production credential is invalid. Review the field to receive real payments."
msgstr ""
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:556
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:554
msgid "Public Key test credential is invalid. Review the field to perform tests in your store."
msgstr ""
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:565
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:563
msgid "Access Token production credential is invalid. Remember that it must be complete to receive real payments."
msgstr ""
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:574
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:572
msgid "Access Token test credential is invalid. Review the field to perform tests in your store."
msgstr ""
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:592
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:590
msgid "Public Key test credential is blank. Review the field to perform tests in your store."
msgstr ""
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:601
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:599
msgid "Public Key production credential is blank. Review the field to receive real payments."
msgstr ""
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:610
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:608
msgid "Access Token test credential is blank. Review the field to perform tests in your store."
msgstr ""
-#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:619
+#: ../../includes/payments/hooks/class-wc-woomercadopago-hook-abstract.php:617
msgid "Access Token production credential is blank. Remember that it must be complete to receive real payments."
msgstr ""
diff --git a/includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php b/includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php
index eca45ab45..0835ee0c8 100644
--- a/includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php
+++ b/includes/admin/hooks/class-wc-woomercadopago-hook-order-details.php
@@ -1,636 +1,625 @@
nonce = WC_WooMercadoPago_Helper_Nonce::get_instance();
- $this->current_user = WC_WooMercadoPago_Helper_Current_User::get_instance();
-
- $this->load_hooks();
- }
-
- /**
- * Load Hooks
- *
- * @return void
- */
- public function load_hooks() {
- //hook for post
- add_action( 'add_meta_boxes_shop_order', array( $this, 'payment_status_metabox' ) );
-
- //hook for order
- add_action( 'add_meta_boxes_woocommerce_page_wc-orders', array( $this, 'payment_status_metabox' ) );
- add_action( 'wp_ajax_mp_sync_payment_status', array( $this, 'mercadopago_sync_payment_status' ) );
- }
-
- /**
- * Load Scripts
- *
- * @return void
- */
- public function load_scripts( $order ) {
-
- $suffix = $this->get_suffix();
- $script_name = 'mp_payment_status_metabox';
-
- if ( is_admin() ) {
-
- wp_enqueue_script(
- $script_name,
- plugins_url( '../../assets/js/payment_status_metabox' . $suffix . '.js', plugin_dir_path( __FILE__ ) ),
- array(),
- WC_WooMercadoPago_Constants::VERSION,
- false
- );
-
- wp_localize_script($script_name, $script_name . '_vars', [
- 'order_id' => $order->get_id(),
- 'nonce' => $this->nonce->generate_nonce(self::NONCE_ID),
- ]);
- }
- }
-
- /**
- * Get suffix to static files
- */
- public function get_suffix() {
- return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
- }
-
- /**
- * Get Alert Description
- *
- * @param $payment_status_detail
- * @param $is_credit_card
- *
- * @return array
- */
- public function get_alert_description( $payment_status_detail, $is_credit_card ) {
- $all_status_detail = [
- 'accredited' => array(
- 'alert_title' => __( 'Payment made', 'woocommerce-mercadopago' ),
- 'description' => __( 'Payment made by the buyer and already credited in the account.', 'woocommerce-mercadopago' ),
- ),
- 'settled' => array(
- 'alert_title' => __( 'Call resolved', 'woocommerce-mercadopago' ),
- 'description' => __( 'Please contact Mercado Pago for further details.', 'woocommerce-mercadopago' ),
- ),
- 'reimbursed' => array(
- 'alert_title' => __( 'Payment refunded', 'woocommerce-mercadopago' ),
- 'description' => __( 'Your refund request has been made. Please contact Mercado Pago for further details.', 'woocommerce-mercadopago' ),
- ),
- 'refunded' => array(
- 'alert_title' => __( 'Payment returned', 'woocommerce-mercadopago' ),
- 'description' => __( 'The payment has been returned to the client.', 'woocommerce-mercadopago' ),
- ),
- 'partially_refunded' => array(
- 'alert_title' => __( 'Payment returned', 'woocommerce-mercadopago' ),
- 'description' => __( 'The payment has been partially returned to the client.', 'woocommerce-mercadopago' ),
- ),
- 'by_collector' => array(
- 'alert_title' => __( 'Payment canceled', 'woocommerce-mercadopago' ),
- 'description' => __( 'The payment has been successfully canceled.', 'woocommerce-mercadopago' ),
- ),
- 'by_payer' => array(
- 'alert_title' => __( 'Purchase canceled', 'woocommerce-mercadopago' ),
- 'description' => __( 'The payment has been canceled by the customer.', 'woocommerce-mercadopago' ),
- ),
- 'pending' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Awaiting payment from the buyer.', 'woocommerce-mercadopago' ),
- ),
- 'pending_waiting_payment' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Awaiting payment from the buyer.', 'woocommerce-mercadopago' ),
- ),
- 'pending_waiting_for_remedy' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Awaiting payment from the buyer.', 'woocommerce-mercadopago' ),
- ),
- 'pending_waiting_transfer' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Awaiting payment from the buyer.', 'woocommerce-mercadopago' ),
- ),
- 'pending_review_manual' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'We are veryfing the payment. We will notify you by email in up to 6 hours if everything is fine so that you can deliver the product or provide the service.', 'woocommerce-mercadopago' ),
- ),
- 'waiting_bank_confirmation' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'pending_capture' => array(
- 'alert_title' => __( 'Payment authorized. Awaiting capture.', 'woocommerce-mercadopago' ),
- 'description' => __( "The payment has been authorized on the client's card. Please capture the payment.", 'woocommerce-mercadopago' ),
- ),
- 'in_process' => array(
- 'alert_title' => __( 'Payment in process', 'woocommerce-mercadopago' ),
- 'description' => __( 'Please wait or contact Mercado Pago for further details', 'woocommerce-mercadopago' ),
- ),
- 'pending_contingency' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The bank is reviewing the payment. As soon as we have their confirmation, we will notify you via email so that you can deliver the product or provide the service.', 'woocommerce-mercadopago' ),
- ),
- 'pending_card_validation' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Awaiting payment information validation.', 'woocommerce-mercadopago' ),
- ),
- 'pending_online_validation' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Awaiting payment information validation.', 'woocommerce-mercadopago' ),
- ),
- 'pending_additional_info' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Awaiting payment information validation.', 'woocommerce-mercadopago' ),
- ),
- 'offline_process' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Please wait or contact Mercado Pago for further details', 'woocommerce-mercadopago' ),
- ),
- 'pending_challenge' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Waiting for the buyer.', 'woocommerce-mercadopago' ),
- ),
- 'pending_provider_response' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Waiting for the card issuer.', 'woocommerce-mercadopago' ),
- ),
- 'bank_rejected' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The payment could not be processed. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'rejected_by_bank' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'rejected_insufficient_data' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'bank_error' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'by_admin' => array(
- 'alert_title' => __( 'Mercado Pago did not process the payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Please contact Mercado Pago for further details.', 'woocommerce-mercadopago' ),
- ),
- 'expired' => array(
- 'alert_title' => __( 'Expired payment deadline', 'woocommerce-mercadopago' ),
- 'description' => __( 'The client did not pay within the time limit.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_bad_filled_card_number' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_bad_filled_security_code' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The CVV is invalid. Please ask your client to review the details or use another card.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_bad_filled_date' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card is expired. Please ask your client to use another card or to contact the bank.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_high_risk' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'This payment was declined because it did not pass Mercado Pago security controls. Please ask your client to use another card.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_fraud' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The buyer is suspended in our platform. Your client must contact us to check what happened.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_blacklist' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_insufficient_amount' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => $is_credit_card
- ? __( 'The card does not have enough limit. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' )
- : __( 'The card does not have sufficient balance. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_other_reason' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_max_attempts' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The CVV was entered incorrectly several times. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_invalid_installments' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card does not allow the number of installments entered. Please ask your client to choose another installment plan or to use another card.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_call_for_authorize' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card-issuing bank declined the payment. Please instruct your client to ask the bank to authotize it or to use another card.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_duplicated_payment' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'From Mercado Pago we have detected that this payment has already been made before. If that is not the case, your client may try to pay again.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_card_disabled' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card is not active yet. Please ask your client to use another card or to get in touch with the bank to activate it.', 'woocommerce-mercadopago' ),
- ),
- 'payer_unavailable' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The buyer is suspended in our platform. Your client must contact us to check what happened.', 'woocommerce-mercadopago' ),
- ),
- 'rejected_high_risk' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'This payment was declined because it did not pass Mercado Pago security controls. Please ask your client to use another card.', 'woocommerce-mercadopago' ),
- ),
- 'rejected_by_regulations' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'This payment was declined because it did not pass Mercado Pago security controls. Please ask your client to use another card.', 'woocommerce-mercadopago' ),
- ),
- 'rejected_cap_exceeded' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The amount exceeded the card limit. Please ask your client to use another card or to get in touch with the bank.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_3ds_challenge' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Please ask your client to use another card or to get in touch with the card issuer.', 'woocommerce-mercadopago' ),
- ),
- 'rejected_other_reason' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Please ask your client to use another card or to get in touch with the card issuer.', 'woocommerce-mercadopago' ),
- ),
- 'authorization_revoked' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'Please ask your client to use another card or to get in touch with the card issuer.', 'woocommerce-mercadopago' ),
- ),
- 'cc_amount_rate_limit_exceeded' => array(
- 'alert_title' => __( 'Pending payment', 'woocommerce-mercadopago' ),
- 'description' => __( "The amount exceeded the card's limit. Please ask your client to use another card or to get in touch with the bank.", 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_expired_operation' => array(
- 'alert_title' => __( 'Expired payment deadline', 'woocommerce-mercadopago' ),
- 'description' => __( 'The client did not pay within the time limit.', 'woocommerce-mercadopago' ),
- ),
- 'cc_rejected_bad_filled_other' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => $is_credit_card
- ? __( 'The credit function is not enabled for the card. Please tell your client that it is possible to pay with debit or to use another one.', 'woocommerce-mercadopago' )
- : __( 'The debit function is not enabled for the card. Please tell your client that it is possible to pay with credit or to use another one.', 'woocommerce-mercadopago' ),
- ),
- 'rejected_call_for_authorize' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The card-issuing bank declined the payment. Please instruct your client to ask the bank to authorize it.', 'woocommerce-mercadopago' ),
- ),
- 'am_insufficient_amount' => array(
- 'alert_title' => __( 'Declined payment', 'woocommerce-mercadopago' ),
- 'description' => __( 'The buyer does not have enough balance to make the purchase. Please ask your client to deposit money to the Mercado Pago Account or to use a different payment method.', 'woocommerce-mercadopago' ),
- ),
- 'generic' => array(
- 'alert_title' => __( 'There was an error', 'woocommerce-mercadopago' ),
- 'description' => __( 'The transaction could not be completed.', 'woocommerce-mercadopago' ),
- ),
- ];
-
- return array_key_exists($payment_status_detail, $all_status_detail)
- ? $all_status_detail[$payment_status_detail]
- : $all_status_detail['generic'];
- }
-
- /**
- * Get Alert Status
- *
- * @param $payment_status
- *
- * @return string 'success' | 'pending' | 'rejected' | 'refunded' | 'charged_back'
- */
- public function get_alert_status( $payment_status ) {
- $all_payment_status = [
- 'approved' => 'success',
- 'authorized' => 'success',
- 'pending' => 'pending',
- 'in_process' => 'pending',
- 'in_mediation' => 'pending',
- 'rejected' => 'rejected',
- 'canceled' => 'rejected',
- 'refunded' => 'refunded',
- 'charged_back' => 'charged_back',
- 'generic' => 'rejected'
- ];
-
- return array_key_exists($payment_status, $all_payment_status) ? $all_payment_status[$payment_status] : $all_payment_status['generic'];
- }
-
- /**
- * Get Order from Post
- *
- * @param $post
- *
- * @return bool|WC_Order|WC_Order_Refund
- */
- private function get_order( $post ) {
- if ( $this->order instanceof WC_Order ) {
- return $this->order;
- }
-
- if ( is_null($post->ID) ) {
- return false;
- }
-
- $this->order = wc_get_order($post->ID);
-
- if ( ! $this->order ) {
- return false;
- }
-
- return $this->order;
- }
-
- /**
- * Create payment status metabox
- *
- * @param WP_Post $post
- *
- * @return void
- */
- public function payment_status_metabox( $post_or_order_object ) {
- $order = ( $post_or_order_object instanceof WP_Post ) ? wc_get_order( $post_or_order_object->ID ) : $post_or_order_object;
-
- $this->load_scripts($order);
-
- if ( ! $order ) {
- return;
- }
-
- $payment_method = $order->get_payment_method();
- $is_mercadopago_payment_method = in_array($payment_method, WC_WooMercadoPago_Constants::GATEWAYS_IDS, true);
-
- if ( ! $is_mercadopago_payment_method ) {
- return;
- }
-
- add_meta_box(
- 'mp-payment-status-metabox',
- __( 'Payment status on Mercado Pago', 'woocommerce-mercadopago' ),
- [$this, 'payment_status_metabox_content']
- );
- }
-
- /**
- * Payment Status Metabox Content
- *
- * @param wc_get_order $order
- *
- * @return void
- * @throws WC_WooMercadoPago_Exception
- */
- public function payment_status_metabox_content( $order ) {
- $payment = $this->get_payment($order);
-
- if ( ! $payment ) {
- return;
- }
-
- $payment_status = $payment['response']['status'];
- $payment_status_details = $payment['response']['status_detail'];
-
- if ( ! $payment['response']['payment_type_id'] && (
- 'cc_rejected_bad_filled_other' === $payment_status_details ||
- 'cc_rejected_insufficient_amount' === $payment_status_details
- ) ) {
- return;
- }
-
- $is_credit_card = 'credit_card' === $payment['response']['payment_type_id'];
- $alert_status = $this->get_alert_status($payment_status);
- $alert_description = $this->get_alert_description($payment_status_details, $is_credit_card);
- $metabox_data = $this->get_metabox_data($alert_status, $alert_description);
-
- wc_get_template(
- 'order/payment-status-metabox-content.php',
- $metabox_data,
- 'woo/mercado/pago/module/',
- WC_WooMercadoPago_Module::get_templates_path()
- );
- }
-
- /**
- * Metabolic Data
- *
- * @param $alert_status
- * @param $alert
- * @return Array
- */
- public function get_metabox_data( $alert_status, $alert ) {
- $country = strtolower(get_option( 'checkout_country', '' ));
-
- if ( 'success' === $alert_status ) {
- return [
- 'img_src' => esc_url( plugins_url( '../../assets/images/generics/circle-green-check.png', plugin_dir_path( __FILE__ ) ) ),
- 'alert_title' => $alert['alert_title'],
- 'alert_description' => $alert['description'],
- 'link' => $this->get_mp_home_link($country),
- 'border_left_color' => '#00A650',
- 'link_description' => __( 'View purchase details at Mercado Pago', 'woocommerce-mercadopago' ),
- 'sync_button_text' => __( 'Sync order status', 'woocommerce-mercadopago' ),
- ];
- }
-
- if ( 'pending' === $alert_status ) {
- return [
- 'img_src' => esc_url( plugins_url( '../../assets/images/generics/circle-alert.png', plugin_dir_path( __FILE__ ) ) ),
- 'alert_title' => $alert['alert_title'],
- 'alert_description' => $alert['description'],
- 'link' => $this->get_mp_home_link($country),
- 'border_left_color' => '#f73',
- 'link_description' => __( 'View purchase details at Mercado Pago', 'woocommerce-mercadopago' ),
- 'sync_button_text' => __( 'Sync order status', 'woocommerce-mercadopago' ),
- ];
- }
-
- if ( 'rejected' === $alert_status || 'refunded' === $alert_status || 'charged_back' === $alert_status ) {
- return [
- 'img_src' => esc_url( plugins_url( '../../assets/images/generics/circle-red-alert.png', plugin_dir_path( __FILE__ ) ) ),
- 'alert_title' => $alert['alert_title'],
- 'alert_description' => $alert['description'],
- 'link' => $this->get_mp_devsite_link($country),
- 'border_left_color' => '#F23D4F',
- 'link_description' => __( 'Check the reasons why the purchase was declined.', 'woocommerce-mercadopago' ),
- 'sync_button_text' => __( 'Sync order status', 'woocommerce-mercadopago' ),
- ];
- }
- }
-
- /**
- * Get Mercado Pago Home Link
- *
- * @param String $country Country Acronym
- *
- * @return String
- */
- public function get_mp_home_link( $country ) {
- $country_links = [
- 'mla' => 'https://www.mercadopago.com.ar/home',
- 'mlb' => 'https://www.mercadopago.com.br/home',
- 'mlc' => 'https://www.mercadopago.cl/home',
- 'mco' => 'https://www.mercadopago.com.co/home',
- 'mlm' => 'https://www.mercadopago.com.mx/home',
- 'mpe' => 'https://www.mercadopago.com.pe/home',
- 'mlu' => 'https://www.mercadopago.com.uy/home',
- ];
-
- return array_key_exists($country, $country_links) ? $country_links[$country] : $country_links['mla'];
- }
-
- /**
- * Get Mercado Pago Devsite Page Link
- *
- * @param String $country Country Acronym
- *
- * @return String
- */
- public function get_mp_devsite_link( $country ) {
- $country_links = [
- 'mla' => 'https://www.mercadopago.com.ar/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
- 'mlb' => 'https://www.mercadopago.com.br/developers/pt/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_recusas',
- 'mlc' => 'https://www.mercadopago.cl/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
- 'mco' => 'https://www.mercadopago.com.co/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
- 'mlm' => 'https://www.mercadopago.com.mx/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
- 'mpe' => 'https://www.mercadopago.com.pe/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
- 'mlu' => 'https://www.mercadopago.com.uy/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
- ];
-
- return array_key_exists($country, $country_links) ? $country_links[$country] : $country_links['mla'];
- }
-
- /**
- * Get payment
- *
- * @return array|null
- * @throws WC_WooMercadoPago_Exception
- */
- public function get_payment( $post_or_order_object ) {
-
- $order = ( $post_or_order_object instanceof WP_Post ) ? wc_get_order( $post_or_order_object->ID ) : $post_or_order_object;
-
- if ( ! $order ) {
- return null;
- }
-
- $payment_ids = explode(',', $order->get_meta( '_Mercado_Pago_Payment_IDs' ));
-
- if ( empty( $payment_ids ) ) {
- return null;
- }
-
- $last_payment_id = end($payment_ids);
- $is_production_mode = $order->get_meta( 'is_production_mode' );
- $access_token = 'no' === $is_production_mode || ! $is_production_mode
- ? get_option( '_mp_access_token_test' )
- : get_option( '_mp_access_token_prod' );
-
- $mp = new MP($access_token);
- $payment = $mp->search_payment_v1(trim($last_payment_id), $access_token);
-
- if ( ! $payment || 200 !== $payment['status'] ) {
- return null;
- }
-
- return $payment;
- }
-
- /**
- * Sync order status
- *
- * @return void
- */
- public function mercadopago_sync_payment_status() {
- try {
- $this->current_user->validate_user_needed_permissions();
- $this->nonce->validate_nonce(
- self::NONCE_ID,
- WC_WooMercadoPago_Helper_Filter::get_sanitize_text_from_post( 'nonce' )
- );
-
- $order = wc_get_order( (int) WC_WooMercadoPago_Helper_Filter::get_sanitize_text_from_post( 'order_id' ) );
- $payment = $this->get_payment( $order );
- $status = $payment['response']['status'];
-
- $gateway = $order->get_payment_method();
- $used_gateway = $this->get_wc_gateway_name_for_class_name($gateway);
-
- ( new WC_WooMercadoPago_Order() )->process_status($status, $payment, $order, $used_gateway);
-
- wp_send_json_success(
- __( 'Order update successfully. This page will be reloaded...', 'woocommerce-mercadopago' )
- );
- } catch ( Exception $e ) {
- wp_send_json_error(
- __( 'Unable to update order: ', 'woocommerce-mercadopago' ) . $e->getMessage(),
- 500
- );
- }
- }
-
- /**
- * Convert mercadopago gateway name for class name
- *
- * @param $gateway
- *
- * @return string|null
- */
- public function get_wc_gateway_name_for_class_name( $gateway ) {
- $classes_name = [
- 'woo-mercado-pago-pix' => 'WC_WooMercadoPago_Pix_Gateway',
- 'woo-mercado-pago-basic' => 'WC_WooMercadoPago_Basic_Gateway',
- 'woo-mercado-pago-ticket' => 'WC_WooMercadoPago_Ticket_Gateway',
- 'woo-mercado-pago-custom' => 'WC_WooMercadoPago_Custom_Gateway',
- 'woo-mercado-pago-credits' => 'WC_WooMercadoPago_Credits_Gateway',
- ];
-
- return array_key_exists ( $gateway, $classes_name ) ? $classes_name[ $gateway ] : null;
- }
+ public const NONCE_ID = 'mp_hook_order_details_nonce';
+
+ /**
+ * WC_Order
+ *
+ * @var WC_Order
+ */
+ protected $order;
+
+ /**
+ * Nonce
+ *
+ * @var WC_WooMercadoPago_Helper_Nonce
+ */
+ protected $nonce;
+
+ /**
+ * Current User
+ *
+ * @var WC_WooMercadoPago_Helper_Current_User
+ */
+ protected $current_user;
+
+ /**
+ * Gateway
+ *
+ * @var string
+ */
+ protected $gateway;
+
+ public function __construct() {
+ $this->nonce = WC_WooMercadoPago_Helper_Nonce::get_instance();
+ $this->current_user = WC_WooMercadoPago_Helper_Current_User::get_instance();
+
+ $this->load_hooks();
+ }
+
+ /**
+ * Load Hooks
+ *
+ * @return void
+ */
+ public function load_hooks(): void {
+ //hook for post
+ add_action( 'add_meta_boxes_shop_order', array($this, 'payment_status_metabox') );
+
+ //hook for order
+ add_action( 'add_meta_boxes_woocommerce_page_wc-orders', array($this, 'payment_status_metabox') );
+ add_action( 'wp_ajax_mp_sync_payment_status', array($this, 'mercadopago_sync_payment_status') );
+ }
+
+ /**
+ * Load Scripts
+ *
+ * @return void
+ */
+ public function load_scripts( $order ): void {
+ $suffix = $this->get_suffix();
+ $script_name = 'mp_payment_status_metabox';
+
+ if ( is_admin() ) {
+ wp_enqueue_script(
+ $script_name,
+ plugins_url( '../../assets/js/payment_status_metabox' . $suffix . '.js', plugin_dir_path( __FILE__ ) ),
+ array(),
+ WC_WooMercadoPago_Constants::VERSION,
+ false
+ );
+
+ wp_localize_script($script_name, $script_name . '_vars', array(
+ 'order_id' => $order->get_id(),
+ 'nonce' => $this->nonce->generate_nonce(self::NONCE_ID),
+ ));
+ }
+ }
+
+ /**
+ * Get suffix to static files
+ */
+ public function get_suffix() {
+ return defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
+ }
+
+ /**
+ * Get Alert Description
+ *
+ * @param $payment_status_detail
+ * @param $is_credit_card
+ *
+ * @return array
+ */
+ public function get_alert_description( $payment_status_detail, $is_credit_card ) {
+ $all_status_detail = array(
+ 'accredited' => array(
+ 'alert_title' => __( 'Payment made', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Payment made by the buyer and already credited in the account.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'settled' => array(
+ 'alert_title' => __( 'Call resolved', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Please contact Mercado Pago for further details.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'reimbursed' => array(
+ 'alert_title' => __( 'Payment refunded', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Your refund request has been made. Please contact Mercado Pago for further details.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'refunded' => array(
+ 'alert_title' => __( 'Payment returned', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The payment has been returned to the client.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'partially_refunded' => array(
+ 'alert_title' => __( 'Payment returned', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The payment has been partially returned to the client.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'by_collector' => array(
+ 'alert_title' => __( 'Payment canceled', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The payment has been successfully canceled.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'by_payer' => array(
+ 'alert_title' => __( 'Purchase canceled', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The payment has been canceled by the customer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Awaiting payment from the buyer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_waiting_payment' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Awaiting payment from the buyer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_waiting_for_remedy' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Awaiting payment from the buyer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_waiting_transfer' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Awaiting payment from the buyer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_review_manual' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'We are veryfing the payment. We will notify you by email in up to 6 hours if everything is fine so that you can deliver the product or provide the service.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'waiting_bank_confirmation' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_capture' => array(
+ 'alert_title' => __( 'Payment authorized. Awaiting capture.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( "The payment has been authorized on the client's card. Please capture the payment.", LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'in_process' => array(
+ 'alert_title' => __( 'Payment in process', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Please wait or contact Mercado Pago for further details', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_contingency' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The bank is reviewing the payment. As soon as we have their confirmation, we will notify you via email so that you can deliver the product or provide the service.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_card_validation' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Awaiting payment information validation.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_online_validation' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Awaiting payment information validation.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_additional_info' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Awaiting payment information validation.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'offline_process' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Please wait or contact Mercado Pago for further details', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_challenge' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Waiting for the buyer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'pending_provider_response' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Waiting for the card issuer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'bank_rejected' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The payment could not be processed. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'rejected_by_bank' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'rejected_insufficient_data' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'bank_error' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'by_admin' => array(
+ 'alert_title' => __( 'Mercado Pago did not process the payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Please contact Mercado Pago for further details.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'expired' => array(
+ 'alert_title' => __( 'Expired payment deadline', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The client did not pay within the time limit.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_bad_filled_card_number' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_bad_filled_security_code' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The CVV is invalid. Please ask your client to review the details or use another card.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_bad_filled_date' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card is expired. Please ask your client to use another card or to contact the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_high_risk' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'This payment was declined because it did not pass Mercado Pago security controls. Please ask your client to use another card.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_fraud' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The buyer is suspended in our platform. Your client must contact us to check what happened.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_blacklist' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_insufficient_amount' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => $is_credit_card
+ ? __( 'The card does not have enough limit. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN )
+ : __( 'The card does not have sufficient balance. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_other_reason' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card-issuing bank declined the payment. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_max_attempts' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The CVV was entered incorrectly several times. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_invalid_installments' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card does not allow the number of installments entered. Please ask your client to choose another installment plan or to use another card.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_call_for_authorize' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card-issuing bank declined the payment. Please instruct your client to ask the bank to authotize it or to use another card.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_duplicated_payment' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'From Mercado Pago we have detected that this payment has already been made before. If that is not the case, your client may try to pay again.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_card_disabled' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card is not active yet. Please ask your client to use another card or to get in touch with the bank to activate it.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'payer_unavailable' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The buyer is suspended in our platform. Your client must contact us to check what happened.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'rejected_high_risk' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'This payment was declined because it did not pass Mercado Pago security controls. Please ask your client to use another card.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'rejected_by_regulations' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'This payment was declined because it did not pass Mercado Pago security controls. Please ask your client to use another card.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'rejected_cap_exceeded' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The amount exceeded the card limit. Please ask your client to use another card or to get in touch with the bank.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_3ds_challenge' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Please ask your client to use another card or to get in touch with the card issuer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'rejected_other_reason' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Please ask your client to use another card or to get in touch with the card issuer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'authorization_revoked' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'Please ask your client to use another card or to get in touch with the card issuer.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_amount_rate_limit_exceeded' => array(
+ 'alert_title' => __( 'Pending payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( "The amount exceeded the card's limit. Please ask your client to use another card or to get in touch with the bank.", LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_expired_operation' => array(
+ 'alert_title' => __( 'Expired payment deadline', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The client did not pay within the time limit.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'cc_rejected_bad_filled_other' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => $is_credit_card
+ ? __( 'The credit function is not enabled for the card. Please tell your client that it is possible to pay with debit or to use another one.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN )
+ : __( 'The debit function is not enabled for the card. Please tell your client that it is possible to pay with credit or to use another one.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'rejected_call_for_authorize' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The card-issuing bank declined the payment. Please instruct your client to ask the bank to authorize it.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'am_insufficient_amount' => array(
+ 'alert_title' => __( 'Declined payment', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The buyer does not have enough balance to make the purchase. Please ask your client to deposit money to the Mercado Pago Account or to use a different payment method.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'generic' => array(
+ 'alert_title' => __( 'There was an error', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'description' => __( 'The transaction could not be completed.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ );
+
+ return array_key_exists($payment_status_detail, $all_status_detail)
+ ? $all_status_detail[$payment_status_detail]
+ : $all_status_detail['generic'];
+ }
+
+ /**
+ * Get Alert Status
+ *
+ * @param $payment_status
+ *
+ * @return string 'success' | 'pending' | 'rejected' | 'refunded' | 'charged_back'
+ */
+ public function get_alert_status( $payment_status ) {
+ $all_payment_status = array(
+ 'approved' => 'success',
+ 'authorized' => 'success',
+ 'pending' => 'pending',
+ 'in_process' => 'pending',
+ 'in_mediation' => 'pending',
+ 'rejected' => 'rejected',
+ 'canceled' => 'rejected',
+ 'refunded' => 'refunded',
+ 'charged_back' => 'charged_back',
+ 'generic' => 'rejected'
+ );
+
+ return array_key_exists($payment_status, $all_payment_status) ? $all_payment_status[$payment_status] : $all_payment_status['generic'];
+ }
+
+ /**
+ * Get Order from Post
+ *
+ * @param $post
+ *
+ * @return bool|WC_Order|WC_Order_Refund
+ */
+ private function get_order( $post ) {
+ if ( $this->order instanceof WC_Order ) {
+ return $this->order;
+ }
+
+ if ( is_null($post->ID) ) {
+ return false;
+ }
+
+ $this->order = wc_get_order($post->ID);
+
+ if ( ! $this->order ) {
+ return false;
+ }
+
+ return $this->order;
+ }
+
+ /**
+ * Create payment status metabox
+ *
+ * @param WP_Post $post
+ *
+ * @return void
+ */
+ public function payment_status_metabox( $post_or_order_object ): void {
+ $order = ( $post_or_order_object instanceof WP_Post ) ? wc_get_order( $post_or_order_object->ID ) : $post_or_order_object;
+
+ $this->load_scripts($order);
+
+ if ( ! $order ) {
+ return;
+ }
+
+ $payment_method = $order->get_payment_method();
+ $is_mercadopago_payment_method = in_array($payment_method, WC_WooMercadoPago_Constants::GATEWAYS_IDS, true);
+
+ if ( ! $is_mercadopago_payment_method ) {
+ return;
+ }
+
+ add_meta_box(
+ 'mp-payment-status-metabox',
+ __( 'Payment status on Mercado Pago', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ array($this, 'payment_status_metabox_content')
+ );
+ }
+
+ /**
+ * Payment Status Metabox Content
+ *
+ * @param wc_get_order $order
+ *
+ * @return void
+ * @throws WC_WooMercadoPago_Exception
+ */
+ public function payment_status_metabox_content( $order ): void {
+ $payment = $this->get_payment($order);
+
+ if ( ! $payment ) {
+ return;
+ }
+
+ $payment_status = $payment['response']['status'];
+ $payment_status_details = $payment['response']['status_detail'];
+
+ if ( ! $payment['response']['payment_type_id'] && (
+ 'cc_rejected_bad_filled_other' === $payment_status_details ||
+ 'cc_rejected_insufficient_amount' === $payment_status_details
+ ) ) {
+ return;
+ }
+
+ $is_credit_card = 'credit_card' === $payment['response']['payment_type_id'];
+ $alert_status = $this->get_alert_status($payment_status);
+ $alert_description = $this->get_alert_description($payment_status_details, $is_credit_card);
+ $metabox_data = $this->get_metabox_data($alert_status, $alert_description);
+
+ wc_get_template(
+ 'order/payment-status-metabox-content.php',
+ $metabox_data,
+ 'woo/mercado/pago/module/',
+ WC_WooMercadoPago_Module::get_templates_path()
+ );
+ }
+
+ /**
+ * Metabolic Data
+ *
+ * @param $alert_status
+ * @param $alert
+ * @return Array
+ */
+ public function get_metabox_data( $alert_status, $alert ) {
+ $country = strtolower(get_option( 'checkout_country', '' ));
+
+ if ( 'success' === $alert_status ) {
+ return array(
+ 'img_src' => esc_url( plugins_url( '../../assets/images/generics/circle-green-check.png', plugin_dir_path( __FILE__ ) ) ),
+ 'alert_title' => $alert['alert_title'],
+ 'alert_description' => $alert['description'],
+ 'link' => $this->get_mp_home_link($country),
+ 'border_left_color' => '#00A650',
+ 'link_description' => __( 'View purchase details at Mercado Pago', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'sync_button_text' => __( 'Sync order status', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ );
+ }
+
+ if ( 'pending' === $alert_status ) {
+ return array(
+ 'img_src' => esc_url( plugins_url( '../../assets/images/generics/circle-alert.png', plugin_dir_path( __FILE__ ) ) ),
+ 'alert_title' => $alert['alert_title'],
+ 'alert_description' => $alert['description'],
+ 'link' => $this->get_mp_home_link($country),
+ 'border_left_color' => '#f73',
+ 'link_description' => __( 'View purchase details at Mercado Pago', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'sync_button_text' => __( 'Sync order status', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ );
+ }
+
+ if ( 'rejected' === $alert_status || 'refunded' === $alert_status || 'charged_back' === $alert_status ) {
+ return array(
+ 'img_src' => esc_url( plugins_url( '../../assets/images/generics/circle-red-alert.png', plugin_dir_path( __FILE__ ) ) ),
+ 'alert_title' => $alert['alert_title'],
+ 'alert_description' => $alert['description'],
+ 'link' => $this->get_mp_devsite_link($country),
+ 'border_left_color' => '#F23D4F',
+ 'link_description' => __( 'Check the reasons why the purchase was declined.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'sync_button_text' => __( 'Sync order status', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ );
+ }
+ }
+
+ /**
+ * Get Mercado Pago Home Link
+ *
+ * @param String $country Country Acronym
+ *
+ * @return String
+ */
+ public function get_mp_home_link( $country ) {
+ $country_links = array(
+ 'mla' => 'https://www.mercadopago.com.ar/home',
+ 'mlb' => 'https://www.mercadopago.com.br/home',
+ 'mlc' => 'https://www.mercadopago.cl/home',
+ 'mco' => 'https://www.mercadopago.com.co/home',
+ 'mlm' => 'https://www.mercadopago.com.mx/home',
+ 'mpe' => 'https://www.mercadopago.com.pe/home',
+ 'mlu' => 'https://www.mercadopago.com.uy/home',
+ );
+
+ return array_key_exists($country, $country_links) ? $country_links[$country] : $country_links['mla'];
+ }
+
+ /**
+ * Get Mercado Pago Devsite Page Link
+ *
+ * @param String $country Country Acronym
+ *
+ * @return String
+ */
+ public function get_mp_devsite_link( $country ) {
+ $country_links = array(
+ 'mla' => 'https://www.mercadopago.com.ar/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
+ 'mlb' => 'https://www.mercadopago.com.br/developers/pt/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_recusas',
+ 'mlc' => 'https://www.mercadopago.cl/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
+ 'mco' => 'https://www.mercadopago.com.co/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
+ 'mlm' => 'https://www.mercadopago.com.mx/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
+ 'mpe' => 'https://www.mercadopago.com.pe/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
+ 'mlu' => 'https://www.mercadopago.com.uy/developers/es/guides/plugins/woocommerce/sales-processing#bookmark_motivos_de_las_recusas',
+ );
+
+ return array_key_exists($country, $country_links) ? $country_links[$country] : $country_links['mla'];
+ }
+
+ /**
+ * Get payment
+ *
+ * @return array|null
+ * @throws WC_WooMercadoPago_Exception
+ */
+ public function get_payment( $post_or_order_object ) {
+ $order = ( $post_or_order_object instanceof WP_Post ) ? wc_get_order( $post_or_order_object->ID ) : $post_or_order_object;
+
+ if ( ! $order ) {
+ return null;
+ }
+
+ $payment_ids = explode(',', $order->get_meta( '_Mercado_Pago_Payment_IDs' ));
+
+ if ( empty( $payment_ids ) ) {
+ return null;
+ }
+
+ $last_payment_id = end($payment_ids);
+ $is_production_mode = $order->get_meta( 'is_production_mode' );
+ $access_token = 'no' === $is_production_mode || ! $is_production_mode
+ ? get_option( '_mp_access_token_test' )
+ : get_option( '_mp_access_token_prod' );
+
+ $mp = new MP($access_token);
+ $payment = $mp->search_payment_v1(trim($last_payment_id), $access_token);
+
+ if ( ! $payment || 200 !== $payment['status'] ) {
+ return null;
+ }
+
+ return $payment;
+ }
+
+ /**
+ * Sync order status
+ *
+ * @return void
+ */
+ public function mercadopago_sync_payment_status(): void {
+ try {
+ $this->current_user->validate_user_needed_permissions();
+ $this->nonce->validate_nonce(
+ self::NONCE_ID,
+ WC_WooMercadoPago_Helper_Filter::get_sanitize_text_from_post( 'nonce' )
+ );
+
+ $order = wc_get_order( (int) WC_WooMercadoPago_Helper_Filter::get_sanitize_text_from_post( 'order_id' ) );
+ $payment = $this->get_payment( $order );
+ $status = $payment['response']['status'];
+
+ $gateway = $order->get_payment_method();
+ $used_gateway = $this->get_wc_gateway_name_for_class_name($gateway);
+
+ ( new WC_WooMercadoPago_Order() )->process_status($status, $payment, $order, $used_gateway);
+
+ wp_send_json_success(
+ __( 'Order update successfully. This page will be reloaded...', LKN_WC_MERCADOPAGO_TEXT_DOMAIN )
+ );
+ } catch ( Exception $e ) {
+ wp_send_json_error(
+ __( 'Unable to update order: ', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) . $e->getMessage(),
+ 500
+ );
+ }
+ }
+
+ /**
+ * Convert mercadopago gateway name for class name
+ *
+ * @param $gateway
+ *
+ * @return string|null
+ */
+ public function get_wc_gateway_name_for_class_name( $gateway ) {
+ $classes_name = array(
+ 'woo-mercado-pago-pix' => 'WC_WooMercadoPago_Pix_Gateway',
+ 'woo-mercado-pago-basic' => 'WC_WooMercadoPago_Basic_Gateway',
+ 'woo-mercado-pago-ticket' => 'WC_WooMercadoPago_Ticket_Gateway',
+ 'woo-mercado-pago-custom' => 'WC_WooMercadoPago_Custom_Gateway',
+ 'woo-mercado-pago-credits' => 'WC_WooMercadoPago_Credits_Gateway',
+ );
+
+ return array_key_exists ( $gateway, $classes_name ) ? $classes_name[ $gateway ] : null;
+ }
}
diff --git a/includes/admin/index.php b/includes/admin/index.php
index 258f3fae9..891711d6d 100644
--- a/includes/admin/index.php
+++ b/includes/admin/index.php
@@ -1,12 +1,5 @@
get_suffix();
-
- wp_enqueue_style(
- 'woocommerce-mercadopago-admin-notice',
- plugins_url( '../../assets/css/admin_notice_mercadopago' . $suffix . '.css', plugin_dir_path( __FILE__ ) ),
- array(),
- WC_WooMercadoPago_Constants::VERSION
- );
- }
- }
-
- /**
- * Alert frame
- *
- * @param string $message message.
- * @param string $type type.
- */
- public static function get_alert_frame( $message, $type ) {
-
- $inline = '';
- if (
- ( class_exists( 'WC_WooMercadoPago_Module' ) && WC_WooMercadoPago_Module::is_wc_new_version() )
- && 'wc-settings' === sanitize_key( isset($_GET['page']) ) // phpcs:disable WordPress.Security.NonceVerification
- ) {
- $inline = 'inline';
- }
-
- $notice = '
' .
- wp_get_current_user()->user_login . ', ' .
- __( 'do you have a minute to share your experience with our plugin?', 'woocommerce-mercadopago' ) .
- '
+ wp_get_current_user()->user_login . ', ' .
+ __( 'do you have a minute to share your experience with our plugin?', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) .
+ '
' .
- __( 'Your opinion is very important so that we can offer you the best possible payment solution and continue to improve.', 'woocommerce-mercadopago' ) .
- '
+ __( 'Your opinion is very important so that we can offer you the best possible payment solution and continue to improve.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) .
+ '
' .
- __( 'Enable payments via Mercado Pago account', 'woocommerce-mercadopago' ) .
- '
+ __( 'Enable payments via Mercado Pago account', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) .
+ '
' .
- __( 'When you enable this function, your customers pay faster using their Mercado Pago accounts.The approval rate of these payments in your store can be 25% higher compared to other payment methods.', 'woocommerce-mercadopago' ) .
- '
+ __( 'When you enable this function, your customers pay faster using their Mercado Pago accounts.The approval rate of these payments in your store can be 25% higher compared to other payment methods.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) .
+ '
- ' . __('With Checkout Pro you sell with all the safety inside Mercado Pago environment.', 'woocommerce-mercadopago') . '
+ ' . __('With Checkout Pro you sell with all the safety inside Mercado Pago environment.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . '
'
- ),
- 'type' => 'title',
- 'class' => 'mp_title_header',
- );
- }
-
- /**
- * Field checkout payments advanced title
- *
- * @return array
- */
- public function field_checkout_payments_advanced_title() {
- return array(
- 'title' => __('Advanced settings', 'woocommerce-mercadopago'),
- 'type' => 'title',
- 'class' => 'mp_subtitle_bd',
- );
- }
-
- /**
- * Field method
- *
- * @return array
- */
- public function field_method() {
- return array(
- 'title' => __('Payment experience', 'woocommerce-mercadopago'),
- 'type' => 'select',
- 'description' => __('Define what payment experience your customers will have, whether inside or outside your store.', 'woocommerce-mercadopago'),
- 'default' => ( 'iframe' === $this->method ) ? 'redirect' : $this->method,
- 'options' => array(
- 'redirect' => __('Redirect', 'woocommerce-mercadopago'),
- 'modal' => __('Modal', 'woocommerce-mercadopago'),
- ),
- );
- }
-
- /**
- * Field success url
- *
- * @return array
- */
- public function field_success_url() {
- // Validate back URL.
- if ( ! empty($this->success_url) && filter_var($this->success_url, FILTER_VALIDATE_URL) === false ) {
- $success_back_url_message = ' ' .
- __('This seems to be an invalid URL.', 'woocommerce-mercadopago') . ' ';
- } else {
- $success_back_url_message = __('Choose the URL that we will show your customers when they finish their purchase.', 'woocommerce-mercadopago');
- }
- return array(
- 'title' => __('Success URL', 'woocommerce-mercadopago'),
- 'type' => 'text',
- 'description' => $success_back_url_message,
- 'default' => '',
- );
- }
-
- /**
- * Field failure url
- *
- * @return array
- */
- public function field_failure_url() {
- if ( ! empty($this->failure_url) && filter_var($this->failure_url, FILTER_VALIDATE_URL) === false ) {
- $fail_back_url_message = ' ' .
- __('This seems to be an invalid URL.', 'woocommerce-mercadopago') . ' ';
- } else {
- $fail_back_url_message = __('Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it.', 'woocommerce-mercadopago');
- }
- return array(
- 'title' => __('Payment URL rejected', 'woocommerce-mercadopago'),
- 'type' => 'text',
- 'description' => $fail_back_url_message,
- 'default' => '',
- );
- }
-
- /**
- * Field pending
- *
- * @return array
- */
- public function field_pending_url() {
- // Validate back URL.
- if ( ! empty($this->pending_url) && filter_var($this->pending_url, FILTER_VALIDATE_URL) === false ) {
- $pending_back_url_message = ' ' .
- __('This seems to be an invalid URL.', 'woocommerce-mercadopago') . ' ';
- } else {
- $pending_back_url_message = __('Choose the URL that we will show to your customers when they have a payment pending approval.', 'woocommerce-mercadopago');
- }
- return array(
- 'title' => __('Payment URL pending', 'woocommerce-mercadopago'),
- 'type' => 'text',
- 'description' => $pending_back_url_message,
- 'default' => '',
- );
- }
-
- /**
- * Field payments
- *
- * @return array
- */
- public function field_ex_payments() {
- $payment_list = array(
- 'description' => __('Enable the payment methods available to your clients.', 'woocommerce-mercadopago'),
- 'title' => __('Choose the payment methods you accept in your store', 'woocommerce-mercadopago'),
- 'type' => 'mp_checkbox_list',
- 'payment_method_types' => array(
- 'credit_card' => array(
- 'label' => __('Credit Cards', 'woocommerce-mercadopago'),
- 'list' => array(),
- ),
- 'debit_card' => array(
- 'label' => __('Debit Cards', 'woocommerce-mercadopago'),
- 'list' => array(),
- ),
- 'other' => array(
- 'label' => __('Other Payment Methods', 'woocommerce-mercadopago'),
- 'list' => array(),
- ),
- ),
- );
-
- $all_payments = get_option('_checkout_payments_methods', '');
-
- if ( empty($all_payments) ) {
- return $payment_list;
- }
-
- foreach ( $all_payments as $payment_method ) {
- if ( 'credit_card' === $payment_method['type'] ) {
- $payment_list['payment_method_types']['credit_card']['list'][] = array(
- 'id' => 'ex_payments_' . $payment_method['id'],
- 'field_key' => $this->get_field_key('ex_payments_' . $payment_method['id']),
- 'label' => $payment_method['name'],
- 'value' => $this->get_option('ex_payments_' . $payment_method['id'], 'yes'),
- 'type' => 'checkbox',
- );
- } elseif ( 'debit_card' === $payment_method['type'] || 'prepaid_card' === $payment_method['type'] ) {
- $payment_list['payment_method_types']['debit_card']['list'][] = array(
- 'id' => 'ex_payments_' . $payment_method['id'],
- 'field_key' => $this->get_field_key('ex_payments_' . $payment_method['id']),
- 'label' => $payment_method['name'],
- 'value' => $this->get_option('ex_payments_' . $payment_method['id'], 'yes'),
- 'type' => 'checkbox',
- );
- } else {
- $payment_list['payment_method_types']['other']['list'][] = array(
- 'id' => 'ex_payments_' . $payment_method['id'],
- 'field_key' => $this->get_field_key('ex_payments_' . $payment_method['id']),
- 'label' => $payment_method['name'],
- 'value' => $this->get_option('ex_payments_' . $payment_method['id'], 'yes'),
- 'type' => 'checkbox',
- );
- }
- }
-
- return $payment_list;
- }
-
- /**
- * Field auto return
- *
- * @return array
- */
- public function field_auto_return() {
- return array(
- 'title' => __('Return to the store', 'woocommerce-mercadopago'),
- 'subtitle' => __('Do you want your customer to automatically return to the store after payment?', 'woocommerce-mercadopago'),
- 'type' => 'mp_toggle_switch',
- 'default' => 'yes',
- 'descriptions' => array(
- 'enabled' => __('The buyer will be automatically redirected to the store.', 'woocommerce-mercadopago'),
- 'disabled' => __('The buyer will not be automatically redirected to the store.', 'woocommerce-mercadopago'),
- ),
- );
- }
-
- /**
- * Payment Fields
- */
- public function payment_fields() {
- $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
-
- // add css.
- wp_enqueue_style(
- 'woocommerce-mercadopago-narciso-styles',
- plugins_url( '../assets/css/mp-plugins-components.css', plugin_dir_path( __FILE__ ) ),
- array(),
- WC_WooMercadoPago_Constants::VERSION
- );
-
- // validate active payments methods.
- $method = $this->get_option_mp( 'method', 'redirect' );
- $test_mode_link = $this->get_mp_devsite_link( $this->checkout_country );
- $site = strtoupper( $this->mp_options->get_site_id() );
-
- $payment_methods = $this->get_payment_methods();
- $payment_methods_title = count($payment_methods) !== 0 ? __('Available payment methods', 'woocommerce-mercadopago') : '';
-
- $checkout_benefits_items = $this->get_benefits( $site );
-
- $parameters = [
- 'method' => $method,
- 'test_mode' => ! $this->is_production_mode(),
- 'test_mode_link' => $test_mode_link,
- 'plugin_version' => WC_WooMercadoPago_Constants::VERSION,
- 'checkout_redirect_src' => plugins_url( '../assets/images/cho-pro-redirect-v2.png', plugin_dir_path( __FILE__ ) ),
- 'payment_methods' => wp_json_encode( $payment_methods ),
- 'payment_methods_title' => $payment_methods_title,
- 'checkout_benefits_items' => wp_json_encode( $checkout_benefits_items )
- ];
-
- $parameters = array_merge( $parameters, WC_WooMercadoPago_Helper_Links::mp_define_terms_and_conditions() );
- wc_get_template( 'checkout/basic-checkout.php', $parameters, 'woo/mercado/pago/module/', WC_WooMercadoPago_Module::get_templates_path() );
- }
-
- /**
- * Process payment
- *
- * @param int $order_id Order Id.
- * @return array
- */
- public function process_payment( $order_id ) {
- $order = wc_get_order($order_id);
- $amount = $this->get_order_total();
- $shipping_taxes = floatval($order->get_shipping_total());
-
- $order->update_meta_data('is_production_mode', 'no' === $this->mp_options->get_checkbox_checkout_test_mode() ? 'yes' : 'no');
- $order->update_meta_data('_used_gateway', get_class($this));
-
- if ( ! empty($this->gateway_discount) ) {
- $discount = ( $amount - $shipping_taxes ) * $this->gateway_discount / 100;
- $order->update_meta_data('Mercado Pago: discount', __('discount of', 'woocommerce-mercadopago') . ' ' . $this->gateway_discount . '% / ' . __('discount of', 'woocommerce-mercadopago') . ' = ' . $discount);
- $order->set_total($amount - $discount);
- }
-
- if ( ! empty($this->commission) ) {
- $comission = $amount * ( $this->commission / 100 );
- $order->update_meta_data('Mercado Pago: comission', __('fee of', 'woocommerce-mercadopago') . ' ' . $this->commission . '% / ' . __('fee of', 'woocommerce-mercadopago') . ' = ' . $comission);
- }
- $order->save();
-
- if ( 'redirect' === $this->method || 'iframe' === $this->method ) {
- $this->log->write_log(__FUNCTION__, 'customer being redirected to Mercado Pago.');
- return array(
- 'result' => 'success',
- 'redirect' => $this->create_preference($order),
- );
- } elseif ( 'modal' === $this->method ) {
- $this->log->write_log(__FUNCTION__, 'preparing to render Checkout Pro view.');
- return array(
- 'result' => 'success',
- 'redirect' => $order->get_checkout_payment_url(true),
- );
- }
- }
-
- /**
- * Create preference
- *
- * @param object $order Order.
- * @return bool
- */
- public function create_preference( $order ) {
- $preference_basic = new WC_WooMercadoPago_Preference_Basic( $this, $order );
- $preference = $preference_basic->get_transaction( 'Preference' );
-
- try {
- $checkout_info = $preference->save();
- $this->log->write_log( __FUNCTION__, 'Created Preference: ' . wp_json_encode( $checkout_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ) );
- return ( $this->sandbox ) ? $checkout_info['sandbox_init_point'] : $checkout_info['init_point'];
- } catch ( Exception $e ) {
- $this->log->write_log( __FUNCTION__, 'preference creation failed with error: ' . $e->getMessage() );
- return false;
- }
- }
-
- /**
- * Get Id
- *
- * @return string
- */
- public static function get_id() {
- return self::ID;
- }
-
- /**
- * Get Mercado Pago Icon
- *
- * @return mixed
- */
- public function get_checkout_icon() {
- /**
- * Add Mercado Pago icon.
- *
- * @since 3.0.1
- */
- return apply_filters( 'woocommerce_mercadopago_icon', plugins_url( '../assets/images/icons/mercadopago.png', plugin_dir_path( __FILE__ ) ) );
- }
-
- /**
- * Get payment methods
- *
- * @return array
- */
- public function get_payment_methods() {
- $payment_methods_options = get_option( '_checkout_payments_methods', '' );
- $payment_methods = [];
-
- if ( $this->credits_helper->is_credits() ) {
- $payment_methods[] = [
- 'src' => plugins_url( '../assets/images/mercado-credito.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Credits image'
- ];
- }
-
- foreach ( $payment_methods_options as $payment_method_option ) {
- if ( 'yes' === $this->get_option_mp( $payment_method_option[ 'config' ], '' ) ) {
- $payment_methods[] = [
- 'src' => $payment_method_option[ 'image' ],
- 'alt' => $payment_method_option[ 'id' ]
- ];
- }
- }
-
- return $payment_methods;
- }
-
- /**
- * Get benefits items
- *
- * @param string $site
- * @return array
- */
- public function get_benefits( $site ) {
- $benefits = array(
- 'MLB' => array(
- array(
- 'title' => __('Easy login', 'woocommerce-mercadopago'),
- 'subtitle' => __('Log in with the same email and password you use in Mercado Libre.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-phone.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue phone image'
- )
- ),
- array(
- 'title' => __('Quick payments', 'woocommerce-mercadopago'),
- 'subtitle' => __('Use your saved cards, Pix or available balance.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-wallet.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue wallet image'
- )
- ),
- array(
- 'title' => __('Protected purchases', 'woocommerce-mercadopago'),
- 'subtitle' => __('Get your money back in case you don\'t receive your product.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-protection.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue protection image'
- )
- )
- ),
- 'MLM' => array(
- array(
- 'title' => __('Easy login', 'woocommerce-mercadopago'),
- 'subtitle' => __('Log in with the same email and password you use in Mercado Libre.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-phone.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue phone image'
- )
- ),
- array(
- 'title' => __('Quick payments', 'woocommerce-mercadopago'),
- 'subtitle' => __('Use your available Mercado Pago Wallet balance or saved cards.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-wallet.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue wallet image'
- )
- ),
- array(
- 'title' => __('Protected purchases', 'woocommerce-mercadopago'),
- 'subtitle' => __('Get your money back in case you don\'t receive your product.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-protection.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue protection image'
- )
- )
- ),
- 'MLA' => array(
- array(
- 'title' => __('Quick payments', 'woocommerce-mercadopago'),
- 'subtitle' => __('Use your available money or saved cards.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-wallet.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue wallet image'
- )
- ),
- array(
- 'title' => __('Installments option', 'woocommerce-mercadopago'),
- 'subtitle' => __('Pay with or without a credit card.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-phone-installments.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue phone installments image'
- )
- ),
- array(
- 'title' => __('Reliable purchases', 'woocommerce-mercadopago'),
- 'subtitle' => __('Get help if you have a problem with your purchase.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-protection.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue protection image'
- )
- )
- ),
- 'ROLA' => array(
- array(
- 'title' => __('Easy login', 'woocommerce-mercadopago'),
- 'subtitle' => __('Log in with the same email and password you use in Mercado Libre.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-phone.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue phone image'
- )
- ),
- array(
- 'title' => __('Quick payments', 'woocommerce-mercadopago'),
- 'subtitle' => __('Use your available money or saved cards.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-wallet.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue wallet image'
- )
- ),
- array(
- 'title' => __('Installments option', 'woocommerce-mercadopago'),
- 'subtitle' => __('Interest-free installments with selected banks.', 'woocommerce-mercadopago'),
- 'image' => array(
- 'src' => plugins_url( '../assets/images/blue-phone-installments.png', plugin_dir_path(__FILE__) ),
- 'alt' => 'Blue phone installments image'
- )
- )
- ),
- );
-
- return array_key_exists( $site, $benefits ) ? $benefits[ $site ] : $benefits[ 'ROLA' ];
- }
+ ),
+ 'type' => 'title',
+ 'class' => 'mp_title_header',
+ );
+ }
+
+ /**
+ * Field checkout payments advanced title
+ *
+ * @return array
+ */
+ public function field_checkout_payments_advanced_title() {
+ return array(
+ 'title' => __('Advanced settings', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'type' => 'title',
+ 'class' => 'mp_subtitle_bd',
+ );
+ }
+
+ /**
+ * Field method
+ *
+ * @return array
+ */
+ public function field_method() {
+ return array(
+ 'title' => __('Payment experience', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'type' => 'select',
+ 'description' => __('Define what payment experience your customers will have, whether inside or outside your store.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'default' => ( 'iframe' === $this->method ) ? 'redirect' : $this->method,
+ 'options' => array(
+ 'redirect' => __('Redirect', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'modal' => __('Modal', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ ),
+ );
+ }
+
+ /**
+ * Field success url
+ *
+ * @return array
+ */
+ public function field_success_url() {
+ // Validate back URL.
+ if ( ! empty($this->success_url) && filter_var($this->success_url, \FILTER_VALIDATE_URL) === false ) {
+ $success_back_url_message = ' ' .
+ __('This seems to be an invalid URL.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . ' ';
+ } else {
+ $success_back_url_message = __('Choose the URL that we will show your customers when they finish their purchase.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN);
+ }
+ return array(
+ 'title' => __('Success URL', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'type' => 'text',
+ 'description' => $success_back_url_message,
+ 'default' => '',
+ );
+ }
+
+ /**
+ * Field failure url
+ *
+ * @return array
+ */
+ public function field_failure_url() {
+ if ( ! empty($this->failure_url) && filter_var($this->failure_url, \FILTER_VALIDATE_URL) === false ) {
+ $fail_back_url_message = ' ' .
+ __('This seems to be an invalid URL.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . ' ';
+ } else {
+ $fail_back_url_message = __('Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN);
+ }
+ return array(
+ 'title' => __('Payment URL rejected', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'type' => 'text',
+ 'description' => $fail_back_url_message,
+ 'default' => '',
+ );
+ }
+
+ /**
+ * Field pending
+ *
+ * @return array
+ */
+ public function field_pending_url() {
+ // Validate back URL.
+ if ( ! empty($this->pending_url) && filter_var($this->pending_url, \FILTER_VALIDATE_URL) === false ) {
+ $pending_back_url_message = ' ' .
+ __('This seems to be an invalid URL.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . ' ';
+ } else {
+ $pending_back_url_message = __('Choose the URL that we will show to your customers when they have a payment pending approval.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN);
+ }
+ return array(
+ 'title' => __('Payment URL pending', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'type' => 'text',
+ 'description' => $pending_back_url_message,
+ 'default' => '',
+ );
+ }
+
+ /**
+ * Field payments
+ *
+ * @return array
+ */
+ public function field_ex_payments() {
+ $payment_list = array(
+ 'description' => __('Enable the payment methods available to your clients.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'title' => __('Choose the payment methods you accept in your store', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'type' => 'mp_checkbox_list',
+ 'payment_method_types' => array(
+ 'credit_card' => array(
+ 'label' => __('Credit Cards', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'list' => array(),
+ ),
+ 'debit_card' => array(
+ 'label' => __('Debit Cards', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'list' => array(),
+ ),
+ 'other' => array(
+ 'label' => __('Other Payment Methods', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'list' => array(),
+ ),
+ ),
+ );
+
+ $all_payments = get_option('_checkout_payments_methods', '');
+
+ if ( empty($all_payments) ) {
+ return $payment_list;
+ }
+
+ foreach ( $all_payments as $payment_method ) {
+ if ( 'credit_card' === $payment_method['type'] ) {
+ $payment_list['payment_method_types']['credit_card']['list'][] = array(
+ 'id' => 'ex_payments_' . $payment_method['id'],
+ 'field_key' => $this->get_field_key('ex_payments_' . $payment_method['id']),
+ 'label' => $payment_method['name'],
+ 'value' => $this->get_option('ex_payments_' . $payment_method['id'], 'yes'),
+ 'type' => 'checkbox',
+ );
+ } elseif ( 'debit_card' === $payment_method['type'] || 'prepaid_card' === $payment_method['type'] ) {
+ $payment_list['payment_method_types']['debit_card']['list'][] = array(
+ 'id' => 'ex_payments_' . $payment_method['id'],
+ 'field_key' => $this->get_field_key('ex_payments_' . $payment_method['id']),
+ 'label' => $payment_method['name'],
+ 'value' => $this->get_option('ex_payments_' . $payment_method['id'], 'yes'),
+ 'type' => 'checkbox',
+ );
+ } else {
+ $payment_list['payment_method_types']['other']['list'][] = array(
+ 'id' => 'ex_payments_' . $payment_method['id'],
+ 'field_key' => $this->get_field_key('ex_payments_' . $payment_method['id']),
+ 'label' => $payment_method['name'],
+ 'value' => $this->get_option('ex_payments_' . $payment_method['id'], 'yes'),
+ 'type' => 'checkbox',
+ );
+ }
+ }
+
+ return $payment_list;
+ }
+
+ /**
+ * Field auto return
+ *
+ * @return array
+ */
+ public function field_auto_return() {
+ return array(
+ 'title' => __('Return to the store', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Do you want your customer to automatically return to the store after payment?', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'type' => 'mp_toggle_switch',
+ 'default' => 'yes',
+ 'descriptions' => array(
+ 'enabled' => __('The buyer will be automatically redirected to the store.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'disabled' => __('The buyer will not be automatically redirected to the store.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ ),
+ );
+ }
+
+ /**
+ * Payment Fields
+ */
+ public function payment_fields(): void {
+ $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
+
+ // add css.
+ wp_enqueue_style(
+ 'woocommerce-mercadopago-narciso-styles',
+ plugins_url( '../assets/css/mp-plugins-components.css', plugin_dir_path( __FILE__ ) ),
+ array(),
+ WC_WooMercadoPago_Constants::VERSION
+ );
+
+ // validate active payments methods.
+ $method = $this->get_option_mp( 'method', 'redirect' );
+ $test_mode_link = $this->get_mp_devsite_link( $this->checkout_country );
+ $site = strtoupper( $this->mp_options->get_site_id() );
+
+ $payment_methods = $this->get_payment_methods();
+ $payment_methods_title = count($payment_methods) !== 0 ? __('Available payment methods', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) : '';
+
+ $checkout_benefits_items = $this->get_benefits( $site );
+
+ $parameters = array(
+ 'method' => $method,
+ 'test_mode' => ! $this->is_production_mode(),
+ 'test_mode_link' => $test_mode_link,
+ 'plugin_version' => WC_WooMercadoPago_Constants::VERSION,
+ 'checkout_redirect_src' => plugins_url( '../assets/images/cho-pro-redirect-v2.png', plugin_dir_path( __FILE__ ) ),
+ 'payment_methods' => wp_json_encode( $payment_methods ),
+ 'payment_methods_title' => $payment_methods_title,
+ 'checkout_benefits_items' => wp_json_encode( $checkout_benefits_items )
+ );
+
+ $parameters = array_merge( $parameters, WC_WooMercadoPago_Helper_Links::mp_define_terms_and_conditions() );
+ wc_get_template( 'checkout/basic-checkout.php', $parameters, 'woo/mercado/pago/module/', WC_WooMercadoPago_Module::get_templates_path() );
+ }
+
+ /**
+ * Process payment
+ *
+ * @param int $order_id Order Id.
+ * @return array
+ */
+ public function process_payment( $order_id ) {
+ $order = wc_get_order($order_id);
+ $amount = $this->get_order_total();
+ $shipping_taxes = (float) ($order->get_shipping_total());
+
+ $order->update_meta_data('is_production_mode', 'no' === $this->mp_options->get_checkbox_checkout_test_mode() ? 'yes' : 'no');
+ $order->update_meta_data('_used_gateway', get_class($this));
+
+ if ( ! empty($this->gateway_discount) ) {
+ $discount = ( $amount - $shipping_taxes ) * $this->gateway_discount / 100;
+ $order->update_meta_data('Mercado Pago: discount', __('discount of', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . ' ' . $this->gateway_discount . '% / ' . __('discount of', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . ' = ' . $discount);
+ $order->set_total($amount - $discount);
+ }
+
+ if ( ! empty($this->commission) ) {
+ $comission = $amount * ( $this->commission / 100 );
+ $order->update_meta_data('Mercado Pago: comission', __('fee of', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . ' ' . $this->commission . '% / ' . __('fee of', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . ' = ' . $comission);
+ }
+ $order->save();
+
+ if ( 'redirect' === $this->method || 'iframe' === $this->method ) {
+ $this->log->write_log(__FUNCTION__, 'customer being redirected to Mercado Pago.');
+ return array(
+ 'result' => 'success',
+ 'redirect' => $this->create_preference($order),
+ );
+ }
+ if ( 'modal' === $this->method ) {
+ $this->log->write_log(__FUNCTION__, 'preparing to render Checkout Pro view.');
+ return array(
+ 'result' => 'success',
+ 'redirect' => $order->get_checkout_payment_url(true),
+ );
+ }
+ }
+
+ /**
+ * Create preference
+ *
+ * @param object $order Order.
+ * @return bool
+ */
+ public function create_preference( $order ) {
+ $preference_basic = new WC_WooMercadoPago_Preference_Basic( $this, $order );
+ $preference = $preference_basic->get_transaction( 'Preference' );
+
+ try {
+ $checkout_info = $preference->save();
+ $this->log->write_log( __FUNCTION__, 'Created Preference: ' . wp_json_encode( $checkout_info, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE ) );
+ return ( $this->sandbox ) ? $checkout_info['sandbox_init_point'] : $checkout_info['init_point'];
+ } catch ( Exception $e ) {
+ $this->log->write_log( __FUNCTION__, 'preference creation failed with error: ' . $e->getMessage() );
+ return false;
+ }
+ }
+
+ /**
+ * Get Id
+ *
+ * @return string
+ */
+ public static function get_id() {
+ return self::ID;
+ }
+
+ /**
+ * Get Mercado Pago Icon
+ *
+ * @return mixed
+ */
+ public function get_checkout_icon() {
+ /**
+ * Add Mercado Pago icon.
+ *
+ * @since 3.0.1
+ */
+ return apply_filters( 'woocommerce_mercadopago_icon', plugins_url( '../assets/images/icons/mercadopago.png', plugin_dir_path( __FILE__ ) ) );
+ }
+
+ /**
+ * Get payment methods
+ *
+ * @return array
+ */
+ public function get_payment_methods() {
+ $payment_methods_options = get_option( '_checkout_payments_methods', '' );
+ $payment_methods = array();
+
+ if ( $this->credits_helper->is_credits() ) {
+ $payment_methods[] = array(
+ 'src' => plugins_url( '../assets/images/mercado-credito.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Credits image'
+ );
+ }
+
+ foreach ( $payment_methods_options as $payment_method_option ) {
+ if ( 'yes' === $this->get_option_mp( $payment_method_option[ 'config' ], '' ) ) {
+ $payment_methods[] = array(
+ 'src' => $payment_method_option[ 'image' ],
+ 'alt' => $payment_method_option[ 'id' ]
+ );
+ }
+ }
+
+ return $payment_methods;
+ }
+
+ /**
+ * Get benefits items
+ *
+ * @param string $site
+ * @return array
+ */
+ public function get_benefits( $site ) {
+ $benefits = array(
+ 'MLB' => array(
+ array(
+ 'title' => __('Easy login', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Log in with the same email and password you use in Mercado Libre.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-phone.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue phone image'
+ )
+ ),
+ array(
+ 'title' => __('Quick payments', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Use your saved cards, Pix or available balance.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-wallet.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue wallet image'
+ )
+ ),
+ array(
+ 'title' => __('Protected purchases', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Get your money back in case you don\'t receive your product.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-protection.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue protection image'
+ )
+ )
+ ),
+ 'MLM' => array(
+ array(
+ 'title' => __('Easy login', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Log in with the same email and password you use in Mercado Libre.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-phone.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue phone image'
+ )
+ ),
+ array(
+ 'title' => __('Quick payments', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Use your available Mercado Pago Wallet balance or saved cards.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-wallet.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue wallet image'
+ )
+ ),
+ array(
+ 'title' => __('Protected purchases', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Get your money back in case you don\'t receive your product.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-protection.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue protection image'
+ )
+ )
+ ),
+ 'MLA' => array(
+ array(
+ 'title' => __('Quick payments', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Use your available money or saved cards.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-wallet.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue wallet image'
+ )
+ ),
+ array(
+ 'title' => __('Installments option', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Pay with or without a credit card.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-phone-installments.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue phone installments image'
+ )
+ ),
+ array(
+ 'title' => __('Reliable purchases', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Get help if you have a problem with your purchase.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-protection.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue protection image'
+ )
+ )
+ ),
+ 'ROLA' => array(
+ array(
+ 'title' => __('Easy login', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Log in with the same email and password you use in Mercado Libre.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-phone.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue phone image'
+ )
+ ),
+ array(
+ 'title' => __('Quick payments', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Use your available money or saved cards.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-wallet.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue wallet image'
+ )
+ ),
+ array(
+ 'title' => __('Installments option', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Interest-free installments with selected banks.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => array(
+ 'src' => plugins_url( '../assets/images/blue-phone-installments.png', plugin_dir_path(__FILE__) ),
+ 'alt' => 'Blue phone installments image'
+ )
+ )
+ ),
+ );
+
+ return array_key_exists( $site, $benefits ) ? $benefits[ $site ] : $benefits[ 'ROLA' ];
+ }
}
diff --git a/includes/payments/class-wc-woomercadopago-credits-gateway.php b/includes/payments/class-wc-woomercadopago-credits-gateway.php
index bad7c0f61..af3413f69 100755
--- a/includes/payments/class-wc-woomercadopago-credits-gateway.php
+++ b/includes/payments/class-wc-woomercadopago-credits-gateway.php
@@ -1,502 +1,504 @@
id = self::ID;
- $this->title = __('Installments without card', 'woocommerce-mercadopago');
- $this->title_gateway = __('Installments without card', 'woocommerce-mercadopago');
- $this->description = __('Customers who buy on spot and pay later in up to 12 installments', 'woocommerce-mercadopago');
- $this->mp_options = $this->get_mp_options();
-
- if ( ! $this->validate_section() ) {
- return;
- }
-
- add_action( 'admin_enqueue_scripts', [$this, 'load_admin_scripts'] );
-
- $this->form_fields = array();
- $this->method_title = __( 'Mercado Pago - Installments without card', 'woocommerce-mercadopago' );
- $this->method = $this->get_option_mp( 'method', 'redirect' );
- $this->title = $this->get_option_mp( 'title', __( 'Checkout without card', 'woocommerce-mercadopago' ) );
- $this->method_description = $this->description;
- $this->credits_banner = $this->get_option('credits_banner', 'no');
- $this->gateway_discount = $this->get_option('gateway_discount', 0);
- $this->clientid_old_version = $this->get_client_id();
- $this->field_forms_order = $this->get_fields_sequence();
-
- parent::__construct();
- $this->form_fields = $this->get_form_mp_fields();
- $this->hook = new WC_WooMercadoPago_Hook_Credits($this);
- $this->notification = new WC_WooMercadoPago_Notification_Core($this);
- $this->currency_convertion = true;
- $this->icon = $this->get_checkout_icon();
- }
-
- public function load_admin_scripts() {
- if ( is_admin() && $this->is_manage_section() && (
- WC_WooMercadoPago_Helper_Current_Url::validate_page('mercadopago-settings') ||
- WC_WooMercadoPago_Helper_Current_Url::validate_section('woo-mercado-pago')
- ) ) {
- $siteId = strtolower( $this->mp_options->get_site_id() );
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
-
- wp_enqueue_style(
- 'woocommerce-mercadopago-info-admin-credits-style',
- plugins_url( '../assets/css/credits/example-info' . $suffix . '.css', plugin_dir_path( __FILE__ ) ),
- array(),
- WC_WooMercadoPago_Constants::VERSION
- );
-
- wp_enqueue_script(
- 'woocommerce-mercadopago-credits-config-script',
- plugins_url( '../assets/js/credits_config_mercadopago' . $suffix . '.js', plugin_dir_path( __FILE__ ) ),
- array(),
- WC_WooMercadoPago_Constants::VERSION,
- true
- );
-
- wp_enqueue_script(
- 'woocommerce-mercadopago-info-admin-credits-script',
- plugins_url( '../assets/js/credits/example-info' . $suffix . '.js', plugin_dir_path( __FILE__ ) ),
- array(),
- WC_WooMercadoPago_Constants::VERSION,
- true
- );
-
- wp_localize_script(
- 'woocommerce-mercadopago-info-admin-credits-script',
- 'wc_mp_icon_images',
- array(
- 'computerBlueIcon' => plugins_url( '../assets/images/credits/desktop-blue-icon.png', plugin_dir_path( __FILE__ ) ),
- 'computerGrayIcon' => plugins_url( '../assets/images/credits/desktop-gray-icon.png', plugin_dir_path( __FILE__ ) ),
- 'cellphoneBlueIcon' => plugins_url( '../assets/images/credits/cellphone-blue-icon.png', plugin_dir_path( __FILE__ ) ),
- 'cellphoneGrayIcon' => plugins_url( '../assets/images/credits/cellphone-gray-icon.png', plugin_dir_path( __FILE__ ) ),
- 'viewMobile' => plugins_url( $this->get_mercado_credits_gif_path( $siteId, 'mobile' ), plugin_dir_path( __FILE__ ) ),
- 'viewDesktop' => plugins_url( $this->get_mercado_credits_gif_path( $siteId, 'desktop' ), plugin_dir_path( __FILE__ ) ),
- 'footerDesktop' => __( 'Banner on the product page | Computer version', 'woocommerce-mercadopago' ),
- 'footerCellphone' => __( 'Banner on the product page | Cellphone version', 'woocommerce-mercadopago' ),
- )
- );
- }
- }
-
- /**
- * Get MP fields label
- *
- * @return array
- */
- public function get_form_mp_fields() {
- if ( empty( $this->checkout_country ) ) {
- $this->field_forms_order = array_slice( $this->field_forms_order, 0, 7 );
- }
-
- if ( ! empty( $this->checkout_country ) && empty( $this->get_access_token() ) && empty( $this->get_public_key() ) ) {
- $this->field_forms_order = array_slice( $this->field_forms_order, 0, 22 );
- }
-
- $form_fields = array();
-
- if (
- ! empty( $this->checkout_country ) &&
- ! empty( $this->get_access_token() ) &&
- ! empty( $this->get_public_key() )
- ) {
- $form_fields['checkout_header'] = $this->field_checkout_header();
- $form_fields['checkout_payments_advanced_title'] = $this->field_checkout_payments_advanced_title();
- $form_fields['credits_banner'] = $this->field_credits_banner_mode();
- $form_fields['checkout_visualization_title'] = $this->title_separator();
- $form_fields['checkout_visualization'] = $this->field_checkout_visualization();
- $form_fields['checkout_banner_title'] = $this->title_separator();
- $form_fields['credits_banner_visualization'] = $this->field_credits_banner_visualization();
- }
-
- $form_fields_abs = parent::get_form_mp_fields();
-
- if ( count($form_fields_abs) === 1 ) {
- return $form_fields_abs;
- }
-
- $form_fields_merge = array_merge($form_fields_abs, $form_fields);
-
- return $this->sort_form_fields($form_fields_merge, $this->field_forms_order);
- }
-
- /**
- * Get fields sequence
- *
- * @return array
- */
- public function get_fields_sequence() {
- return array(
- // Necessary to run.
- 'description',
-
- // Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel.
- 'checkout_header',
-
- // No olvides de homologar tu cuenta.
- 'checkout_card_homolog',
-
- // Set up the payment experience in your store.
- 'checkout_card_validate',
- 'enabled',
- 'checkout_visualization_title',
- 'checkout_visualization',
- 'title',
- WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY,
- 'credits_banner',
- 'checkout_banner_title',
- 'credits_banner_visualization',
-
- // Advanced settings.
- 'checkout_payments_advanced_title',
- 'checkout_payments_advanced_description',
- 'method',
- 'gateway_discount',
- 'commission',
- );
- }
-
- /**
- * Is available?
- *
- * @return bool
- * @throws WC_WooMercadoPago_Exception Load access token exception.
- */
- public function is_available() {
- if ( parent::is_available() ) {
- return true;
- }
-
- if ( isset($this->settings['enabled']) && 'yes' === $this->settings['enabled'] ) {
- if ( $this->mp instanceof MP ) {
- $access_token = $this->mp->get_access_token();
- if (
- false === WC_WooMercadoPago_Credentials::validate_credentials_test($this->mp, $access_token)
- && true === $this->sandbox
- ) {
- return false;
- }
-
- if (
- false === WC_WooMercadoPago_Credentials::validate_credentials_prod($this->mp, $access_token)
- && false === $this->sandbox
- ) {
- return false;
- }
- return true;
- }
- }
- return false;
- }
-
- /**
- * Get clientID when update version 3.0.17 to 4 latest
- *
- * @return string
- */
- public function get_client_id() {
- $client_id = $this->mp_options->get_client_id();
- if ( ! empty($client_id) ) {
- return true;
- }
- return false;
- }
-
- /**
- * Field enabled
- *
- * @return array
- */
- public function field_enabled() {
- return array(
- 'title' => __('Activate installments without card in your store checkout ', 'woocommerce-mercadopago'),
- 'subtitle' => __('Offer the option to pay in installments without card directly from your store\'s checkout.', 'woocommerce-mercadopago'),
- 'type' => 'mp_toggle_switch',
- 'default' => 'no',
- 'descriptions' => array(
- 'enabled' => __('Payment in installments without card in the store checkout is active', 'woocommerce-mercadopago'),
- 'disabled' => __('Payment in installments without card in the store checkout is inactive', 'woocommerce-mercadopago'),
- ),
- );
- }
-
- public function title_separator() {
- return array(
- 'title' => '',
- 'type' => 'title',
- );
- }
-
- public function field_checkout_visualization() {
- $siteId = strtolower( $this->mp_options->get_site_id() );
-
- return array(
- 'type' => 'mp_checkout_visualization',
- 'value' => array(
- 'title' => __('Checkout visualization', 'woocommerce-mercadopago'),
- 'subtitle' => __('Check below how this feature will be displayed to your customers:', 'woocommerce-mercadopago'),
- 'footer' => __('Checkout Preview', 'woocommerce-mercadopago'),
- 'pill_text' => __('PREVIEW', 'woocommerce-mercadopago'),
- 'image' => plugins_url($this->get_mercado_credits_preview_image($siteId), plugin_dir_path(__FILE__)),
- ),
- );
- }
-
- public function field_credits_banner_visualization() {
- return array(
- 'type' => 'mp_credits_banner_visualization',
- 'value' => array(
- 'desktop' => __('Computer', 'woocommerce-mercadopago'),
- 'cellphone' => __('Mobile', 'woocommerce-mercadopago'),
- 'footer' => __('Banner on the product page | Computer version', 'woocommerce-mercadopago'),
- 'title' => __('Component visualization', 'woocommerce-mercadopago'),
- 'subtitle' => __('Check below how this feature will be displayed to your customers:', 'woocommerce-mercadopago'),
- ),
- );
- }
-
- /**
- * Get image path for mercado credits checkout preview
- *
- * @param $siteId
- *
- * @return string
- */
- protected function get_mercado_credits_preview_image( $siteId ) {
- $siteIds = [
- 'mla' => 'HISPANO_',
- 'mlb' => 'MLB_',
- 'mlm' => 'HISPANO_',
- ];
-
- $prefix = $siteIds[ $siteId ] ?? '';
-
- return sprintf('../assets/images/credits/%scheckout_preview.jpg', $prefix);
- }
-
- /**
- * Field checkout header
- *
- * @return array
- */
- public function field_checkout_header() {
- return array(
- 'title' => sprintf(
- '
+ /**
+ * Const ID
+ *
+ * @var string
+ */
+ public const ID = 'woo-mercado-pago-credits';
+
+ /**
+ * Credits banner
+ *
+ * @var string
+ */
+ public $credits_banner;
+
+ /**
+ * WC_WooMercadoPago_CreditsGateway constructor.
+ *
+ * @throws WC_WooMercadoPago_Exception On load payment exception.
+ */
+ public function __construct() {
+ $this->id = self::ID;
+ $this->title = __('Installments without card', LKN_WC_MERCADOPAGO_TEXT_DOMAIN);
+ $this->title_gateway = __('Installments without card', LKN_WC_MERCADOPAGO_TEXT_DOMAIN);
+ $this->description = __('Customers who buy on spot and pay later in up to 12 installments', LKN_WC_MERCADOPAGO_TEXT_DOMAIN);
+ $this->mp_options = $this->get_mp_options();
+
+ if ( ! $this->validate_section() ) {
+ return;
+ }
+
+ add_action( 'admin_enqueue_scripts', array($this, 'load_admin_scripts') );
+
+ $this->form_fields = array();
+ $this->method_title = __( 'Mercado Pago - Installments without card', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ $this->method = $this->get_option_mp( 'method', 'redirect' );
+ $this->title = $this->get_option_mp( 'title', __( 'Checkout without card', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) );
+ $this->method_description = $this->description;
+ $this->credits_banner = $this->get_option('credits_banner', 'no');
+ $this->gateway_discount = $this->get_option('gateway_discount', 0);
+ $this->clientid_old_version = $this->get_client_id();
+ $this->field_forms_order = $this->get_fields_sequence();
+
+ parent::__construct();
+ $this->form_fields = $this->get_form_mp_fields();
+ $this->hook = new WC_WooMercadoPago_Hook_Credits($this);
+ $this->notification = new WC_WooMercadoPago_Notification_Core($this);
+ $this->currency_convertion = true;
+ $this->icon = $this->get_checkout_icon();
+ }
+
+ public function load_admin_scripts(): void {
+ if ( is_admin() && $this->is_manage_section() && (
+ WC_WooMercadoPago_Helper_Current_Url::validate_page('mercadopago-settings') ||
+ WC_WooMercadoPago_Helper_Current_Url::validate_section('woo-mercado-pago')
+ ) ) {
+ $siteId = strtolower( $this->mp_options->get_site_id() );
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
+
+ wp_enqueue_style(
+ 'woocommerce-mercadopago-info-admin-credits-style',
+ plugins_url( '../assets/css/credits/example-info' . $suffix . '.css', plugin_dir_path( __FILE__ ) ),
+ array(),
+ WC_WooMercadoPago_Constants::VERSION
+ );
+
+ wp_enqueue_script(
+ 'woocommerce-mercadopago-credits-config-script',
+ plugins_url( '../assets/js/credits_config_mercadopago' . $suffix . '.js', plugin_dir_path( __FILE__ ) ),
+ array(),
+ WC_WooMercadoPago_Constants::VERSION,
+ true
+ );
+
+ wp_enqueue_script(
+ 'woocommerce-mercadopago-info-admin-credits-script',
+ plugins_url( '../assets/js/credits/example-info' . $suffix . '.js', plugin_dir_path( __FILE__ ) ),
+ array(),
+ WC_WooMercadoPago_Constants::VERSION,
+ true
+ );
+
+ wp_localize_script(
+ 'woocommerce-mercadopago-info-admin-credits-script',
+ 'wc_mp_icon_images',
+ array(
+ 'computerBlueIcon' => plugins_url( '../assets/images/credits/desktop-blue-icon.png', plugin_dir_path( __FILE__ ) ),
+ 'computerGrayIcon' => plugins_url( '../assets/images/credits/desktop-gray-icon.png', plugin_dir_path( __FILE__ ) ),
+ 'cellphoneBlueIcon' => plugins_url( '../assets/images/credits/cellphone-blue-icon.png', plugin_dir_path( __FILE__ ) ),
+ 'cellphoneGrayIcon' => plugins_url( '../assets/images/credits/cellphone-gray-icon.png', plugin_dir_path( __FILE__ ) ),
+ 'viewMobile' => plugins_url( $this->get_mercado_credits_gif_path( $siteId, 'mobile' ), plugin_dir_path( __FILE__ ) ),
+ 'viewDesktop' => plugins_url( $this->get_mercado_credits_gif_path( $siteId, 'desktop' ), plugin_dir_path( __FILE__ ) ),
+ 'footerDesktop' => __( 'Banner on the product page | Computer version', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'footerCellphone' => __( 'Banner on the product page | Cellphone version', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ )
+ );
+ }
+ }
+
+ /**
+ * Get MP fields label
+ *
+ * @return array
+ */
+ public function get_form_mp_fields() {
+ if ( empty( $this->checkout_country ) ) {
+ $this->field_forms_order = array_slice( $this->field_forms_order, 0, 7 );
+ }
+
+ if ( ! empty( $this->checkout_country ) && empty( $this->get_access_token() ) && empty( $this->get_public_key() ) ) {
+ $this->field_forms_order = array_slice( $this->field_forms_order, 0, 22 );
+ }
+
+ $form_fields = array();
+
+ if (
+ ! empty( $this->checkout_country ) &&
+ ! empty( $this->get_access_token() ) &&
+ ! empty( $this->get_public_key() )
+ ) {
+ $form_fields['checkout_header'] = $this->field_checkout_header();
+ $form_fields['checkout_payments_advanced_title'] = $this->field_checkout_payments_advanced_title();
+ $form_fields['credits_banner'] = $this->field_credits_banner_mode();
+ $form_fields['checkout_visualization_title'] = $this->title_separator();
+ $form_fields['checkout_visualization'] = $this->field_checkout_visualization();
+ $form_fields['checkout_banner_title'] = $this->title_separator();
+ $form_fields['credits_banner_visualization'] = $this->field_credits_banner_visualization();
+ }
+
+ $form_fields_abs = parent::get_form_mp_fields();
+
+ if ( count($form_fields_abs) === 1 ) {
+ return $form_fields_abs;
+ }
+
+ $form_fields_merge = array_merge($form_fields_abs, $form_fields);
+
+ return $this->sort_form_fields($form_fields_merge, $this->field_forms_order);
+ }
+
+ /**
+ * Get fields sequence
+ *
+ * @return array
+ */
+ public function get_fields_sequence() {
+ return array(
+ // Necessary to run.
+ 'description',
+
+ // Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel.
+ 'checkout_header',
+
+ // No olvides de homologar tu cuenta.
+ 'checkout_card_homolog',
+
+ // Set up the payment experience in your store.
+ 'checkout_card_validate',
+ 'enabled',
+ 'checkout_visualization_title',
+ 'checkout_visualization',
+ 'title',
+ WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY,
+ 'credits_banner',
+ 'checkout_banner_title',
+ 'credits_banner_visualization',
+
+ // Advanced settings.
+ 'checkout_payments_advanced_title',
+ 'checkout_payments_advanced_description',
+ 'method',
+ 'gateway_discount',
+ 'commission',
+ );
+ }
+
+ /**
+ * Is available?
+ *
+ * @return bool
+ * @throws WC_WooMercadoPago_Exception Load access token exception.
+ */
+ public function is_available() {
+ if ( parent::is_available() ) {
+ return true;
+ }
+
+ if ( isset($this->settings['enabled']) && 'yes' === $this->settings['enabled'] ) {
+ if ( $this->mp instanceof MP ) {
+ $access_token = $this->mp->get_access_token();
+ if (
+ false === WC_WooMercadoPago_Credentials::validate_credentials_test($this->mp, $access_token)
+ && true === $this->sandbox
+ ) {
+ return false;
+ }
+
+ if (
+ false === WC_WooMercadoPago_Credentials::validate_credentials_prod($this->mp, $access_token)
+ && false === $this->sandbox
+ ) {
+ return false;
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Get clientID when update version 3.0.17 to 4 latest
+ *
+ * @return string
+ */
+ public function get_client_id() {
+ $client_id = $this->mp_options->get_client_id();
+ if ( ! empty($client_id) ) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Field enabled
+ *
+ * @return array
+ */
+ public function field_enabled() {
+ return array(
+ 'title' => __('Activate installments without card in your store checkout ', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Offer the option to pay in installments without card directly from your store\'s checkout.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'type' => 'mp_toggle_switch',
+ 'default' => 'no',
+ 'descriptions' => array(
+ 'enabled' => __('Payment in installments without card in the store checkout is active', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'disabled' => __('Payment in installments without card in the store checkout is inactive', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ ),
+ );
+ }
+
+ public function title_separator() {
+ return array(
+ 'title' => '',
+ 'type' => 'title',
+ );
+ }
+
+ public function field_checkout_visualization() {
+ $siteId = strtolower( $this->mp_options->get_site_id() );
+
+ return array(
+ 'type' => 'mp_checkout_visualization',
+ 'value' => array(
+ 'title' => __('Checkout visualization', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Check below how this feature will be displayed to your customers:', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'footer' => __('Checkout Preview', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'pill_text' => __('PREVIEW', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'image' => plugins_url($this->get_mercado_credits_preview_image($siteId), plugin_dir_path(__FILE__)),
+ ),
+ );
+ }
+
+ public function field_credits_banner_visualization() {
+ return array(
+ 'type' => 'mp_credits_banner_visualization',
+ 'value' => array(
+ 'desktop' => __('Computer', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'cellphone' => __('Mobile', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'footer' => __('Banner on the product page | Computer version', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'title' => __('Component visualization', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ 'subtitle' => __('Check below how this feature will be displayed to your customers:', LKN_WC_MERCADOPAGO_TEXT_DOMAIN),
+ ),
+ );
+ }
+
+ /**
+ * Get image path for mercado credits checkout preview
+ *
+ * @param $siteId
+ *
+ * @return string
+ */
+ protected function get_mercado_credits_preview_image( $siteId ) {
+ $siteIds = array(
+ 'mla' => 'HISPANO_',
+ 'mlb' => 'MLB_',
+ 'mlm' => 'HISPANO_',
+ );
+
+ $prefix = $siteIds[ $siteId ] ?? '';
+
+ return sprintf('../assets/images/credits/%scheckout_preview.jpg', $prefix);
+ }
+
+ /**
+ * Field checkout header
+ *
+ * @return array
+ */
+ public function field_checkout_header() {
+ return array(
+ 'title' => sprintf(
+ '
- ' . __('Installments without card', 'woocommerce-mercadopago') . '
+ ' . __('Installments without card', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . '
- ' . __('Reach millions of buyers by offering Mercado Credito as a payment method. Our flexible payment options give your customers the possibility to buy today whatever they want in up to 12 installments without the need to use a credit card.', 'woocommerce-mercadopago') . '
+ ' . __('Reach millions of buyers by offering Mercado Credito as a payment method. Our flexible payment options give your customers the possibility to buy today whatever they want in up to 12 installments without the need to use a credit card.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . '
- ' . __('For your business, the approval of the purchase is immediate and guaranteed.', 'woocommerce-mercadopago') . '
+ ' . __('For your business, the approval of the purchase is immediate and guaranteed.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN) . '
- ' . __( 'With the Transparent Checkout, you can sell inside your store environment, without redirection and with the security from Mercado Pago.', 'woocommerce-mercadopago' ) . '
+ ' . __( 'With the Transparent Checkout, you can sell inside your store environment, without redirection and with the security from Mercado Pago.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) . '
'
- ),
- 'type' => 'title',
- 'class' => 'mp_title_header',
- );
- return $checkout_custom_header;
- }
-
- /**
- * Field checkout custom payment advanced title
- *
- * @return array
- */
- public function field_checkout_custom_payments_advanced_title() {
- $checkout_custom_payments_advanced_title = array(
- 'title' => __( 'Advanced configuration of the personalized payment experience', 'woocommerce-mercadopago' ),
- 'type' => 'title',
- 'class' => 'mp_subtitle_bd',
- );
- return $checkout_custom_payments_advanced_title;
- }
-
- /**
- * Field Wallet Button toggle
- *
- * @return array
- */
- public function field_checkout_custom_wallet_button_title() {
- return array(
- 'title' => __( 'Payments via Mercado Pago account', 'woocommerce-mercadopago' ),
- 'subtitle' => __( 'Your customers pay faster with saved cards, money balance or other available methods in their Mercado Pago accounts.', 'woocommerce-mercadopago' ),
- 'type' => 'mp_toggle_switch',
- 'default' => 'yes',
- 'descriptions' => array(
- 'enabled' => __( 'Payments via Mercado Pago accounts are active.', 'woocommerce-mercadopago' ),
- 'disabled' => __( 'Payments via Mercado Pago accounts are inactive.', 'woocommerce-mercadopago' ),
- ),
- 'after_toggle' => $this->wallet_button_preview(),
- );
- }
-
- /**
- * Generate Wallet Button HTML
- *
- * @param $key field key
- * @param $settings settings array
- *
- * @return array
- */
- public function wallet_button_preview() {
- return wc_get_template_html(
- 'components/wallet-button.php',
- array (
- 'img_wallet_button_uri' => $this->get_wallet_button_example_uri(),
- 'img_wallet_button_description' => __( 'Check an example of how it will appear in your store:', 'woocommerce-mercadopago' ),
- ),
- '',
- WC_WooMercadoPago_Module::get_templates_path()
- );
- }
-
- /**
- * Returns wallet button URI based on current store locale
- *
- * @return string
- */
- public function get_wallet_button_example_uri() {
- $locale = substr( strtolower(get_locale()), 0, 2 );
-
- if ( 'pt' !== $locale && 'es' !== $locale ) {
- $locale = 'en';
- }
-
- return plugins_url( '../assets/images/pix-admin/example-' . $locale . '.png', plugin_dir_path( __FILE__ ) );
- }
-
- /**
- * Get Order Status
- *
- * @param string $status_detail Status.
- * @return string|void
- */
- public function get_order_status( $status_detail ) {
- switch ( $status_detail ) {
- case 'accredited':
- return __( 'That’s it, payment accepted!', 'woocommerce-mercadopago' );
- case 'pending_contingency':
- return __( 'We are processing your payment. In less than an hour we will send you the result by email.', 'woocommerce-mercadopago' );
- case 'pending_review_manual':
- return __( 'We are processing your payment. In less than 2 days we will send you by email if the payment has been approved or if additional information is needed.', 'woocommerce-mercadopago' );
- case 'cc_rejected_bad_filled_card_number':
- return __( 'Check the card number.', 'woocommerce-mercadopago' );
- case 'cc_rejected_bad_filled_date':
- return __( 'Check the expiration date.', 'woocommerce-mercadopago' );
- case 'cc_rejected_bad_filled_other':
- return __( 'Check the information provided.', 'woocommerce-mercadopago' );
- case 'cc_rejected_bad_filled_security_code':
- return __( 'Check the informed security code.', 'woocommerce-mercadopago' );
- case 'cc_rejected_card_error':
- case 'cc_rejected_blacklist':
- return __( 'Your payment cannot be processed.', 'woocommerce-mercadopago' );
- case 'cc_rejected_call_for_authorize':
- return __( 'You must authorize payments for your orders.', 'woocommerce-mercadopago' );
- case 'cc_rejected_card_disabled':
- return __( 'Contact your card issuer to activate it. The phone is on the back of your card.', 'woocommerce-mercadopago' );
- case 'cc_rejected_duplicated_payment':
- return __( 'You have already made a payment of this amount. If you have to pay again, use another card or other method of payment.', 'woocommerce-mercadopago' );
- case 'cc_rejected_high_risk':
- return __( 'Your payment was declined. Please select another payment method. It is recommended in cash.', 'woocommerce-mercadopago' );
- case 'cc_rejected_insufficient_amount':
- return __( 'Your payment does not have sufficient funds.', 'woocommerce-mercadopago' );
- case 'cc_rejected_invalid_installments':
- return __( 'Payment cannot process the selected fee.', 'woocommerce-mercadopago' );
- case 'cc_rejected_max_attempts':
- return __( 'You have reached the limit of allowed attempts. Choose another card or other payment method.', 'woocommerce-mercadopago' );
- default:
- return __( 'This payment method cannot process your payment.', 'woocommerce-mercadopago' );
- }
- }
-
- /**
- * Payment Fields
- */
- public function payment_fields() {
- // add css.
- $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
-
- wp_enqueue_style(
- 'woocommerce-mercadopago-narciso-styles',
- plugins_url( '../assets/css/mp-plugins-components.css', plugin_dir_path( __FILE__ ) ),
- array(),
- WC_WooMercadoPago_Constants::VERSION
- );
-
- $total = $this->get_order_total();
- $subtotal = (float) WC()->cart->subtotal;
- $tax = $total - $subtotal;
- $discount = $subtotal * ( $this->gateway_discount / 100 );
- $comission = $subtotal * ( $this->commission / 100 );
- $amount = $subtotal - $discount + $comission;
- $amount = $amount + $tax;
-
- $banner_url = $this->get_option( '_mp_custom_banner' );
- $test_mode_link = $this->get_mp_devsite_link($this->checkout_country);
- if ( ! isset( $banner_url ) || empty( $banner_url ) ) {
- $banner_url = $this->site_data['checkout_banner_custom'];
- }
-
- // credit or debit card.
- $debit_card = array();
- $credit_card = array();
- $tarjetas = get_option( '_checkout_payments_methods', '' );
-
- foreach ( $tarjetas as $tarjeta ) {
- if ( 'credit_card' === $tarjeta['type'] ) {
- $credit_card[] = array(
- 'src' => $tarjeta['image'],
- 'alt' => $tarjeta['name']
- );
- } elseif ( 'debit_card' === $tarjeta['type'] || 'prepaid_card' === $tarjeta['type'] ) {
- $debit_card[] = array(
- 'src' => $tarjeta['image'],
- 'alt' => $tarjeta['name']
- );
- }
- }
-
- $payment_methods = array();
-
- if ( 0 !== count( $credit_card ) ) {
- $payment_methods[] = array(
- 'title' => __( 'Credit cards', 'woocommerce-mercadopago' ),
- 'label' => __( 'Up to ' , 'woocommerce-mercadopago' ) . 12 . __( ' installments' , 'woocommerce-mercadopago' ),
- 'payment_methods' => $credit_card,
- );
- }
-
- if ( 0 !== count( $debit_card ) ) {
- $payment_methods[] = array(
- 'title' => __( 'Debit cards', 'woocommerce-mercadopago' ),
- 'payment_methods' => $debit_card,
- );
- }
-
- try {
- $currency_ratio = WC_WooMercadoPago_Helpers_CurrencyConverter::get_instance()->ratio( $this );
- } catch ( Exception $e ) {
- $currency_ratio = WC_WooMercadoPago_Helpers_CurrencyConverter::DEFAULT_RATIO;
- }
-
- $parameters = array(
- 'test_mode' => ! $this->is_production_mode(),
- 'test_mode_link' => $test_mode_link,
- 'amount' => $amount,
- 'site_id' => $this->mp_options->get_site_id(),
- 'public_key' => $this->get_public_key(),
- 'coupon_mode' => isset( $this->logged_user_email ) ? $this->coupon_mode : 'no',
- 'discount_action_url' => $this->discount_action_url,
- 'payer_email' => esc_js( $this->logged_user_email ),
- 'images_path' => plugins_url( '../assets/images/', plugin_dir_path( __FILE__ ) ),
- 'currency_ratio' => $currency_ratio,
- 'woocommerce_currency' => get_woocommerce_currency(),
- 'account_currency' => $this->site_data['currency'],
- 'payment_methods' => $payment_methods,
- 'wallet_button' => $this->wallet_button,
- );
-
- $parameters = array_merge($parameters, WC_WooMercadoPago_Helper_Links::mp_define_terms_and_conditions());
- wc_get_template( 'checkout/custom-checkout.php', $parameters, 'woo/mercado/pago/module/', WC_WooMercadoPago_Module::get_templates_path() );
- }
-
- /**
- * Process payment
- *
- * @param int $order_id Order Id.
- * @return array|void
- */
- public function process_payment( $order_id ) {
- // phpcs:ignore WordPress.Security.NonceVerification
- if ( ! isset( $_POST['mercadopago_custom']) ) {
- return $this->process_result_fail(
- __FUNCTION__,
- __( 'A problem was occurred when processing your payment. Please, try again.', 'woocommerce-mercadopago' ),
- __( 'A problem was occurred when processing your payment. Please, try again.', 'woocommerce-mercadopago' )
- );
- }
-
- // phpcs:ignore WordPress.Security.NonceVerification
- $custom_checkout = map_deep($_POST['mercadopago_custom'], 'sanitize_text_field');
- $custom_checkout_log = $custom_checkout;
-
- if ( isset($custom_checkout_log['token']) ) {
- unset($custom_checkout_log['token']);
- }
-
- $this->log->write_log( __FUNCTION__, 'POST Custom: ' . wp_json_encode( $custom_checkout_log, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ) );
-
- $order = wc_get_order( $order_id );
-
- $this->process_discount_and_commission( $order_id, $order );
-
- if ( 'wallet_button' === $custom_checkout['checkout_type'] ) {
- $this->log->write_log( __FUNCTION__, 'preparing to render wallet button checkout.' );
- $response = $this->process_custom_checkout_wallet_button_flow( $order );
- } else {
- $this->log->write_log( __FUNCTION__, 'preparing to get response of custom checkout.' );
- $response = $this->process_custom_checkout_flow( $custom_checkout, $order );
- }
-
- if ( $response ) {
- return $response;
- }
-
- return $this->process_result_fail(
- __FUNCTION__,
- __( 'A problem was occurred when processing your payment. Please, try again.', 'woocommerce-mercadopago' ),
- __( 'A problem was occurred when processing your payment. Please, try again.', 'woocommerce-mercadopago' )
- );
- }
-
- /**
- * Process Custom Wallet Button Flow
- *
- * @param WC_Order $order
- *
- * @return array
- */
- protected function process_custom_checkout_wallet_button_flow( $order ) {
- return array(
- 'result' => 'success',
- 'redirect' => add_query_arg(
- array(
- 'wallet_button' => 'open'
- ),
- $order->get_checkout_payment_url( true )
- ),
- );
- }
-
- /**
- * Process Custom Payment Flow
- *
- * @param array $custom_checkout
- * @param WC_Order $order
- *
- * @return array|string[]
- * @throws WC_Data_Exception
- */
- protected function process_custom_checkout_flow( $custom_checkout, $order ) {
- if (
- isset( $custom_checkout['amount'] ) && ! empty( $custom_checkout['amount'] ) &&
- isset( $custom_checkout['token'] ) && ! empty( $custom_checkout['token'] ) &&
- isset( $custom_checkout['paymentMethodId'] ) && ! empty( $custom_checkout['paymentMethodId'] ) &&
- isset( $custom_checkout['installments'] ) && ! empty( $custom_checkout['installments'] ) &&
- -1 !== $custom_checkout['installments']
- ) {
- $response = $this->create_payment( $order, $custom_checkout );
-
- if ( ! is_array( $response ) ) {
- return array(
- 'result' => 'fail',
- 'redirect' => '',
- );
- }
-
- $installments = (float) $response['installments'];
- $installment_amount = (float) $response['transaction_details']['installment_amount'];
- $transaction_amount = (float) $response['transaction_amount'];
- $total_paid_amount = (float) $response['transaction_details']['total_paid_amount'];
- $last_four_digits = (float) $response['transaction_details']['last_four_digits'];
- $id_payment = (float) $response['id'];
-
- // Old
- $order->add_meta_data('mp_installments', $installments);
- $order->add_meta_data('mp_transaction_details', $installment_amount);
- $order->add_meta_data('mp_transaction_amount', $transaction_amount);
- $order->add_meta_data('mp_total_paid_amount', $total_paid_amount);
- $order->save();
-
- // New key names
- $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - installments', $installments);
- $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - installment_amount', $installment_amount);
- $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - transaction_amount', $transaction_amount);
- $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - total_paid_amount', $total_paid_amount);
- $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - card_last_four_digits', $last_four_digits);
- $order->save();
-
- $this->hook->update_mp_order_payments_metadata( $order->get_id(), [ $response['id'] ] );
-
- // Switch on response.
- if ( array_key_exists( 'status', $response ) ) {
- switch ( $response['status'] ) {
- case 'approved':
- WC()->cart->empty_cart();
- wc_add_notice( '
' . $this->get_order_status( 'accredited' ) . '
', 'notice' );
- $this->set_order_to_pending_on_retry( $order );
- return array(
- 'result' => 'success',
- 'redirect' => $order->get_checkout_order_received_url(),
- );
- case 'pending':
- // Order approved/pending, we just redirect to the thankyou page.
- return array(
- 'result' => 'success',
- 'redirect' => $order->get_checkout_order_received_url(),
- );
- case 'in_process':
- // For pending, we don't know if the purchase will be made, so we must inform this status.
- WC()->cart->empty_cart();
- wc_add_notice(
- '
',
- 'notice'
- );
- return array(
- 'result' => 'success',
- 'redirect' => $order->get_checkout_payment_url( true ),
- );
- case 'rejected':
- // If rejected is received, the order will not proceed until another payment try, so we must inform this status.
- wc_add_notice(
- '
' . __(
- 'Your payment was declined. You can try again.',
- 'woocommerce-mercadopago'
- ) . ' ' .
- $this->get_order_status( $response['status_detail'] ) .
- '
',
- 'error'
- );
- return array(
- 'result' => 'success',
- 'redirect' => $order->get_checkout_payment_url( true ),
- );
- case 'cancelled':
- case 'in_mediation':
- case 'charged_back':
- // If we enter here (an order generating a direct [cancelled, in_mediation, or charged_back] status),
- // then there must be something very wrong!
- break;
- default:
- break;
- }
- }
-
- // Process when fields are incomplete.
- return $this->process_result_fail(
- __FUNCTION__,
- __( 'A problem was occurred when processing your payment. Are you sure you have correctly filled all information in the checkout form?', 'woocommerce-mercadopago' ),
- __( 'A problem was occurred when processing your payment. Are you sure you have correctly filled all information in the checkout form?', 'woocommerce-mercadopago' ) . ' MERCADO PAGO: ' .
- WC_WooMercadoPago_Module::get_common_error_messages( $response )
- );
- }
- }
-
- /**
- * Display installment fee as an order attachment item
- *
- * @param $order_id
- */
- public function display_installment_fee_order( $order_id ) {
- $order = wc_get_order( $order_id );
- $order->get_meta_data();
-
- $gatewayName = $order->get_meta( '_used_gateway' );
- if ( strpos($gatewayName, 'Custom_Gateway') ) {
- $total_paid_amount = $order->get_meta( 'mp_total_paid_amount' );
- $transaction_amount = $order->get_meta( 'mp_transaction_amount' );
- $installment_fee_amount = (float) $total_paid_amount - (float) $transaction_amount;
- $total_with_fees = $installment_fee_amount + (float) $transaction_amount;
-
- if ( $installment_fee_amount > 0 ) {
- $this->display_order_note( [
- 'tip_text' => __('Represents the installment fee charged by Mercado Pago.', 'woocommerce-mercadopago'),
- 'title' => __('Mercado Pago Installment Fee:', 'woocommerce-mercadopago'),
- 'value' => wc_price($installment_fee_amount, []),
- ] );
-
- $this->display_order_note( [
- 'tip_text' => __('Represents the total purchase plus the installment fee charged by Mercado Pago.', 'woocommerce-mercadopago'),
- 'title' => __('Mercado Pago Total:', 'woocommerce-mercadopago'),
- 'value' => wc_price($total_with_fees, []),
- ] );
- }
- }
- }
-
- /**
- * Display generic template for order notes
- *
- * @param array $params
- */
- public function display_order_note( $params ) {
- wc_get_template(
- 'order/generic-order-note.php',
- $params,
- 'woo/mercado/pago/module/',
- WC_WooMercadoPago_Module::get_templates_path()
- );
- }
-
- /**
- * Fill a commission and discount information
- *
- * @param $order_id
- * @param $order
- */
- protected function process_discount_and_commission( $order_id, $order ) {
- $amount = (float) WC()->cart->subtotal;
- $shipping_taxes = floatval($order->get_shipping_total());
-
- $order->update_meta_data( 'is_production_mode', 'no' === $this->mp_options->get_checkbox_checkout_test_mode() ? 'yes' : 'no' );
- $order->update_meta_data( '_used_gateway', get_class( $this ) );
-
- if ( ! empty( $this->gateway_discount ) ) {
- $discount = ( $amount * $this->gateway_discount / 100 );
- $order->set_total($amount - $discount + $shipping_taxes);
- }
-
- if ( ! empty( $this->commission ) ) {
- $comission = $amount * ( $this->commission / 100 );
- $order->update_meta_data( 'Mercado Pago: commission', __( 'fee of', 'woocommerce-mercadopago' ) . ' ' . $this->commission . '% / ' . __( 'fee of', 'woocommerce-mercadopago' ) . ' = ' . $comission );
- }
- $order->save();
- }
-
- /**
- * Process if result is fail
- *
- * @param $function
- * @param $log_message
- * @param $notice_message
- *
- * @return string[]
- */
- protected function process_result_fail( $function, $log_message, $notice_message ) {
- $this->log->write_log( $function, $log_message );
-
- wc_add_notice(
- '
' . $notice_message . '
',
- 'error'
- );
-
- return array(
- 'result' => 'fail',
- 'redirect' => '',
- );
- }
-
- /**
- * Create Payment
- *
- * @param object $order Order.
- * @param mixed $custom_checkout Checkout info.
- * @return string|array
- */
- protected function create_payment( $order, $custom_checkout ) {
- $preferences_custom = new WC_WooMercadoPago_Preference_Custom( $this, $order, $custom_checkout );
- $payment = $preferences_custom->get_transaction( 'Payment' );
-
- try {
- $checkout_info = $payment->save();
- $this->log->write_log( __FUNCTION__, 'Payment created: ' . wp_json_encode( $checkout_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ) );
- return $checkout_info;
- } catch ( Exception $e ) {
- $this->log->write_log( __FUNCTION__, 'payment creation failed with error: ' . $e->getMessage() );
- return $e->getMessage();
- }
- }
-
- /**
- * Create Wallet Button Preference
- *
- * @param $order
- *
- * @return false|mixed
- */
- public function create_preference_wallet_button( $order ) {
- $this->installments = 12;
- $preference_wallet_button = new WC_WooMercadoPago_Preference_Custom_Wallet_Button( $this, $order );
- $preference = $preference_wallet_button->get_transaction( 'Preference' );
-
- try {
- $checkout_info = $preference->save();
- $this->log->write_log( __FUNCTION__, 'Created Preference: ' . wp_json_encode( $checkout_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE ) );
- return $checkout_info;
- } catch ( Exception $e ) {
- $this->log->write_log( __FUNCTION__, 'preference creation failed with error: ' . $e->getMessage() );
- return false;
- }
- }
-
- /**
- * Is available?
- *
- * @return bool
- */
- public function is_available() {
- if ( ! parent::is_available() ) {
- return false;
- }
-
- $_mp_access_token = $this->mp_options->get_access_token_prod();
- $is_prod_credentials = false === WC_WooMercadoPago_Credentials::validate_credentials_test( $this->mp, $_mp_access_token, null );
-
- if ( ( empty( $_SERVER['HTTPS'] ) || 'off' === $_SERVER['HTTPS'] ) && $is_prod_credentials ) {
- $this->log->write_log( __FUNCTION__, 'NO HTTPS, Custom unavailable.' );
- return false;
- }
-
- return true;
- }
-
- /**
- * Get Id
- *
- * @return string
- */
- public static function get_id() {
- return self::ID;
- }
-
- /**
- * Get Mercado Pago Icon
- *
- * @return mixed
- */
- public function get_checkout_icon() {
- /**
- * Add Mercado Pago icon.
- *
- * @since 3.0.1
- */
- return apply_filters( 'woocommerce_mercadopago_icon', plugins_url( '../assets/images/icons/card.png', plugin_dir_path( __FILE__ ) ) );
- }
-
+ ),
+ 'type' => 'title',
+ 'class' => 'mp_title_header',
+ );
+ return $checkout_custom_header;
+ }
+
+ /**
+ * Field checkout custom payment advanced title
+ *
+ * @return array
+ */
+ public function field_checkout_custom_payments_advanced_title() {
+ $checkout_custom_payments_advanced_title = array(
+ 'title' => __( 'Advanced configuration of the personalized payment experience', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'type' => 'title',
+ 'class' => 'mp_subtitle_bd',
+ );
+ return $checkout_custom_payments_advanced_title;
+ }
+
+ /**
+ * Field Wallet Button toggle
+ *
+ * @return array
+ */
+ public function field_checkout_custom_wallet_button_title() {
+ return array(
+ 'title' => __( 'Payments via Mercado Pago account', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'subtitle' => __( 'Your customers pay faster with saved cards, money balance or other available methods in their Mercado Pago accounts.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'type' => 'mp_toggle_switch',
+ 'default' => 'yes',
+ 'descriptions' => array(
+ 'enabled' => __( 'Payments via Mercado Pago accounts are active.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'disabled' => __( 'Payments via Mercado Pago accounts are inactive.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ 'after_toggle' => $this->wallet_button_preview(),
+ );
+ }
+
+ /**
+ * Generate Wallet Button HTML
+ *
+ * @param $key field key
+ * @param $settings settings array
+ *
+ * @return array
+ */
+ public function wallet_button_preview() {
+ return wc_get_template_html(
+ 'components/wallet-button.php',
+ array (
+ 'img_wallet_button_uri' => $this->get_wallet_button_example_uri(),
+ 'img_wallet_button_description' => __( 'Check an example of how it will appear in your store:', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ ),
+ '',
+ WC_WooMercadoPago_Module::get_templates_path()
+ );
+ }
+
+ /**
+ * Returns wallet button URI based on current store locale
+ *
+ * @return string
+ */
+ public function get_wallet_button_example_uri() {
+ $locale = substr( strtolower(get_locale()), 0, 2 );
+
+ if ( 'pt' !== $locale && 'es' !== $locale ) {
+ $locale = 'en';
+ }
+
+ return plugins_url( '../assets/images/pix-admin/example-' . $locale . '.png', plugin_dir_path( __FILE__ ) );
+ }
+
+ /**
+ * Get Order Status
+ *
+ * @param string $status_detail Status.
+ * @return string|void
+ */
+ public function get_order_status( $status_detail ) {
+ switch ( $status_detail ) {
+ case 'accredited':
+ return __( 'That’s it, payment accepted!', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'pending_contingency':
+ return __( 'We are processing your payment. In less than an hour we will send you the result by email.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'pending_review_manual':
+ return __( 'We are processing your payment. In less than 2 days we will send you by email if the payment has been approved or if additional information is needed.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_bad_filled_card_number':
+ return __( 'Check the card number.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_bad_filled_date':
+ return __( 'Check the expiration date.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_bad_filled_other':
+ return __( 'Check the information provided.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_bad_filled_security_code':
+ return __( 'Check the informed security code.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_card_error':
+ case 'cc_rejected_blacklist':
+ return __( 'Your payment cannot be processed.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_call_for_authorize':
+ return __( 'You must authorize payments for your orders.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_card_disabled':
+ return __( 'Contact your card issuer to activate it. The phone is on the back of your card.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_duplicated_payment':
+ return __( 'You have already made a payment of this amount. If you have to pay again, use another card or other method of payment.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_high_risk':
+ return __( 'Your payment was declined. Please select another payment method. It is recommended in cash.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_insufficient_amount':
+ return __( 'Your payment does not have sufficient funds.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_invalid_installments':
+ return __( 'Payment cannot process the selected fee.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ case 'cc_rejected_max_attempts':
+ return __( 'You have reached the limit of allowed attempts. Choose another card or other payment method.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ default:
+ return __( 'This payment method cannot process your payment.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN );
+ }
+ }
+
+ /**
+ * Payment Fields
+ */
+ public function payment_fields(): void {
+ // add css.
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
+
+ wp_enqueue_style(
+ 'woocommerce-mercadopago-narciso-styles',
+ plugins_url( '../assets/css/mp-plugins-components.css', plugin_dir_path( __FILE__ ) ),
+ array(),
+ WC_WooMercadoPago_Constants::VERSION
+ );
+
+ $total = $this->get_order_total();
+ $subtotal = (float) WC()->cart->subtotal;
+ $tax = $total - $subtotal;
+ $discount = $subtotal * ( $this->gateway_discount / 100 );
+ $comission = $subtotal * ( $this->commission / 100 );
+ $amount = $subtotal - $discount + $comission;
+ $amount = $amount + $tax;
+
+ $banner_url = $this->get_option( '_mp_custom_banner' );
+ $test_mode_link = $this->get_mp_devsite_link($this->checkout_country);
+ if ( ! isset( $banner_url ) || empty( $banner_url ) ) {
+ $banner_url = $this->site_data['checkout_banner_custom'];
+ }
+
+ // credit or debit card.
+ $debit_card = array();
+ $credit_card = array();
+ $tarjetas = get_option( '_checkout_payments_methods', '' );
+
+ foreach ( $tarjetas as $tarjeta ) {
+ if ( 'credit_card' === $tarjeta['type'] ) {
+ $credit_card[] = array(
+ 'src' => $tarjeta['image'],
+ 'alt' => $tarjeta['name']
+ );
+ } elseif ( 'debit_card' === $tarjeta['type'] || 'prepaid_card' === $tarjeta['type'] ) {
+ $debit_card[] = array(
+ 'src' => $tarjeta['image'],
+ 'alt' => $tarjeta['name']
+ );
+ }
+ }
+
+ $payment_methods = array();
+
+ if ( 0 !== count( $credit_card ) ) {
+ $payment_methods[] = array(
+ 'title' => __( 'Credit cards', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'label' => __( 'Up to ', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) . 12 . __( ' installments', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'payment_methods' => $credit_card,
+ );
+ }
+
+ if ( 0 !== count( $debit_card ) ) {
+ $payment_methods[] = array(
+ 'title' => __( 'Debit cards', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ 'payment_methods' => $debit_card,
+ );
+ }
+
+ try {
+ $currency_ratio = WC_WooMercadoPago_Helpers_CurrencyConverter::get_instance()->ratio( $this );
+ } catch ( Exception $e ) {
+ $currency_ratio = WC_WooMercadoPago_Helpers_CurrencyConverter::DEFAULT_RATIO;
+ }
+
+ $parameters = array(
+ 'test_mode' => ! $this->is_production_mode(),
+ 'test_mode_link' => $test_mode_link,
+ 'amount' => $amount,
+ 'site_id' => $this->mp_options->get_site_id(),
+ 'public_key' => $this->get_public_key(),
+ 'coupon_mode' => isset( $this->logged_user_email ) ? $this->coupon_mode : 'no',
+ 'discount_action_url' => $this->discount_action_url,
+ 'payer_email' => esc_js( $this->logged_user_email ),
+ 'images_path' => plugins_url( '../assets/images/', plugin_dir_path( __FILE__ ) ),
+ 'currency_ratio' => $currency_ratio,
+ 'woocommerce_currency' => get_woocommerce_currency(),
+ 'account_currency' => $this->site_data['currency'],
+ 'payment_methods' => $payment_methods,
+ 'wallet_button' => $this->wallet_button,
+ );
+
+ $parameters = array_merge($parameters, WC_WooMercadoPago_Helper_Links::mp_define_terms_and_conditions());
+ wc_get_template( 'checkout/custom-checkout.php', $parameters, 'woo/mercado/pago/module/', WC_WooMercadoPago_Module::get_templates_path() );
+ }
+
+ /**
+ * Process payment
+ *
+ * @param int $order_id Order Id.
+ * @return array|void
+ */
+ public function process_payment( $order_id ) {
+ // phpcs:ignore WordPress.Security.NonceVerification
+ if ( ! isset( $_POST['mercadopago_custom']) ) {
+ return $this->process_result_fail(
+ __FUNCTION__,
+ __( 'A problem was occurred when processing your payment. Please, try again.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ __( 'A problem was occurred when processing your payment. Please, try again.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN )
+ );
+ }
+
+ // phpcs:ignore WordPress.Security.NonceVerification
+ $custom_checkout = map_deep($_POST['mercadopago_custom'], 'sanitize_text_field');
+ $custom_checkout_log = $custom_checkout;
+
+ if ( isset($custom_checkout_log['token']) ) {
+ unset($custom_checkout_log['token']);
+ }
+
+ $this->log->write_log( __FUNCTION__, 'POST Custom: ' . wp_json_encode( $custom_checkout_log, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE ) );
+
+ $order = wc_get_order( $order_id );
+
+ $this->process_discount_and_commission( $order_id, $order );
+
+ if ( 'wallet_button' === $custom_checkout['checkout_type'] ) {
+ $this->log->write_log( __FUNCTION__, 'preparing to render wallet button checkout.' );
+ $response = $this->process_custom_checkout_wallet_button_flow( $order );
+ } else {
+ $this->log->write_log( __FUNCTION__, 'preparing to get response of custom checkout.' );
+ $response = $this->process_custom_checkout_flow( $custom_checkout, $order );
+ }
+
+ if ( $response ) {
+ return $response;
+ }
+
+ return $this->process_result_fail(
+ __FUNCTION__,
+ __( 'A problem was occurred when processing your payment. Please, try again.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ __( 'A problem was occurred when processing your payment. Please, try again.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN )
+ );
+ }
+
+ /**
+ * Process Custom Wallet Button Flow
+ *
+ * @param WC_Order $order
+ *
+ * @return array
+ */
+ protected function process_custom_checkout_wallet_button_flow( $order ) {
+ return array(
+ 'result' => 'success',
+ 'redirect' => add_query_arg(
+ array(
+ 'wallet_button' => 'open'
+ ),
+ $order->get_checkout_payment_url( true )
+ ),
+ );
+ }
+
+ /**
+ * Process Custom Payment Flow
+ *
+ * @param array $custom_checkout
+ * @param WC_Order $order
+ *
+ * @return array|string[]
+ * @throws WC_Data_Exception
+ */
+ protected function process_custom_checkout_flow( $custom_checkout, $order ) {
+ if (
+ isset( $custom_checkout['amount'] ) && ! empty( $custom_checkout['amount'] ) &&
+ isset( $custom_checkout['token'] ) && ! empty( $custom_checkout['token'] ) &&
+ isset( $custom_checkout['paymentMethodId'] ) && ! empty( $custom_checkout['paymentMethodId'] ) &&
+ isset( $custom_checkout['installments'] ) && ! empty( $custom_checkout['installments'] ) &&
+ -1 !== $custom_checkout['installments']
+ ) {
+ $response = $this->create_payment( $order, $custom_checkout );
+
+ if ( ! is_array( $response ) ) {
+ return array(
+ 'result' => 'fail',
+ 'redirect' => '',
+ );
+ }
+
+ $installments = (float) $response['installments'];
+ $installment_amount = (float) $response['transaction_details']['installment_amount'];
+ $transaction_amount = (float) $response['transaction_amount'];
+ $total_paid_amount = (float) $response['transaction_details']['total_paid_amount'];
+ $last_four_digits = (float) $response['transaction_details']['last_four_digits'];
+ $id_payment = (float) $response['id'];
+
+ // Old
+ $order->add_meta_data('mp_installments', $installments);
+ $order->add_meta_data('mp_transaction_details', $installment_amount);
+ $order->add_meta_data('mp_transaction_amount', $transaction_amount);
+ $order->add_meta_data('mp_total_paid_amount', $total_paid_amount);
+ $order->save();
+
+ // New key names
+ $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - installments', $installments);
+ $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - installment_amount', $installment_amount);
+ $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - transaction_amount', $transaction_amount);
+ $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - total_paid_amount', $total_paid_amount);
+ $order->add_meta_data('Mercado Pago - ' . $id_payment . ' - card_last_four_digits', $last_four_digits);
+ $order->save();
+
+ $this->hook->update_mp_order_payments_metadata( $order->get_id(), array($response['id']) );
+
+ // Switch on response.
+ if ( array_key_exists( 'status', $response ) ) {
+ switch ( $response['status'] ) {
+ case 'approved':
+ WC()->cart->empty_cart();
+ wc_add_notice( '
' . $this->get_order_status( 'accredited' ) . '
', 'notice' );
+ $this->set_order_to_pending_on_retry( $order );
+ return array(
+ 'result' => 'success',
+ 'redirect' => $order->get_checkout_order_received_url(),
+ );
+ case 'pending':
+ // Order approved/pending, we just redirect to the thankyou page.
+ return array(
+ 'result' => 'success',
+ 'redirect' => $order->get_checkout_order_received_url(),
+ );
+ case 'in_process':
+ // For pending, we don't know if the purchase will be made, so we must inform this status.
+ WC()->cart->empty_cart();
+ wc_add_notice(
+ '
',
+ 'notice'
+ );
+ return array(
+ 'result' => 'success',
+ 'redirect' => $order->get_checkout_payment_url( true ),
+ );
+ case 'rejected':
+ // If rejected is received, the order will not proceed until another payment try, so we must inform this status.
+ wc_add_notice(
+ '
' . __(
+ 'Your payment was declined. You can try again.',
+ LKN_WC_MERCADOPAGO_TEXT_DOMAIN
+ ) . ' ' .
+ $this->get_order_status( $response['status_detail'] ) .
+ '
- ' . __( 'With the Transparent Checkout, you can sell inside your store environment, without redirection and all the safety from Mercado Pago. ', 'woocommerce-mercadopago' ) . '
+ ' . __( 'With the Transparent Checkout, you can sell inside your store environment, without redirection and all the safety from Mercado Pago. ', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) . '
Mercado Pago: ' . __( 'Now you just need to pay with Pix to finalize your purchase.', 'woocommerce-mercadopago' ) . ' ' .
- __( 'Scan the QR code below or copy and paste the code into your bank\'s application.', 'woocommerce-mercadopago' ) . '
' .
- __( 'A problem occurred when processing your payment. Are you sure you have correctly filled in all the information on the checkout form?', 'woocommerce-mercadopago' ) . ' MERCADO PAGO: ' .
- WC_WooMercadoPago_Module::get_common_error_messages( $response ) .
- '
Mercado Pago: ' . __( 'Now you just need to pay with Pix to finalize your purchase.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) . ' ' .
+ __( 'Scan the QR code below or copy and paste the code into your bank\'s application.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) . '
' .
+ __( 'A problem occurred when processing your payment. Are you sure you have correctly filled in all the information on the checkout form?', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) . ' MERCADO PAGO: ' .
+ WC_WooMercadoPago_Module::get_common_error_messages( $response ) .
+ '
- ' . __( 'With the Transparent Checkout, you can sell inside your store environment, without redirection and all the safety from Mercado Pago.', 'woocommerce-mercadopago' ) . '
+ ' . __( 'With the Transparent Checkout, you can sell inside your store environment, without redirection and all the safety from Mercado Pago.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) . '
' .
- __( 'Your document data is invalid', 'woocommerce-mercadopago' ) .
- '
',
- 'error'
- );
- } else {
- wc_add_notice(
- '
' .
- __( 'There was a problem processing your payment. Are you sure you have correctly filled out all the information on the payment form?', 'woocommerce-mercadopago' ) .
- '
' .
- __( 'Your document data is invalid', 'woocommerce-mercadopago' ) .
- '
',
- 'error'
- );
- } else {
- wc_add_notice(
- '
' .
- __( 'There was a problem processing your payment. Are you sure you have correctly filled out all the information on the payment form?', 'woocommerce-mercadopago' ) .
- '
' .
- __( 'A problem occurred when processing your payment. Are you sure you have correctly filled in all the information on the checkout form?', 'woocommerce-mercadopago' ) . ' MERCADO PAGO: ' .
- WC_WooMercadoPago_Module::get_common_error_messages( $response ) .
- '
',
- 'error'
- );
-
- return array(
- 'result' => 'fail',
- 'redirect' => '',
- );
- }
- } else {
- // Process when fields are incomplete.
- return $this->process_result_fail(
- __FUNCTION__,
- __( 'A problem was occurred when processing your payment. Please, try again.', 'woocommerce-mercadopago' ),
- __( 'A problem was occurred when processing your payment. Please, try again.', 'woocommerce-mercadopago' )
- );
- }
- }
-
- /**
- * Process if result is fail
- *
- * @param $function
- * @param $log_message
- * @param $notice_message
- *
- * @return string[]
- */
- protected function process_result_fail( $function, $log_message, $notice_message ) {
- $this->log->write_log( $function, $log_message );
-
- wc_add_notice(
- '
' .
+ __( 'Your document data is invalid', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) .
+ '
',
+ 'error'
+ );
+ } else {
+ wc_add_notice(
+ '
' .
+ __( 'There was a problem processing your payment. Are you sure you have correctly filled out all the information on the payment form?', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) .
+ '
' .
+ __( 'Your document data is invalid', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) .
+ '
',
+ 'error'
+ );
+ } else {
+ wc_add_notice(
+ '
' .
+ __( 'There was a problem processing your payment. Are you sure you have correctly filled out all the information on the payment form?', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) .
+ '
' .
+ __( 'A problem occurred when processing your payment. Are you sure you have correctly filled in all the information on the checkout form?', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ) . ' MERCADO PAGO: ' .
+ WC_WooMercadoPago_Module::get_common_error_messages( $response ) .
+ '
',
+ 'error'
+ );
+
+ return array(
+ 'result' => 'fail',
+ 'redirect' => '',
+ );
+ }
+ } else {
+ // Process when fields are incomplete.
+ return $this->process_result_fail(
+ __FUNCTION__,
+ __( 'A problem was occurred when processing your payment. Please, try again.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN ),
+ __( 'A problem was occurred when processing your payment. Please, try again.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN )
+ );
+ }
+ }
+
+ /**
+ * Process if result is fail
+ *
+ * @param $function
+ * @param $log_message
+ * @param $notice_message
+ *
+ * @return string[]
+ */
+ protected function process_result_fail( $function, $log_message, $notice_message ) {
+ $this->log->write_log( $function, $log_message );
+
+ wc_add_notice(
+ '
',
+ $noticeClass,
+ apply_filters($this->updateChecker->getUniqueName('manual_check_message'), $message, $status),
+ $details
+ );
+ }
+ }
+
+ /**
+ * Format the list of errors that were thrown during an update check.
+ *
+ * @param array $errors
+ * @return string
+ */
+ protected function formatManualCheckErrors($errors) {
+ if ( empty($errors) ) {
+ return '';
+ }
+ $output = '';
+
+ $showAsList = count($errors) > 1;
+ if ( $showAsList ) {
+ $output .= '';
+ $formatString = '
%1$s %2$s
';
+ } else {
+ $formatString = '
%1$s %2$s
';
+ }
+ foreach ($errors as $item) {
+ $wpError = $item['error'];
+ /** @var WP_Error $wpError */
+ $output .= sprintf(
+ $formatString,
+ $wpError->get_error_message(),
+ $wpError->get_error_code()
+ );
+ }
+ if ( $showAsList ) {
+ $output .= '';
+ }
+
+ return $output;
+ }
+
+ public function removeHooks() {
+ remove_action('admin_init', [$this, 'onAdminInit']);
+ remove_filter('plugin_row_meta', [$this, 'addViewDetailsLink'], 10);
+ remove_filter('plugin_row_meta', [$this, 'addCheckForUpdatesLink'], 10);
+ remove_action('all_admin_notices', [$this, 'displayManualCheckResult']);
+ }
+ }
+endif;
diff --git a/packages/plugin-updater/Puc/Plugin/Update.php b/packages/plugin-updater/Puc/Plugin/Update.php
new file mode 100644
index 000000000..165bc357c
--- /dev/null
+++ b/packages/plugin-updater/Puc/Plugin/Update.php
@@ -0,0 +1,112 @@
+copyFields($object, $update);
+ return $update;
+ }
+
+ /**
+ * @return string[]
+ */
+ protected function getFieldNames() {
+ return array_merge(parent::getFieldNames(), self::$extraFields);
+ }
+
+ /**
+ * Transform the update into the format used by WordPress native plugin API.
+ *
+ * @return object
+ */
+ public function toWpFormat() {
+ $update = parent::toWpFormat();
+
+ $update->id = $this->id;
+ $update->url = $this->homepage;
+ $update->tested = $this->tested;
+ $update->requires_php = $this->requires_php;
+ $update->plugin = $this->filename;
+
+ if ( !empty($this->upgrade_notice) ) {
+ $update->upgrade_notice = $this->upgrade_notice;
+ }
+
+ if ( !empty($this->icons) && is_array($this->icons) ) {
+ //This should be an array with up to 4 keys: 'svg', '1x', '2x' and 'default'.
+ //Docs: https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/#plugin-icons
+ $icons = array_intersect_key(
+ $this->icons,
+ ['svg' => true, '1x' => true, '2x' => true, 'default' => true]
+ );
+ if ( !empty($icons) ) {
+ $update->icons = $icons;
+
+ //It appears that the 'default' icon isn't used anywhere in WordPress 4.9,
+ //but lets set it just in case a future release needs it.
+ if ( !isset($update->icons['default']) ) {
+ $update->icons['default'] = current($update->icons);
+ }
+ }
+ }
+
+ return $update;
+ }
+ }
+
+endif;
diff --git a/packages/plugin-updater/Puc/Plugin/UpdateChecker.php b/packages/plugin-updater/Puc/Plugin/UpdateChecker.php
new file mode 100644
index 000000000..2412a40ba
--- /dev/null
+++ b/packages/plugin-updater/Puc/Plugin/UpdateChecker.php
@@ -0,0 +1,410 @@
+pluginAbsolutePath = $pluginFile;
+ $this->pluginFile = plugin_basename($this->pluginAbsolutePath);
+ $this->muPluginFile = $muPluginFile;
+
+ //If no slug is specified, use the name of the main plugin file as the slug.
+ //For example, 'my-cool-plugin/cool-plugin.php' becomes 'cool-plugin'.
+ if ( empty($slug) ) {
+ $slug = basename($this->pluginFile, '.php');
+ }
+
+ //Plugin slugs must be unique.
+ $slugCheckFilter = 'puc_is_slug_in_use-' . $slug;
+ $slugUsedBy = apply_filters($slugCheckFilter, false);
+ if ( $slugUsedBy ) {
+ $this->triggerError(sprintf(
+ 'Plugin slug "%s" is already in use by %s. Slugs must be unique.',
+ htmlentities($slug),
+ htmlentities($slugUsedBy)
+ ), E_USER_ERROR);
+ }
+ add_filter($slugCheckFilter, [$this, 'getAbsolutePath']);
+
+ parent::__construct($metadataUrl, dirname($this->pluginFile), $slug, $checkPeriod, $optionName);
+
+ //Backwards compatibility: If the plugin is a mu-plugin but no $muPluginFile is specified, assume
+ //it's the same as $pluginFile given that it's not in a subdirectory (WP only looks in the base dir).
+ if ( (strpbrk($this->pluginFile, '/\\') === false) && $this->isUnknownMuPlugin() ) {
+ $this->muPluginFile = $this->pluginFile;
+ }
+
+ //To prevent a crash during plugin uninstallation, remove updater hooks when the user removes the plugin.
+ //Details: https://github.com/YahnisElsts/plugin-update-checker/issues/138#issuecomment-335590964
+ add_action('uninstall_' . $this->pluginFile, [$this, 'removeHooks']);
+
+ $this->extraUi = new Lkn_Puc_Plugin_Ui($this);
+ }
+
+ /**
+ * Create an instance of the scheduler.
+ *
+ * @param int $checkPeriod
+ * @return Lkn_Puc_Scheduler
+ */
+ protected function createScheduler($checkPeriod) {
+ $scheduler = new Lkn_Puc_Scheduler($this, $checkPeriod, ['load-plugins.php']);
+ register_deactivation_hook($this->pluginFile, [$scheduler, 'removeUpdaterCron']);
+ return $scheduler;
+ }
+
+ /**
+ * Install the hooks required to run periodic update checks and inject update info
+ * into WP data structures.
+ *
+ * @return void
+ */
+ protected function installHooks() {
+ //Override requests for plugin information
+ add_filter('plugins_api', [$this, 'injectInfo'], 20, 3);
+
+ parent::installHooks();
+ }
+
+ /**
+ * Remove update checker hooks.
+ *
+ * The intent is to prevent a fatal error that can happen if the plugin has an uninstall
+ * hook. During uninstallation, WP includes the main plugin file (which creates a PUC instance),
+ * the uninstall hook runs, WP deletes the plugin files and then updates some transients.
+ * If PUC hooks are still around at this time, they could throw an error while trying to
+ * autoload classes from files that no longer exist.
+ *
+ * The "site_transient_{$transient}" filter is the main problem here, but let's also remove
+ * most other PUC hooks to be safe.
+ *
+ * @internal
+ */
+ public function removeHooks() {
+ parent::removeHooks();
+ $this->extraUi->removeHooks();
+ $this->package->removeHooks();
+
+ remove_filter('plugins_api', [$this, 'injectInfo'], 20);
+ }
+
+ /**
+ * Retrieve plugin info from the configured API endpoint.
+ *
+ * @uses wp_remote_get()
+ *
+ * @param array $queryArgs Additional query arguments to append to the request. Optional.
+ * @return Lkn_Puc_Plugin_Info
+ */
+ public function requestInfo($queryArgs = []) {
+ list($pluginInfo, $result) = $this->requestMetadata('Lkn_Puc_Plugin_Info', $queryArgs);
+
+ if ( $pluginInfo !== null ) {
+ /** @var Lkn_Puc_Plugin_Info $pluginInfo */
+ $pluginInfo->filename = $this->pluginFile;
+ $pluginInfo->slug = $this->slug;
+ }
+
+ $pluginInfo = apply_filters($this->getUniqueName('request_info_result'), $pluginInfo, $result);
+ return $pluginInfo;
+ }
+
+ /**
+ * Retrieve the latest update (if any) from the configured API endpoint.
+ *
+ * @uses PluginUpdateChecker::requestInfo()
+ *
+ * @return Lkn_Puc_Update|null An instance of Plugin_Update, or NULL when no updates are available.
+ */
+ public function requestUpdate() {
+ //For the sake of simplicity, this function just calls requestInfo()
+ //and transforms the result accordingly.
+ $pluginInfo = $this->requestInfo(['checking_for_updates' => '1']);
+ if ( $pluginInfo === null ) {
+ return null;
+ }
+ $update = Lkn_Puc_Plugin_Update::fromPluginInfo($pluginInfo);
+
+ $update = $this->filterUpdateResult($update);
+
+ return $update;
+ }
+
+ /**
+ * Intercept plugins_api() calls that request information about our plugin and
+ * use the configured API endpoint to satisfy them.
+ *
+ * @see plugins_api()
+ *
+ * @param mixed $result
+ * @param string $action
+ * @param array|object $args
+ * @return mixed
+ */
+ public function injectInfo($result, $action = null, $args = null) {
+ $relevant = ($action == 'plugin_information') && isset($args->slug) && (
+ ($args->slug == $this->slug) || ($args->slug == dirname($this->pluginFile))
+ );
+ if ( !$relevant ) {
+ return $result;
+ }
+
+ $pluginInfo = $this->requestInfo();
+ $this->fixSupportedWordpressVersion($pluginInfo);
+
+ $pluginInfo = apply_filters($this->getUniqueName('pre_inject_info'), $pluginInfo);
+ if ( $pluginInfo ) {
+ return $pluginInfo->toWpFormat();
+ }
+
+ return $result;
+ }
+
+ protected function shouldShowUpdates() {
+ //No update notifications for mu-plugins unless explicitly enabled. The MU plugin file
+ //is usually different from the main plugin file so the update wouldn't show up properly anyway.
+ return !$this->isUnknownMuPlugin();
+ }
+
+ /**
+ * @param stdClass|null $updates
+ * @param stdClass $updateToAdd
+ * @return stdClass
+ */
+ protected function addUpdateToList($updates, $updateToAdd) {
+ if ( $this->package->isMuPlugin() ) {
+ //WP does not support automatic update installation for mu-plugins, but we can
+ //still display a notice.
+ $updateToAdd->package = null;
+ }
+ return parent::addUpdateToList($updates, $updateToAdd);
+ }
+
+ /**
+ * @param stdClass|null $updates
+ * @return stdClass|null
+ */
+ protected function removeUpdateFromList($updates) {
+ $updates = parent::removeUpdateFromList($updates);
+ if ( !empty($this->muPluginFile) && isset($updates, $updates->response) ) {
+ unset($updates->response[$this->muPluginFile]);
+ }
+ return $updates;
+ }
+
+ /**
+ * For plugins, the update array is indexed by the plugin filename relative to the "plugins"
+ * directory. Example: "plugin-name/plugin.php".
+ *
+ * @return string
+ */
+ protected function getUpdateListKey() {
+ if ( $this->package->isMuPlugin() ) {
+ return $this->muPluginFile;
+ }
+ return $this->pluginFile;
+ }
+
+ protected function getNoUpdateItemFields() {
+ return array_merge(
+ parent::getNoUpdateItemFields(),
+ [
+ 'id' => $this->pluginFile,
+ 'slug' => $this->slug,
+ 'plugin' => $this->pluginFile,
+ 'icons' => [],
+ 'banners' => [],
+ 'banners_rtl' => [],
+ 'tested' => '',
+ 'compatibility' => new stdClass(),
+ ]
+ );
+ }
+
+ /**
+ * Alias for isBeingUpgraded().
+ *
+ * @deprecated
+ * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update.
+ * @return bool
+ */
+ public function isPluginBeingUpgraded($upgrader = null) {
+ return $this->isBeingUpgraded($upgrader);
+ }
+
+ /**
+ * Is there an update being installed for this plugin, right now?
+ *
+ * @param WP_Upgrader|null $upgrader
+ * @return bool
+ */
+ public function isBeingUpgraded($upgrader = null) {
+ return $this->upgraderStatus->isPluginBeingUpgraded($this->pluginFile, $upgrader);
+ }
+
+ /**
+ * Get the details of the currently available update, if any.
+ *
+ * If no updates are available, or if the last known update version is below or equal
+ * to the currently installed version, this method will return NULL.
+ *
+ * Uses cached update data. To retrieve update information straight from
+ * the metadata URL, call requestUpdate() instead.
+ *
+ * @return Lkn_Puc_Plugin_Update|null
+ */
+ public function getUpdate() {
+ $update = parent::getUpdate();
+ if ( isset($update) ) {
+ /** @var Lkn_Puc_Plugin_Update $update */
+ $update->filename = $this->pluginFile;
+ }
+ return $update;
+ }
+
+ /**
+ * Get the translated plugin title.
+ *
+ * @deprecated
+ * @return string
+ */
+ public function getPluginTitle() {
+ return $this->package->getPluginTitle();
+ }
+
+ /**
+ * Check if the current user has the required permissions to install updates.
+ *
+ * @return bool
+ */
+ public function userCanInstallUpdates() {
+ return current_user_can('update_plugins');
+ }
+
+ /**
+ * Check if the plugin file is inside the mu-plugins directory.
+ *
+ * @deprecated
+ * @return bool
+ */
+ protected function isMuPlugin() {
+ return $this->package->isMuPlugin();
+ }
+
+ /**
+ * MU plugins are partially supported, but only when we know which file in mu-plugins
+ * corresponds to this plugin.
+ *
+ * @return bool
+ */
+ protected function isUnknownMuPlugin() {
+ return empty($this->muPluginFile) && $this->package->isMuPlugin();
+ }
+
+ /**
+ * Get absolute path to the main plugin file.
+ *
+ * @return string
+ */
+ public function getAbsolutePath() {
+ return $this->pluginAbsolutePath;
+ }
+
+ /**
+ * Register a callback for filtering query arguments.
+ *
+ * The callback function should take one argument - an associative array of query arguments.
+ * It should return a modified array of query arguments.
+ *
+ * @uses add_filter() This method is a convenience wrapper for add_filter().
+ *
+ * @param callable $callback
+ * @return void
+ */
+ public function addQueryArgFilter($callback) {
+ $this->addFilter('request_info_query_args', $callback);
+ }
+
+ /**
+ * Register a callback for filtering arguments passed to wp_remote_get().
+ *
+ * The callback function should take one argument - an associative array of arguments -
+ * and return a modified array or arguments. See the WP documentation on wp_remote_get()
+ * for details on what arguments are available and how they work.
+ *
+ * @uses add_filter() This method is a convenience wrapper for add_filter().
+ *
+ * @param callable $callback
+ * @return void
+ */
+ public function addHttpRequestArgFilter($callback) {
+ $this->addFilter('request_info_options', $callback);
+ }
+
+ /**
+ * Register a callback for filtering the plugin info retrieved from the external API.
+ *
+ * The callback function should take two arguments. If the plugin info was retrieved
+ * successfully, the first argument passed will be an instance of PluginInfo. Otherwise,
+ * it will be NULL. The second argument will be the corresponding return value of
+ * wp_remote_get (see WP docs for details).
+ *
+ * The callback function should return a new or modified instance of PluginInfo or NULL.
+ *
+ * @uses add_filter() This method is a convenience wrapper for add_filter().
+ *
+ * @param callable $callback
+ * @return void
+ */
+ public function addResultFilter($callback) {
+ $this->addFilter('request_info_result', $callback, 10, 2);
+ }
+
+ /**
+ * Create a package instance that represents this plugin or theme.
+ *
+ * @return Lkn_Puc_InstalledPackage
+ */
+ protected function createInstalledPackage() {
+ return new Lkn_Puc_Plugin_Package($this->pluginAbsolutePath, $this);
+ }
+
+ /**
+ * @return Lkn_Puc_Plugin_Package
+ */
+ public function getInstalledPackage() {
+ return $this->package;
+ }
+ }
+
+endif;
diff --git a/packages/plugin-updater/Puc/Scheduler.php b/packages/plugin-updater/Puc/Scheduler.php
new file mode 100644
index 000000000..74347c253
--- /dev/null
+++ b/packages/plugin-updater/Puc/Scheduler.php
@@ -0,0 +1,254 @@
+updateChecker = $updateChecker;
+ $this->checkPeriod = $checkPeriod;
+
+ //Set up the periodic update checks
+ $this->cronHook = $this->updateChecker->getUniqueName('cron_check_updates');
+ if ( $this->checkPeriod > 0 ) {
+ //Trigger the check via Cron.
+ //Try to use one of the default schedules if possible as it's less likely to conflict
+ //with other plugins and their custom schedules.
+ $defaultSchedules = [
+ 1 => 'hourly',
+ 12 => 'twicedaily',
+ 24 => 'daily',
+ ];
+ if ( array_key_exists($this->checkPeriod, $defaultSchedules) ) {
+ $scheduleName = $defaultSchedules[$this->checkPeriod];
+ } else {
+ //Use a custom cron schedule.
+ $scheduleName = 'every' . $this->checkPeriod . 'hours';
+ add_filter('cron_schedules', [$this, '_addCustomSchedule']);
+ }
+
+ if ( !wp_next_scheduled($this->cronHook) && !defined('WP_INSTALLING') ) {
+ //Randomly offset the schedule to help prevent update server traffic spikes. Without this
+ //most checks may happen during times of day when people are most likely to install new plugins.
+ $firstCheckTime = time() - rand(0, max($this->checkPeriod * 3600 - 15 * 60, 1));
+ $firstCheckTime = apply_filters(
+ $this->updateChecker->getUniqueName('first_check_time'),
+ $firstCheckTime
+ );
+ wp_schedule_event($firstCheckTime, $scheduleName, $this->cronHook);
+ }
+ add_action($this->cronHook, [$this, 'maybeCheckForUpdates']);
+
+ //In case Cron is disabled or unreliable, we also manually trigger
+ //the periodic checks while the user is browsing the Dashboard.
+ add_action( 'admin_init', [$this, 'maybeCheckForUpdates'] );
+
+ //Like WordPress itself, we check more often on certain pages.
+ /** @see wp_update_plugins */
+ add_action('load-update-core.php', [$this, 'maybeCheckForUpdates']);
+ //"load-update.php" and "load-plugins.php" or "load-themes.php".
+ $this->hourlyCheckHooks = array_merge($this->hourlyCheckHooks, $hourlyHooks);
+ foreach ($this->hourlyCheckHooks as $hook) {
+ add_action($hook, [$this, 'maybeCheckForUpdates']);
+ }
+ //This hook fires after a bulk update is complete.
+ add_action('upgrader_process_complete', [$this, 'upgraderProcessComplete'], 11, 2);
+ } else {
+ //Periodic checks are disabled.
+ wp_clear_scheduled_hook($this->cronHook);
+ }
+ }
+
+ /**
+ * Runs upon the WP action upgrader_process_complete.
+ *
+ * We look at the parameters to decide whether to call maybeCheckForUpdates() or not.
+ * We also check if the update checker has been removed by the update.
+ *
+ * @param WP_Upgrader $upgrader WP_Upgrader instance
+ * @param array $upgradeInfo extra information about the upgrade
+ */
+ public function upgraderProcessComplete(
+ /** @noinspection PhpUnusedParameterInspection */
+ $upgrader, $upgradeInfo
+ ) {
+ //Cancel all further actions if the current version of PUC has been deleted or overwritten
+ //by a different version during the upgrade. If we try to do anything more in that situation,
+ //we could trigger a fatal error by trying to autoload a deleted class.
+ clearstatcache();
+ if ( !file_exists(__FILE__) ) {
+ $this->removeHooks();
+ $this->updateChecker->removeHooks();
+ return;
+ }
+
+ //Sanity check and limitation to relevant types.
+ if (
+ !is_array($upgradeInfo) || !isset($upgradeInfo['type'], $upgradeInfo['action'])
+ || 'update' !== $upgradeInfo['action'] || !in_array($upgradeInfo['type'], ['plugin', 'theme'])
+ ) {
+ return;
+ }
+
+ if ( is_a($this->updateChecker, 'Lkn_Puc_Plugin_UpdateChecker') ) {
+ if ( 'plugin' !== $upgradeInfo['type'] || !isset($upgradeInfo['plugins']) ) {
+ return;
+ }
+
+ //Themes pass in directory names in the information array, but plugins use the relative plugin path.
+ if ( !in_array(
+ strtolower($this->updateChecker->directoryName),
+ array_map('dirname', array_map('strtolower', $upgradeInfo['plugins']))
+ ) ) {
+ return;
+ }
+ }
+
+ $this->maybeCheckForUpdates();
+ }
+
+ /**
+ * Check for updates if the configured check interval has already elapsed.
+ * Will use a shorter check interval on certain admin pages like "Dashboard -> Updates" or when doing cron.
+ *
+ * You can override the default behaviour by using the "puc_check_now-$slug" filter.
+ * The filter callback will be passed three parameters:
+ * - Current decision. TRUE = check updates now, FALSE = don't check now.
+ * - Last check time as a Unix timestamp.
+ * - Configured check period in hours.
+ * Return TRUE to check for updates immediately, or FALSE to cancel.
+ *
+ * This method is declared public because it's a hook callback. Calling it directly is not recommended.
+ */
+ public function maybeCheckForUpdates() {
+ if ( empty($this->checkPeriod) ) {
+ return;
+ }
+
+ $state = $this->updateChecker->getUpdateState();
+ $shouldCheck = ($state->timeSinceLastCheck() >= $this->getEffectiveCheckPeriod());
+
+ //Let plugin authors substitute their own algorithm.
+ $shouldCheck = apply_filters(
+ $this->updateChecker->getUniqueName('check_now'),
+ $shouldCheck,
+ $state->getLastCheck(),
+ $this->checkPeriod
+ );
+
+ if ( $shouldCheck ) {
+ $this->updateChecker->checkForUpdates();
+ }
+ }
+
+ /**
+ * Calculate the actual check period based on the current status and environment.
+ *
+ * @return int Check period in seconds.
+ */
+ protected function getEffectiveCheckPeriod() {
+ $currentFilter = current_filter();
+ if ( in_array($currentFilter, ['load-update-core.php', 'upgrader_process_complete']) ) {
+ //Check more often when the user visits "Dashboard -> Updates" or does a bulk update.
+ $period = 60;
+ } else {
+ if ( in_array($currentFilter, $this->hourlyCheckHooks) ) {
+ //Also check more often on /wp-admin/update.php and the "Plugins" or "Themes" page.
+ $period = 3600;
+ } else {
+ if ( $this->throttleRedundantChecks && ($this->updateChecker->getUpdate() !== null) ) {
+ //Check less frequently if it's already known that an update is available.
+ $period = $this->throttledCheckPeriod * 3600;
+ } else {
+ if ( defined('DOING_CRON') && constant('DOING_CRON') ) {
+ //WordPress cron schedules are not exact, so lets do an update check even
+ //if slightly less than $checkPeriod hours have elapsed since the last check.
+ $cronFuzziness = 20 * 60;
+ $period = $this->checkPeriod * 3600 - $cronFuzziness;
+ } else {
+ $period = $this->checkPeriod * 3600;
+ }
+ }
+ }
+ }
+
+ return $period;
+ }
+
+ /**
+ * Add our custom schedule to the array of Cron schedules used by WP.
+ *
+ * @param array $schedules
+ * @return array
+ */
+ public function _addCustomSchedule($schedules) {
+ if ( $this->checkPeriod && ($this->checkPeriod > 0) ) {
+ $scheduleName = 'every' . $this->checkPeriod . 'hours';
+ $schedules[$scheduleName] = [
+ 'interval' => $this->checkPeriod * 3600,
+ 'display' => sprintf('Every %d hours', $this->checkPeriod),
+ ];
+ }
+ return $schedules;
+ }
+
+ /**
+ * Remove the scheduled cron event that the library uses to check for updates.
+ *
+ * @return void
+ */
+ public function removeUpdaterCron() {
+ wp_clear_scheduled_hook($this->cronHook);
+ }
+
+ /**
+ * Get the name of the update checker's WP-cron hook. Mostly useful for debugging.
+ *
+ * @return string
+ */
+ public function getCronHookName() {
+ return $this->cronHook;
+ }
+
+ /**
+ * Remove most hooks added by the scheduler.
+ */
+ public function removeHooks() {
+ remove_filter('cron_schedules', [$this, '_addCustomSchedule']);
+ remove_action('admin_init', [$this, 'maybeCheckForUpdates']);
+ remove_action('load-update-core.php', [$this, 'maybeCheckForUpdates']);
+
+ if ( $this->cronHook !== null ) {
+ remove_action($this->cronHook, [$this, 'maybeCheckForUpdates']);
+ }
+ if ( !empty($this->hourlyCheckHooks) ) {
+ foreach ($this->hourlyCheckHooks as $hook) {
+ remove_action($hook, [$this, 'maybeCheckForUpdates']);
+ }
+ }
+ }
+ }
+
+endif;
diff --git a/packages/plugin-updater/Puc/StateStore.php b/packages/plugin-updater/Puc/StateStore.php
new file mode 100644
index 000000000..53008324c
--- /dev/null
+++ b/packages/plugin-updater/Puc/StateStore.php
@@ -0,0 +1,220 @@
+optionName = $optionName;
+ }
+
+ /**
+ * Get time elapsed since the last update check.
+ *
+ * If there are no recorded update checks, this method returns a large arbitrary number
+ * (i.e. time since the Unix epoch).
+ *
+ * @return int Elapsed time in seconds.
+ */
+ public function timeSinceLastCheck() {
+ $this->lazyLoad();
+ return time() - $this->lastCheck;
+ }
+
+ /**
+ * @return int
+ */
+ public function getLastCheck() {
+ $this->lazyLoad();
+ return $this->lastCheck;
+ }
+
+ /**
+ * Set the time of the last update check to the current timestamp.
+ *
+ * @return $this
+ */
+ public function setLastCheckToNow() {
+ $this->lazyLoad();
+ $this->lastCheck = time();
+ return $this;
+ }
+
+ /**
+ * @return null|Lkn_Puc_Update
+ */
+ public function getUpdate() {
+ $this->lazyLoad();
+ return $this->update;
+ }
+
+ /**
+ * @param Lkn_Puc_Update|null $update
+ * @return $this
+ */
+ public function setUpdate(Lkn_Puc_Update $update = null) {
+ $this->lazyLoad();
+ $this->update = $update;
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getCheckedVersion() {
+ $this->lazyLoad();
+ return $this->checkedVersion;
+ }
+
+ /**
+ * @param string $version
+ * @return $this
+ */
+ public function setCheckedVersion($version) {
+ $this->lazyLoad();
+ $this->checkedVersion = strval($version);
+ return $this;
+ }
+
+ /**
+ * Get translation updates.
+ *
+ * @return array
+ */
+ public function getTranslations() {
+ $this->lazyLoad();
+ if ( isset($this->update, $this->update->translations) ) {
+ return $this->update->translations;
+ }
+ return [];
+ }
+
+ /**
+ * Set translation updates.
+ *
+ * @param array $translationUpdates
+ */
+ public function setTranslations($translationUpdates) {
+ $this->lazyLoad();
+ if ( isset($this->update) ) {
+ $this->update->translations = $translationUpdates;
+ $this->save();
+ }
+ }
+
+ /**
+ * Saves the updated state of the plugin on the database
+ */
+ public function save() {
+ $state = new stdClass();
+
+ $state->lastCheck = $this->lastCheck;
+ $state->checkedVersion = $this->checkedVersion;
+
+ if ( isset($this->update)) {
+ $state->update = $this->update->toStdClass();
+
+ $updateClass = get_class($this->update);
+ $state->updateClass = $updateClass;
+ $prefix = $this->getLibPrefix();
+ if ( Lkn_Puc_Utils::startsWith($updateClass, $prefix) ) {
+ $state->updateBaseClass = substr($updateClass, strlen($prefix));
+ }
+ }
+
+ update_site_option($this->optionName, $state);
+ $this->isLoaded = true;
+ }
+
+ /**
+ * Checks if the database already has a state
+ *
+ * @return $this
+ */
+ public function lazyLoad() {
+ if ( !$this->isLoaded ) {
+ $this->load();
+ }
+ return $this;
+ }
+
+ /**
+ * Load the state version
+ */
+ protected function load() {
+ $this->isLoaded = true;
+
+ $state = get_site_option($this->optionName, null);
+
+ if ( !is_object($state) ) {
+ $this->lastCheck = 0;
+ $this->checkedVersion = '';
+ $this->update = null;
+ return;
+ }
+
+ $this->lastCheck = intval(Lkn_Puc_Utils::get($state, 'lastCheck', 0));
+ $this->checkedVersion = Lkn_Puc_Utils::get($state, 'checkedVersion', '');
+ $this->update = null;
+
+ if ( isset($state->update) ) {
+ //This mess is due to the fact that the want the update class from this version
+ //of the library, not the version that saved the update.
+
+ $updateClass = null;
+ if ( isset($state->updateBaseClass) ) {
+ $updateClass = $this->getLibPrefix() . $state->updateBaseClass;
+ } else {
+ if ( isset($state->updateClass) && class_exists($state->updateClass) ) {
+ $updateClass = $state->updateClass;
+ }
+ }
+
+ if ( $updateClass !== null ) {
+ $this->update = call_user_func([$updateClass, 'fromObject'], $state->update);
+ }
+ }
+ }
+
+ /**
+ * Delete the option name from database
+ */
+ public function delete() {
+ delete_site_option($this->optionName);
+
+ $this->lastCheck = 0;
+ $this->checkedVersion = '';
+ $this->update = null;
+ }
+
+ private function getLibPrefix() {
+ $parts = explode('_', __CLASS__, 3);
+ return $parts[0] . '_' . $parts[1] . '_';
+ }
+ }
+
+endif;
diff --git a/packages/plugin-updater/Puc/Update.php b/packages/plugin-updater/Puc/Update.php
new file mode 100644
index 000000000..c8ad6baab
--- /dev/null
+++ b/packages/plugin-updater/Puc/Update.php
@@ -0,0 +1,37 @@
+slug = $this->slug;
+ $update->new_version = $this->version;
+ $update->package = $this->download_url;
+
+ return $update;
+ }
+ }
+
+endif;
diff --git a/packages/plugin-updater/Puc/UpdateChecker.php b/packages/plugin-updater/Puc/UpdateChecker.php
new file mode 100644
index 000000000..d0c6b10f3
--- /dev/null
+++ b/packages/plugin-updater/Puc/UpdateChecker.php
@@ -0,0 +1,949 @@
+debugMode = (bool)(constant('WP_DEBUG'));
+ $this->metadataUrl = $metadataUrl;
+ $this->directoryName = $directoryName;
+ $this->slug = !empty($slug) ? $slug : $this->directoryName;
+
+ $this->optionName = $optionName;
+ if ( empty($this->optionName) ) {
+ //BC: Initially the library only supported plugin updates and didn't use type prefixes
+ //in the option name. Lets use the same prefix-less name when possible.
+ if ( $this->filterSuffix === '' ) {
+ $this->optionName = 'external_updates-' . $this->slug;
+ } else {
+ $this->optionName = $this->getUniqueName('external_updates');
+ }
+ }
+
+ $this->package = $this->createInstalledPackage();
+ $this->scheduler = $this->createScheduler($checkPeriod);
+ $this->upgraderStatus = new Lkn_Puc_UpgraderStatus();
+ $this->updateState = new Lkn_Puc_StateStore($this->optionName);
+
+ if ( did_action('init') ) {
+ $this->loadTextDomain();
+ } else {
+ add_action('init', [$this, 'loadTextDomain']);
+ }
+
+ $this->installHooks();
+ }
+
+ /**
+ * @internal
+ */
+ public function loadTextDomain() {
+ //We're not using load_plugin_textdomain() or its siblings because figuring out where
+ //the library is located (plugin, mu-plugin, theme, custom wp-content paths) is messy.
+ $domain = 'plugin-update-checker';
+ $locale = apply_filters(
+ 'plugin_locale',
+ (is_admin() && function_exists('get_user_locale')) ? get_user_locale() : get_locale(),
+ $domain
+ );
+
+ $moFile = $domain . '-' . $locale . '.mo';
+ $path = realpath(dirname(__FILE__) . '/../languages');
+
+ if ($path && file_exists($path)) {
+ load_textdomain($domain, $path . '/' . $moFile);
+ }
+ }
+
+ protected function installHooks() {
+ //Insert our update info into the update array maintained by WP.
+ add_filter('site_transient_' . $this->updateTransient, [$this, 'injectUpdate']);
+
+ //Insert translation updates into the update list.
+ add_filter('site_transient_' . $this->updateTransient, [$this, 'injectTranslationUpdates']);
+
+ //Clear translation updates when WP clears the update cache.
+ //This needs to be done directly because the library doesn't actually remove obsolete plugin updates,
+ //it just hides them (see getUpdate()). We can't do that with translations - too much disk I/O.
+ add_action(
+ 'delete_site_transient_' . $this->updateTransient,
+ [$this, 'clearCachedTranslationUpdates']
+ );
+
+ //Rename the update directory to be the same as the existing directory.
+ if ( $this->directoryName !== '.' ) {
+ add_filter('upgrader_source_selection', [$this, 'fixDirectoryName'], 10, 3);
+ }
+
+ //Allow HTTP requests to the metadata URL even if it's on a local host.
+ add_filter('http_request_host_is_external', [$this, 'allowMetadataHost'], 10, 2);
+ }
+
+ /**
+ * Remove hooks that were added by this update checker instance.
+ */
+ public function removeHooks() {
+ remove_filter('site_transient_' . $this->updateTransient, [$this, 'injectUpdate']);
+ remove_filter('site_transient_' . $this->updateTransient, [$this, 'injectTranslationUpdates']);
+ remove_action(
+ 'delete_site_transient_' . $this->updateTransient,
+ [$this, 'clearCachedTranslationUpdates']
+ );
+
+ remove_filter('upgrader_source_selection', [$this, 'fixDirectoryName'], 10);
+ remove_filter('http_request_host_is_external', [$this, 'allowMetadataHost'], 10);
+
+ remove_action('init', [$this, 'loadTextDomain']);
+
+ if ( $this->scheduler ) {
+ $this->scheduler->removeHooks();
+ }
+ }
+
+ /**
+ * Check if the current user has the required permissions to install updates.
+ *
+ * @return bool
+ */
+ abstract public function userCanInstallUpdates();
+
+ /**
+ * Explicitly allow HTTP requests to the metadata URL.
+ *
+ * WordPress has a security feature where the HTTP API will reject all requests that are sent to
+ * another site hosted on the same server as the current site (IP match), a local host, or a local
+ * IP, unless the host exactly matches the current site.
+ *
+ * This feature is opt-in (at least in WP 4.4). Apparently some people enable it.
+ *
+ * That can be a problem when you're developing your plugin and you decide to host the update information
+ * on the same server as your test site. Update requests will mysteriously fail.
+ *
+ * We fix that by adding an exception for the metadata host.
+ *
+ * @param bool $allow
+ * @param string $host
+ * @return bool
+ */
+ public function allowMetadataHost($allow, $host) {
+ if ( $this->cachedMetadataHost === 0 ) {
+ $this->cachedMetadataHost = parse_url($this->metadataUrl, PHP_URL_HOST);
+ }
+
+ if ( is_string($this->cachedMetadataHost) && (strtolower($host) === strtolower($this->cachedMetadataHost)) ) {
+ return true;
+ }
+ return $allow;
+ }
+
+ /**
+ * Create a package instance that represents this plugin or theme.
+ *
+ * @return Lkn_Puc_InstalledPackage
+ */
+ abstract protected function createInstalledPackage();
+
+ /**
+ * @return Lkn_Puc_InstalledPackage
+ */
+ public function getInstalledPackage() {
+ return $this->package;
+ }
+
+ /**
+ * Create an instance of the scheduler.
+ *
+ * This is implemented as a method to make it possible for plugins to subclass the update checker
+ * and substitute their own scheduler.
+ *
+ * @param int $checkPeriod
+ * @return Lkn_Puc_Scheduler
+ */
+ abstract protected function createScheduler($checkPeriod);
+
+ /**
+ * Check for updates. The results are stored in the DB option specified in $optionName.
+ *
+ * @return Lkn_Puc_Update|null
+ */
+ public function checkForUpdates() {
+ $installedVersion = $this->getInstalledVersion();
+ //Fail silently if we can't find the plugin/theme or read its header.
+ if ( $installedVersion === null ) {
+ $this->triggerError(
+ sprintf('Skipping update check for %s - installed version unknown.', $this->slug),
+ E_USER_WARNING
+ );
+ return null;
+ }
+
+ //Start collecting API errors.
+ $this->lastRequestApiErrors = [];
+ add_action('puc_api_error', [$this, 'collectApiErrors'], 10, 4);
+
+ $state = $this->updateState;
+ $state->setLastCheckToNow()
+ ->setCheckedVersion($installedVersion)
+ ->save(); //Save before checking in case something goes wrong
+
+ $state->setUpdate($this->requestUpdate());
+ $state->save();
+
+ //Stop collecting API errors.
+ remove_action('puc_api_error', [$this, 'collectApiErrors'], 10);
+
+ return $this->getUpdate();
+ }
+
+ /**
+ * Load the update checker state from the DB.
+ *
+ * @return Lkn_Puc_StateStore
+ */
+ public function getUpdateState() {
+ return $this->updateState->lazyLoad();
+ }
+
+ /**
+ * Reset update checker state - i.e. last check time, cached update data and so on.
+ *
+ * Call this when your plugin is being uninstalled, or if you want to
+ * clear the update cache.
+ */
+ public function resetUpdateState() {
+ $this->updateState->delete();
+ }
+
+ /**
+ * Get the details of the currently available update, if any.
+ *
+ * If no updates are available, or if the last known update version is below or equal
+ * to the currently installed version, this method will return NULL.
+ *
+ * Uses cached update data. To retrieve update information straight from
+ * the metadata URL, call requestUpdate() instead.
+ *
+ * @return Lkn_Puc_Update|null
+ */
+ public function getUpdate() {
+ $update = $this->updateState->getUpdate();
+
+ //Is there an update available?
+ if ( isset($update) ) {
+ //Check if the update is actually newer than the currently installed version.
+ $installedVersion = $this->getInstalledVersion();
+ if ( ($installedVersion !== null) && version_compare($update->version, $installedVersion, '>') ) {
+ return $update;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Retrieve the latest update (if any) from the configured API endpoint.
+ *
+ * Subclasses should run the update through filterUpdateResult before returning it.
+ *
+ * @return Lkn_Puc_Update An instance of Update, or NULL when no updates are available.
+ */
+ abstract public function requestUpdate();
+
+ /**
+ * Filter the result of a requestUpdate() call.
+ *
+ * @param Lkn_Puc_Update|null $update
+ * @param array|WP_Error|null $httpResult The value returned by wp_remote_get(), if any.
+ * @return Lkn_Puc_Update
+ */
+ protected function filterUpdateResult($update, $httpResult = null) {
+ //Let plugins/themes modify the update.
+ $update = apply_filters($this->getUniqueName('request_update_result'), $update, $httpResult);
+
+ $this->fixSupportedWordpressVersion($update);
+
+ if ( isset($update, $update->translations) ) {
+ //Keep only those translation updates that apply to this site.
+ $update->translations = $this->filterApplicableTranslations($update->translations);
+ }
+
+ return $update;
+ }
+
+ /**
+ * The "Tested up to" field in the plugin metadata is supposed to be in the form of "major.minor",
+ * while WordPress core's list_plugin_updates() expects the $update->tested field to be an exact
+ * version, e.g. "major.minor.patch", to say it's compatible. In other case it shows
+ * "Compatibility: Unknown".
+ * The function mimics how wordpress.org API crafts the "tested" field out of "Tested up to".
+ *
+ * @param Lkn_Puc_Metadata|null $update
+ */
+ protected function fixSupportedWordpressVersion(Lkn_Puc_Metadata $update = null) {
+ if ( !isset($update->tested) || !preg_match('/^\d++\.\d++$/', $update->tested) ) {
+ return;
+ }
+
+ $actualWpVersions = [];
+
+ $wpVersion = $GLOBALS['wp_version'];
+
+ if ( function_exists('get_core_updates') ) {
+ $coreUpdates = get_core_updates();
+ if ( is_array($coreUpdates) ) {
+ foreach ($coreUpdates as $coreUpdate) {
+ if ( isset($coreUpdate->current) ) {
+ $actualWpVersions[] = $coreUpdate->current;
+ }
+ }
+ }
+ }
+
+ $actualWpVersions[] = $wpVersion;
+
+ $actualWpPatchNumber = null;
+ foreach ($actualWpVersions as $version) {
+ if ( preg_match('/^(?P\d++\.\d++)(?:\.(?P\d++))?/', $version, $versionParts) ) {
+ if ( $versionParts['majorMinor'] === $update->tested ) {
+ $patch = isset($versionParts['patch']) ? intval($versionParts['patch']) : 0;
+ if ( $actualWpPatchNumber === null ) {
+ $actualWpPatchNumber = $patch;
+ } else {
+ $actualWpPatchNumber = max($actualWpPatchNumber, $patch);
+ }
+ }
+ }
+ }
+ if ( $actualWpPatchNumber === null ) {
+ $actualWpPatchNumber = 999;
+ }
+
+ if ( $actualWpPatchNumber > 0 ) {
+ $update->tested .= '.' . $actualWpPatchNumber;
+ }
+ }
+
+ /**
+ * Get the currently installed version of the plugin or theme.
+ *
+ * @return string|null Version number.
+ */
+ public function getInstalledVersion() {
+ return $this->package->getInstalledVersion();
+ }
+
+ /**
+ * Get the full path of the plugin or theme directory.
+ *
+ * @return string
+ */
+ public function getAbsoluteDirectoryPath() {
+ return $this->package->getAbsoluteDirectoryPath();
+ }
+
+ /**
+ * Trigger a PHP error, but only when $debugMode is enabled.
+ *
+ * @param string $message
+ * @param int $errorType
+ */
+ public function triggerError($message, $errorType) {
+ if ( $this->isDebugModeEnabled() ) {
+ trigger_error($message, $errorType);
+ }
+ }
+
+ /**
+ * @return bool
+ */
+ protected function isDebugModeEnabled() {
+ if ( $this->debugMode === null ) {
+ $this->debugMode = (bool)(constant('WP_DEBUG'));
+ }
+ return $this->debugMode;
+ }
+
+ /**
+ * Get the full name of an update checker filter, action or DB entry.
+ *
+ * This method adds the "puc_" prefix and the "-$slug" suffix to the filter name.
+ * For example, "pre_inject_update" becomes "puc_pre_inject_update-plugin-slug".
+ *
+ * @param string $baseTag
+ * @return string
+ */
+ public function getUniqueName($baseTag) {
+ $name = 'puc_' . $baseTag;
+ if ( $this->filterSuffix !== '' ) {
+ $name .= '_' . $this->filterSuffix;
+ }
+ return $name . '-' . $this->slug;
+ }
+
+ /**
+ * Store API errors that are generated when checking for updates.
+ *
+ * @internal
+ * @param WP_Error $error
+ * @param array|null $httpResponse
+ * @param string|null $url
+ * @param string|null $slug
+ */
+ public function collectApiErrors($error, $httpResponse = null, $url = null, $slug = null) {
+ if ( isset($slug) && ($slug !== $this->slug) ) {
+ return;
+ }
+
+ $this->lastRequestApiErrors[] = [
+ 'error' => $error,
+ 'httpResponse' => $httpResponse,
+ 'url' => $url,
+ ];
+ }
+
+ /**
+ * @return array
+ */
+ public function getLastRequestApiErrors() {
+ return $this->lastRequestApiErrors;
+ }
+
+ /* -------------------------------------------------------------------
+ * PUC filters and filter utilities
+ * -------------------------------------------------------------------
+ */
+
+ /**
+ * Register a callback for one of the update checker filters.
+ *
+ * Identical to add_filter(), except it automatically adds the "puc_" prefix
+ * and the "-$slug" suffix to the filter name. For example, "request_info_result"
+ * becomes "puc_request_info_result-your_plugin_slug".
+ *
+ * @param string $tag
+ * @param callable $callback
+ * @param int $priority
+ * @param int $acceptedArgs
+ */
+ public function addFilter($tag, $callback, $priority = 10, $acceptedArgs = 1) {
+ add_filter($this->getUniqueName($tag), $callback, $priority, $acceptedArgs);
+ }
+
+ /* -------------------------------------------------------------------
+ * Inject updates
+ * -------------------------------------------------------------------
+ */
+
+ /**
+ * Insert the latest update (if any) into the update list maintained by WP.
+ *
+ * @param stdClass $updates Update list.
+ * @return stdClass Modified update list.
+ */
+ public function injectUpdate($updates) {
+ //Is there an update to insert?
+ $update = $this->getUpdate();
+
+ if ( !$this->shouldShowUpdates() ) {
+ $update = null;
+ }
+
+ if ( !empty($update) ) {
+ //Let plugins update is passed to WordPress.
+ $updates = $this->addUpdateToList($updates, $update->toWpFormat());
+ } else {
+ //Clean up any stale update info.
+ $updates = $this->removeUpdateFromList($updates);
+ //Add a placeholder item to the "no_update" list to enable auto-update support.
+ //If we don't do this, the option to enable automatic updates will only show up
+ //when an update is available.
+ $updates = $this->addNoUpdateItem($updates);
+ }
+
+ return $updates;
+ }
+
+ /**
+ * @param stdClass|null $updates
+ * @param stdClass|array $updateToAdd
+ * @return stdClass
+ */
+ protected function addUpdateToList($updates, $updateToAdd) {
+ if ( !is_object($updates) ) {
+ $updates = new stdClass();
+ $updates->response = [];
+ }
+
+ $updates->response[$this->getUpdateListKey()] = $updateToAdd;
+ return $updates;
+ }
+
+ /**
+ * @param stdClass|null $updates
+ * @return stdClass|null
+ */
+ protected function removeUpdateFromList($updates) {
+ if ( isset($updates, $updates->response) ) {
+ unset($updates->response[$this->getUpdateListKey()]);
+ }
+ return $updates;
+ }
+
+ /**
+ * See this post for more information:
+ * @link https://make.wordpress.org/core/2020/07/30/recommended-usage-of-the-updates-api-to-support-the-auto-updates-ui-for-plugins-and-themes-in-wordpress-5-5/
+ *
+ * @param stdClass|null $updates
+ * @return stdClass
+ */
+ protected function addNoUpdateItem($updates) {
+ if ( !is_object($updates) ) {
+ $updates = new stdClass();
+ $updates->response = [];
+ $updates->no_update = [];
+ } else {
+ if ( !isset($updates->no_update) ) {
+ $updates->no_update = [];
+ }
+ }
+
+ $updates->no_update[$this->getUpdateListKey()] = (object) $this->getNoUpdateItemFields();
+
+ return $updates;
+ }
+
+ /**
+ * Subclasses should override this method to add fields that are specific to plugins or themes.
+ * @return array
+ */
+ protected function getNoUpdateItemFields() {
+ return [
+ 'new_version' => $this->getInstalledVersion(),
+ 'url' => '',
+ 'package' => '',
+ 'requires_php' => '',
+ ];
+ }
+
+ /**
+ * Get the key that will be used when adding updates to the update list that's maintained
+ * by the WordPress core. The list is always an associative array, but the key is different
+ * for plugins and themes.
+ *
+ * @return string
+ */
+ abstract protected function getUpdateListKey();
+
+ /**
+ * Should we show available updates?
+ *
+ * Usually the answer is "yes", but there are exceptions. For example, WordPress doesn't
+ * support automatic updates installation for mu-plugins, so PUC usually won't show update
+ * notifications in that case. See the plugin-specific subclass for details.
+ *
+ * Note: This method only applies to updates that are displayed (or not) in the WordPress
+ * admin. It doesn't affect APIs like requestUpdate and getUpdate.
+ *
+ * @return bool
+ */
+ protected function shouldShowUpdates() {
+ return true;
+ }
+
+ /* -------------------------------------------------------------------
+ * JSON-based update API
+ * -------------------------------------------------------------------
+ */
+
+ /**
+ * Retrieve plugin or theme metadata from the JSON document at $this->metadataUrl.
+ *
+ * @param string $metaClass Parse the JSON as an instance of this class. It must have a static fromJson method.
+ * @param array $queryArgs Additional query arguments.
+ * @return array [Lkn_Puc_Metadata|null, array|WP_Error] A metadata instance and the value returned by wp_remote_get().
+ */
+ protected function requestMetadata($metaClass, $queryArgs = []) {
+ //Query args to append to the URL.
+ $queryArgs = array_merge(
+ [
+ 'installed_version' => strval($this->getInstalledVersion()),
+ 'php' => phpversion(),
+ 'locale' => get_locale(),
+ 's' => '4823a0e58074af39154f19e3de1f7443',
+ ],
+ $queryArgs
+ );
+
+ //Various options for the wp_remote_get() call.
+ $options = [
+ 'timeout' => 10, //seconds
+ 'headers' => [
+ 'Accept' => 'application/json',
+ ],
+ ];
+
+ //The metadata file should be at 'http://your-api.com/url/here/$slug/info.json'
+ $url = $this->metadataUrl;
+ if ( !empty($queryArgs) ) {
+ $url = add_query_arg($queryArgs, $url);
+ }
+
+ $result = wp_remote_get($url, $options);
+
+ //Try to parse the response
+ $status = $this->validateApiResponse($result);
+ $metadata = null;
+ if ( !is_wp_error($status) ) {
+ if ( version_compare(PHP_VERSION, '5.3', '>=') && (strpos($metaClass, '\\') === false) ) {
+ $metaClass = __NAMESPACE__ . '\\' . $metaClass;
+ }
+ $metadata = call_user_func([$metaClass, 'fromJson'], $result['body']);
+ } else {
+ do_action('puc_api_error', $status, $result, $url, $this->slug);
+ $this->triggerError(
+ sprintf('The URL %s does not point to a valid metadata file. ', $url)
+ . $status->get_error_message(),
+ E_USER_WARNING
+ );
+ }
+
+ return [$metadata, $result];
+ }
+
+ /**
+ * Check if $result is a successful update API response.
+ *
+ * @param array|WP_Error $result
+ * @return true|WP_Error
+ */
+ protected function validateApiResponse($result) {
+ if ( is_wp_error($result) ) { /** @var WP_Error $result */
+ return new WP_Error($result->get_error_code(), 'WP HTTP Error: ' . $result->get_error_message());
+ }
+
+ if ( !isset($result['response']['code']) ) {
+ return new WP_Error(
+ 'puc_no_response_code',
+ 'wp_remote_get() returned an unexpected result.'
+ );
+ }
+
+ if ( $result['response']['code'] !== 200 ) {
+ return new WP_Error(
+ 'puc_unexpected_response_code',
+ 'HTTP response code is ' . $result['response']['code'] . ' (expected: 200)'
+ );
+ }
+
+ if ( empty($result['body']) ) {
+ return new WP_Error('puc_empty_response', 'The metadata file appears to be empty.');
+ }
+
+ return true;
+ }
+
+ /* -------------------------------------------------------------------
+ * Language packs / Translation updates
+ * -------------------------------------------------------------------
+ */
+
+ /**
+ * Filter a list of translation updates and return a new list that contains only updates
+ * that apply to the current site.
+ *
+ * @param array $translations
+ * @return array
+ */
+ protected function filterApplicableTranslations($translations) {
+ $languages = array_flip(array_values(get_available_languages()));
+ $installedTranslations = $this->getInstalledTranslations();
+
+ $applicableTranslations = [];
+ foreach ($translations as $translation) {
+ //Does it match one of the available core languages?
+ $isApplicable = array_key_exists($translation->language, $languages);
+ //Is it more recent than an already-installed translation?
+ if ( isset($installedTranslations[$translation->language]) ) {
+ $updateTimestamp = strtotime($translation->updated);
+ $installedTimestamp = strtotime($installedTranslations[$translation->language]['PO-Revision-Date']);
+ $isApplicable = $updateTimestamp > $installedTimestamp;
+ }
+
+ if ( $isApplicable ) {
+ $applicableTranslations[] = $translation;
+ }
+ }
+
+ return $applicableTranslations;
+ }
+
+ /**
+ * Get a list of installed translations for this plugin or theme.
+ *
+ * @return array
+ */
+ protected function getInstalledTranslations() {
+ if ( !function_exists('wp_get_installed_translations') ) {
+ return [];
+ }
+ $installedTranslations = wp_get_installed_translations($this->translationType . 's');
+ if ( isset($installedTranslations[$this->directoryName]) ) {
+ $installedTranslations = $installedTranslations[$this->directoryName];
+ } else {
+ $installedTranslations = [];
+ }
+ return $installedTranslations;
+ }
+
+ /**
+ * Insert translation updates into the list maintained by WordPress.
+ *
+ * @param stdClass $updates
+ * @return stdClass
+ */
+ public function injectTranslationUpdates($updates) {
+ $translationUpdates = $this->getTranslationUpdates();
+ if ( empty($translationUpdates) ) {
+ return $updates;
+ }
+
+ //Being defensive.
+ if ( !is_object($updates) ) {
+ $updates = new stdClass();
+ }
+ if ( !isset($updates->translations) ) {
+ $updates->translations = [];
+ }
+
+ //In case there's a name collision with a plugin or theme hosted on wordpress.org,
+ //remove any preexisting updates that match our thing.
+ $updates->translations = array_values(array_filter(
+ $updates->translations,
+ [$this, 'isNotMyTranslation']
+ ));
+
+ //Add our updates to the list.
+ foreach ($translationUpdates as $update) {
+ $convertedUpdate = array_merge(
+ [
+ 'type' => $this->translationType,
+ 'slug' => $this->directoryName,
+ 'autoupdate' => 0,
+ //AFAICT, WordPress doesn't actually use the "version" field for anything.
+ //But lets make sure it's there, just in case.
+ 'version' => isset($update->version) ? $update->version : ('1.' . strtotime($update->updated)),
+ ],
+ (array)$update
+ );
+
+ $updates->translations[] = $convertedUpdate;
+ }
+
+ return $updates;
+ }
+
+ /**
+ * Get a list of available translation updates.
+ *
+ * This method will return an empty array if there are no updates.
+ * Uses cached update data.
+ *
+ * @return array
+ */
+ public function getTranslationUpdates() {
+ return $this->updateState->getTranslations();
+ }
+
+ /**
+ * Remove all cached translation updates.
+ *
+ * @see wp_clean_update_cache
+ */
+ public function clearCachedTranslationUpdates() {
+ $this->updateState->setTranslations([]);
+ }
+
+ /**
+ * Filter callback. Keeps only translations that *don't* match this plugin or theme.
+ *
+ * @param array $translation
+ * @return bool
+ */
+ protected function isNotMyTranslation($translation) {
+ $isMatch = isset($translation['type'], $translation['slug'])
+ && ($translation['type'] === $this->translationType)
+ && ($translation['slug'] === $this->directoryName);
+
+ return !$isMatch;
+ }
+
+ /* -------------------------------------------------------------------
+ * Fix directory name when installing updates
+ * -------------------------------------------------------------------
+ */
+
+ /**
+ * Rename the update directory to match the existing plugin/theme directory.
+ *
+ * When WordPress installs a plugin or theme update, it assumes that the ZIP file will contain
+ * exactly one directory, and that the directory name will be the same as the directory where
+ * the plugin or theme is currently installed.
+ *
+ * GitHub and other repositories provide ZIP downloads, but they often use directory names like
+ * "project-branch" or "project-tag-hash". We need to change the name to the actual plugin folder.
+ *
+ * This is a hook callback. Don't call it from a plugin.
+ *
+ * @access protected
+ *
+ * @param string $source The directory to copy to /wp-content/plugins or /wp-content/themes. Usually a subdirectory of $remoteSource.
+ * @param string $remoteSource WordPress has extracted the update to this directory.
+ * @param WP_Upgrader $upgrader
+ * @return string|WP_Error
+ */
+ public function fixDirectoryName($source, $remoteSource, $upgrader) {
+ global $wp_filesystem;
+ /** @var WP_Filesystem_Base $wp_filesystem */
+
+ //Basic sanity checks.
+ if ( !isset($source, $remoteSource, $upgrader, $upgrader->skin, $wp_filesystem) ) {
+ return $source;
+ }
+
+ //If WordPress is upgrading anything other than our plugin/theme, leave the directory name unchanged.
+ if ( !$this->isBeingUpgraded($upgrader) ) {
+ return $source;
+ }
+
+ //Rename the source to match the existing directory.
+ $correctedSource = trailingslashit($remoteSource) . $this->directoryName . '/';
+ if ( $source !== $correctedSource ) {
+ //The update archive should contain a single directory that contains the rest of plugin/theme files.
+ //Otherwise, WordPress will try to copy the entire working directory ($source == $remoteSource).
+ //We can't rename $remoteSource because that would break WordPress code that cleans up temporary files
+ //after update.
+ if ( $this->isBadDirectoryStructure($remoteSource) ) {
+ return new WP_Error(
+ 'puc-incorrect-directory-structure',
+ sprintf(
+ 'The directory structure of the update is incorrect. All files should be inside ' .
+ 'a directory named %s, not at the root of the ZIP archive.',
+ htmlentities($this->slug)
+ )
+ );
+ }
+
+ /** @var WP_Upgrader_Skin $upgrader ->skin */
+ $upgrader->skin->feedback(sprintf(
+ 'Renaming %s to %s…',
+ '' . basename($source) . '',
+ '' . $this->directoryName . ''
+ ));
+
+ if ( $wp_filesystem->move($source, $correctedSource, true) ) {
+ $upgrader->skin->feedback('Directory successfully renamed.');
+ return $correctedSource;
+ } else {
+ return new WP_Error(
+ 'puc-rename-failed',
+ 'Unable to rename the update to match the existing directory.'
+ );
+ }
+ }
+
+ return $source;
+ }
+
+ /**
+ * Is there an update being installed right now, for this plugin or theme?
+ *
+ * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update.
+ * @return bool
+ */
+ abstract public function isBeingUpgraded($upgrader = null);
+
+ /**
+ * Check for incorrect update directory structure. An update must contain a single directory,
+ * all other files should be inside that directory.
+ *
+ * @param string $remoteSource Directory path.
+ * @return bool
+ */
+ protected function isBadDirectoryStructure($remoteSource) {
+ global $wp_filesystem;
+ /** @var WP_Filesystem_Base $wp_filesystem */
+
+ $sourceFiles = $wp_filesystem->dirlist($remoteSource);
+ if ( is_array($sourceFiles) ) {
+ $sourceFiles = array_keys($sourceFiles);
+ $firstFilePath = trailingslashit($remoteSource) . $sourceFiles[0];
+ return (count($sourceFiles) > 1) || (!$wp_filesystem->is_dir($firstFilePath));
+ }
+
+ //Assume it's fine.
+ return false;
+ }
+ }
+
+endif;
diff --git a/packages/plugin-updater/Puc/UpgraderStatus.php b/packages/plugin-updater/Puc/UpgraderStatus.php
new file mode 100644
index 000000000..2b7153fb1
--- /dev/null
+++ b/packages/plugin-updater/Puc/UpgraderStatus.php
@@ -0,0 +1,176 @@
+isBeingUpgraded('plugin', $pluginFile, $upgrader);
+ }
+
+ /**
+ * Check if a specific theme or plugin is being upgraded.
+ *
+ * @param string $type
+ * @param string $id
+ * @param Plugin_Upgrader|WP_Upgrader|null $upgrader
+ * @return bool
+ */
+ protected function isBeingUpgraded($type, $id, $upgrader = null) {
+ if ( isset($upgrader) ) {
+ list($currentType, $currentId) = $this->getThingBeingUpgradedBy($upgrader);
+ if ( $currentType !== null ) {
+ $this->currentType = $currentType;
+ $this->currentId = $currentId;
+ }
+ }
+ return ($this->currentType === $type) && ($this->currentId === $id);
+ }
+
+ /**
+ * Figure out which theme or plugin is being upgraded by a WP_Upgrader instance.
+ *
+ * Returns an array with two items. The first item is the type of the thing that's being
+ * upgraded: "plugin" or "theme". The second item is either the plugin basename or
+ * the theme directory name. If we can't determine what the upgrader is doing, both items
+ * will be NULL.
+ *
+ * Examples:
+ * ['plugin', 'plugin-dir-name/plugin.php']
+ * ['theme', 'theme-dir-name']
+ *
+ * @param Plugin_Upgrader|WP_Upgrader $upgrader
+ * @return array
+ */
+ private function getThingBeingUpgradedBy($upgrader) {
+ if ( !isset($upgrader, $upgrader->skin) ) {
+ return [null, null];
+ }
+
+ //Figure out which plugin or theme is being upgraded.
+ $pluginFile = null;
+
+ $skin = $upgrader->skin;
+ if ( $skin instanceof Plugin_Upgrader_Skin ) {
+ if ( isset($skin->plugin) && is_string($skin->plugin) && ($skin->plugin !== '') ) {
+ $pluginFile = $skin->plugin;
+ }
+ } elseif ( isset($skin->plugin_info) && is_array($skin->plugin_info) ) {
+ //This case is tricky because Bulk_Plugin_Upgrader_Skin (etc) doesn't actually store the plugin
+ //filename anywhere. Instead, it has the plugin headers in $plugin_info. So the best we can
+ //do is compare those headers to the headers of installed plugins.
+ $pluginFile = $this->identifyPluginByHeaders($skin->plugin_info);
+ }
+
+ if ( $pluginFile !== null ) {
+ return ['plugin', $pluginFile];
+ }
+ return [null, null];
+ }
+
+ /**
+ * Identify an installed plugin based on its headers.
+ *
+ * @param array $searchHeaders The plugin file header to look for.
+ * @return string|null Plugin basename ("foo/bar.php"), or NULL if we can't identify the plugin.
+ */
+ private function identifyPluginByHeaders($searchHeaders) {
+ if ( !function_exists('get_plugins') ) {
+ /** @noinspection PhpIncludeInspection */
+ require_once ABSPATH . '/wp-admin/includes/plugin.php';
+ }
+
+ $installedPlugins = get_plugins();
+ $matches = [];
+ foreach ($installedPlugins as $pluginBasename => $headers) {
+ $diff1 = array_diff_assoc($headers, $searchHeaders);
+ $diff2 = array_diff_assoc($searchHeaders, $headers);
+ if ( empty($diff1) && empty($diff2) ) {
+ $matches[] = $pluginBasename;
+ }
+ }
+
+ //It's possible (though very unlikely) that there could be two plugins with identical
+ //headers. In that case, we can't unambiguously identify the plugin that's being upgraded.
+ if ( count($matches) !== 1 ) {
+ return null;
+ }
+
+ return reset($matches);
+ }
+
+ /**
+ * @access private
+ *
+ * @param mixed $input
+ * @param array $hookExtra
+ * @return mixed Returns $input unaltered.
+ */
+ public function setUpgradedThing($input, $hookExtra) {
+ if ( !empty($hookExtra['plugin']) && is_string($hookExtra['plugin']) ) {
+ $this->currentId = $hookExtra['plugin'];
+ $this->currentType = 'plugin';
+ } else {
+ $this->currentType = null;
+ $this->currentId = null;
+ }
+ return $input;
+ }
+
+ /**
+ * @access private
+ *
+ * @param array $options
+ * @return array
+ */
+ public function setUpgradedPluginFromOptions($options) {
+ if ( isset($options['hook_extra']['plugin']) && is_string($options['hook_extra']['plugin']) ) {
+ $this->currentType = 'plugin';
+ $this->currentId = $options['hook_extra']['plugin'];
+ } else {
+ $this->currentType = null;
+ $this->currentId = null;
+ }
+ return $options;
+ }
+
+ /**
+ * @access private
+ *
+ * @param mixed $input
+ * @return mixed Returns $input unaltered.
+ */
+ public function clearUpgradedThing($input = null) {
+ $this->currentId = null;
+ $this->currentType = null;
+ return $input;
+ }
+ }
+
+endif;
diff --git a/packages/plugin-updater/Puc/Utils.php b/packages/plugin-updater/Puc/Utils.php
new file mode 100644
index 000000000..faed21f24
--- /dev/null
+++ b/packages/plugin-updater/Puc/Utils.php
@@ -0,0 +1,71 @@
+$node) ) {
+ $currentValue = $currentValue->$node;
+ } else {
+ return $default;
+ }
+ }
+ }
+
+ return $currentValue;
+ }
+
+ /**
+ * Get the first array element that is not empty.
+ *
+ * @param array $values
+ * @param mixed|null $default Returns this value if there are no non-empty elements.
+ * @return mixed|null
+ */
+ public static function findNotEmpty($values, $default = null) {
+ if ( empty($values) ) {
+ return $default;
+ }
+
+ foreach ($values as $value) {
+ if ( !empty($value) ) {
+ return $value;
+ }
+ }
+
+ return $default;
+ }
+
+ /**
+ * Check if the input string starts with the specified prefix.
+ *
+ * @param string $input
+ * @param string $prefix
+ * @return bool
+ */
+ public static function startsWith($input, $prefix) {
+ $length = strlen($prefix);
+ return (substr($input, 0, $length) === $prefix);
+ }
+ }
+
+endif;
diff --git a/packages/plugin-updater/languages/plugin-update-checker-ca.mo b/packages/plugin-updater/languages/plugin-update-checker-ca.mo
new file mode 100644
index 000000000..59645faba
Binary files /dev/null and b/packages/plugin-updater/languages/plugin-update-checker-ca.mo differ
diff --git a/packages/plugin-updater/languages/plugin-update-checker-ca.po b/packages/plugin-updater/languages/plugin-update-checker-ca.po
new file mode 100644
index 000000000..36f3ad703
--- /dev/null
+++ b/packages/plugin-updater/languages/plugin-update-checker-ca.po
@@ -0,0 +1,48 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin-update-checker\n"
+"POT-Creation-Date: 2017-11-24 17:02+0200\n"
+"PO-Revision-Date: 2019-09-25 18:15+0200\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 2.2.3\n"
+"X-Poedit-Basepath: ..\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n"
+"Last-Translator: \n"
+"Language: ca\n"
+"X-Poedit-SearchPath-0: .\n"
+
+#: Puc/v4p3/Plugin/UpdateChecker.php:395
+msgid "Check for updates"
+msgstr "Comprova si hi ha actualitzacions"
+
+#: Puc/v4p3/Plugin/UpdateChecker.php:548
+#, php-format
+msgctxt "the plugin title"
+msgid "The %s plugin is up to date."
+msgstr "L’extensió %s està actualitzada."
+
+#: Puc/v4p3/Plugin/UpdateChecker.php:550
+#, php-format
+msgctxt "the plugin title"
+msgid "A new version of the %s plugin is available."
+msgstr "Una nova versió de l’extensió %s està disponible."
+
+#: Puc/v4p3/Plugin/UpdateChecker.php:552
+#, php-format
+msgctxt "the plugin title"
+msgid "Could not determine if updates are available for %s."
+msgstr "No s’ha pogut determinar si hi ha actualitzacions per a %s."
+
+#: Puc/v4p3/Plugin/UpdateChecker.php:558
+#, php-format
+msgid "Unknown update checker status \"%s\""
+msgstr "Estat del comprovador d’actualitzacions desconegut \"%s\""
+
+#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95
+msgid "There is no changelog available."
+msgstr "No hi ha cap registre de canvis disponible."
diff --git a/packages/plugin-updater/languages/plugin-update-checker-pt_BR.mo b/packages/plugin-updater/languages/plugin-update-checker-pt_BR.mo
new file mode 100644
index 000000000..d1c0f2832
Binary files /dev/null and b/packages/plugin-updater/languages/plugin-update-checker-pt_BR.mo differ
diff --git a/packages/plugin-updater/languages/plugin-update-checker-pt_BR.po b/packages/plugin-updater/languages/plugin-update-checker-pt_BR.po
new file mode 100644
index 000000000..70a0f625d
--- /dev/null
+++ b/packages/plugin-updater/languages/plugin-update-checker-pt_BR.po
@@ -0,0 +1,48 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin-update-checker\n"
+"POT-Creation-Date: 2017-05-19 15:41-0300\n"
+"PO-Revision-Date: 2017-05-19 15:42-0300\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.8.8\n"
+"X-Poedit-Basepath: ..\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+"X-Poedit-KeywordsList: __;_e;_x;_x:1,2c\n"
+"X-Poedit-SearchPath-0: .\n"
+
+#: Puc/v4p1/Plugin/UpdateChecker.php:358
+msgid "Check for updates"
+msgstr "Verificar Atualizações"
+
+#: Puc/v4p1/Plugin/UpdateChecker.php:401 Puc/v4p1/Plugin/UpdateChecker.php:406
+#, php-format
+msgctxt "the plugin title"
+msgid "The %s plugin is up to date."
+msgstr "O plugin %s já está na sua versão mais recente."
+
+#: Puc/v4p1/Plugin/UpdateChecker.php:408
+#, php-format
+msgctxt "the plugin title"
+msgid "A new version of the %s plugin is available."
+msgstr "Há uma nova versão para o plugin %s disponível para download."
+
+#: Puc/v4p1/Plugin/UpdateChecker.php:410
+#, php-format
+msgid "Unknown update checker status \"%s\""
+msgstr "Status \"%s\" desconhecido."
+
+#: Puc/v4p1/Vcs/PluginUpdateChecker.php:83
+msgid "There is no changelog available."
+msgstr "Não há um changelog disponível."
+
+#~ msgid "The %s plugin is up to date."
+#~ msgstr "O plugin %s já está na sua versão mais recente."
+
+#~ msgid "A new version of the %s plugin is available."
+#~ msgstr "Há uma nova versão para o plugin %s disponível para download."
diff --git a/packages/plugin-updater/languages/plugin-update-checker.pot b/packages/plugin-updater/languages/plugin-update-checker.pot
new file mode 100644
index 000000000..99cc24c74
--- /dev/null
+++ b/packages/plugin-updater/languages/plugin-update-checker.pot
@@ -0,0 +1,49 @@
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: plugin-update-checker\n"
+"POT-Creation-Date: 2020-08-08 14:36+0300\n"
+"PO-Revision-Date: 2016-01-10 20:59+0100\n"
+"Last-Translator: Tamás András Horváth \n"
+"Language-Team: \n"
+"Language: en_US\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 2.4\n"
+"X-Poedit-Basepath: ..\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n"
+"X-Poedit-SearchPath-0: .\n"
+
+#: Puc/v4p11/Plugin/Ui.php:128
+msgid "Check for updates"
+msgstr ""
+
+#: Puc/v4p11/Plugin/Ui.php:213
+#, php-format
+msgctxt "the plugin title"
+msgid "The %s plugin is up to date."
+msgstr ""
+
+#: Puc/v4p11/Plugin/Ui.php:215
+#, php-format
+msgctxt "the plugin title"
+msgid "A new version of the %s plugin is available."
+msgstr ""
+
+#: Puc/v4p11/Plugin/Ui.php:217
+#, php-format
+msgctxt "the plugin title"
+msgid "Could not determine if updates are available for %s."
+msgstr ""
+
+#: Puc/v4p11/Plugin/Ui.php:223
+#, php-format
+msgid "Unknown update checker status \"%s\""
+msgstr ""
+
+#: Puc/v4p11/Vcs/PluginUpdateChecker.php:98
+msgid "There is no changelog available."
+msgstr ""
diff --git a/packages/plugin-updater/license.txt b/packages/plugin-updater/license.txt
new file mode 100644
index 000000000..be948f65c
--- /dev/null
+++ b/packages/plugin-updater/license.txt
@@ -0,0 +1,7 @@
+Copyright (c) 2017 Jānis Elsts
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/packages/plugin-updater/load-puc.php b/packages/plugin-updater/load-puc.php
new file mode 100644
index 000000000..50ebff700
--- /dev/null
+++ b/packages/plugin-updater/load-puc.php
@@ -0,0 +1,6 @@
+=3,<3.2.2"
+ },
+ "require-dev": {
+ "doctrine/collections": "^1.6.8",
+ "doctrine/common": "^2.13.3 || ^3.2.2",
+ "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "src/DeepCopy/deep_copy.php"
+ ],
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Create deep copies (clones) of your objects",
+ "keywords": [
+ "clone",
+ "copy",
+ "duplicate",
+ "object",
+ "object graph"
+ ],
+ "support": {
+ "issues": "https://github.com/myclabs/DeepCopy/issues",
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1"
+ },
+ "funding": [
+ {
+ "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-03-08T13:26:56+00:00"
+ },
+ {
+ "name": "nikic/php-parser",
+ "version": "v4.16.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/nikic/PHP-Parser.git",
+ "reference": "19526a33fb561ef417e822e85f08a00db4059c17"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17",
+ "reference": "19526a33fb561ef417e822e85f08a00db4059c17",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": ">=7.0"
+ },
+ "require-dev": {
+ "ircmaxell/php-yacc": "^0.0.7",
+ "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
+ },
+ "bin": [
+ "bin/php-parse"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpParser\\": "lib/PhpParser"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Nikita Popov"
+ }
+ ],
+ "description": "A PHP parser written in PHP",
+ "keywords": [
+ "parser",
+ "php"
+ ],
+ "support": {
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0"
+ },
+ "time": "2023-06-25T14:52:30+00:00"
+ },
+ {
+ "name": "phar-io/manifest",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/manifest.git",
+ "reference": "97803eca37d319dfa7826cc2437fc020857acb53"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
+ "reference": "97803eca37d319dfa7826cc2437fc020857acb53",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-phar": "*",
+ "ext-xmlwriter": "*",
+ "phar-io/version": "^3.0.1",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
+ "support": {
+ "issues": "https://github.com/phar-io/manifest/issues",
+ "source": "https://github.com/phar-io/manifest/tree/2.0.3"
+ },
+ "time": "2021-07-20T11:28:43+00:00"
+ },
+ {
+ "name": "phar-io/version",
+ "version": "3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phar-io/version.git",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Heuer",
+ "email": "sebastian@phpeople.de",
+ "role": "Developer"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "Library for handling version information and constraints",
+ "support": {
+ "issues": "https://github.com/phar-io/version/issues",
+ "source": "https://github.com/phar-io/version/tree/3.2.1"
+ },
+ "time": "2022-02-21T01:04:05+00:00"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "9.2.26",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1",
+ "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-libxml": "*",
+ "ext-xmlwriter": "*",
+ "nikic/php-parser": "^4.15",
+ "php": ">=7.3",
+ "phpunit/php-file-iterator": "^3.0.3",
+ "phpunit/php-text-template": "^2.0.2",
+ "sebastian/code-unit-reverse-lookup": "^2.0.2",
+ "sebastian/complexity": "^2.0",
+ "sebastian/environment": "^5.1.2",
+ "sebastian/lines-of-code": "^1.0.3",
+ "sebastian/version": "^3.0.1",
+ "theseer/tokenizer": "^1.2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-pcov": "PHP extension that provides line coverage",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "9.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-03-06T12:58:08+00:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "3.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
+ "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2021-12-02T12:48:52+00:00"
+ },
+ {
+ "name": "phpunit/php-invoker",
+ "version": "3.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-invoker.git",
+ "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
+ "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "ext-pcntl": "*",
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-pcntl": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Invoke callables with a timeout",
+ "homepage": "https://github.com/sebastianbergmann/php-invoker/",
+ "keywords": [
+ "process"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
+ "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T05:58:55+00:00"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
+ "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T05:33:50+00:00"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "5.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
+ "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-timer/issues",
+ "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:16:10+00:00"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "9.6.9",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "a9aceaf20a682aeacf28d582654a1670d8826778"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a9aceaf20a682aeacf28d582654a1670d8826778",
+ "reference": "a9aceaf20a682aeacf28d582654a1670d8826778",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "^1.3.1 || ^2",
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-xml": "*",
+ "ext-xmlwriter": "*",
+ "myclabs/deep-copy": "^1.10.1",
+ "phar-io/manifest": "^2.0.3",
+ "phar-io/version": "^3.0.2",
+ "php": ">=7.3",
+ "phpunit/php-code-coverage": "^9.2.13",
+ "phpunit/php-file-iterator": "^3.0.5",
+ "phpunit/php-invoker": "^3.1.1",
+ "phpunit/php-text-template": "^2.0.3",
+ "phpunit/php-timer": "^5.0.2",
+ "sebastian/cli-parser": "^1.0.1",
+ "sebastian/code-unit": "^1.0.6",
+ "sebastian/comparator": "^4.0.8",
+ "sebastian/diff": "^4.0.3",
+ "sebastian/environment": "^5.1.3",
+ "sebastian/exporter": "^4.0.5",
+ "sebastian/global-state": "^5.0.1",
+ "sebastian/object-enumerator": "^4.0.3",
+ "sebastian/resource-operations": "^3.0.3",
+ "sebastian/type": "^3.2",
+ "sebastian/version": "^3.0.2"
+ },
+ "suggest": {
+ "ext-soap": "To be able to generate mocks based on WSDL files",
+ "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage"
+ },
+ "bin": [
+ "phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "9.6-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "src/Framework/Assert/Functions.php"
+ ],
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "https://phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/phpunit/issues",
+ "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.9"
+ },
+ "funding": [
+ {
+ "url": "https://phpunit.de/sponsors.html",
+ "type": "custom"
+ },
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2023-06-11T06:13:56+00:00"
+ },
+ {
+ "name": "sebastian/cli-parser",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/cli-parser.git",
+ "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2",
+ "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for parsing CLI options",
+ "homepage": "https://github.com/sebastianbergmann/cli-parser",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
+ "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T06:08:49+00:00"
+ },
+ {
+ "name": "sebastian/code-unit",
+ "version": "1.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit.git",
+ "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
+ "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/code-unit",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:08:54+00:00"
+ },
+ {
+ "name": "sebastian/code-unit-reverse-lookup",
+ "version": "2.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Looks up which function or method a line of code belongs to",
+ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
+ "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T05:30:19+00:00"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "4.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a",
+ "reference": "fa0f136dd2334583309d32b62544682ee972b51a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/diff": "^4.0",
+ "sebastian/exporter": "^4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "https://github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/comparator/issues",
+ "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2022-09-14T12:41:17+00:00"
+ },
+ {
+ "name": "sebastian/complexity",
+ "version": "2.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/complexity.git",
+ "reference": "739b35e53379900cc9ac327b2147867b8b6efd88"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88",
+ "reference": "739b35e53379900cc9ac327b2147867b8b6efd88",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.7",
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for calculating the complexity of PHP code units",
+ "homepage": "https://github.com/sebastianbergmann/complexity",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/complexity/issues",
+ "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T15:52:27+00:00"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "4.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131",
+ "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3",
+ "symfony/process": "^4.2 || ^5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff",
+ "udiff",
+ "unidiff",
+ "unified diff"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/diff/issues",
+ "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-05-07T05:35:17+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "5.1.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
+ "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-posix": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.1-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/environment/issues",
+ "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:03:51+00:00"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "4.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d",
+ "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/recursion-context": "^4.0"
+ },
+ "require-dev": {
+ "ext-mbstring": "*",
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "https://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/exporter/issues",
+ "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2022-09-14T06:03:37+00:00"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "5.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2",
+ "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/object-reflector": "^2.0",
+ "sebastian/recursion-context": "^4.0"
+ },
+ "require-dev": {
+ "ext-dom": "*",
+ "phpunit/phpunit": "^9.3"
+ },
+ "suggest": {
+ "ext-uopz": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "keywords": [
+ "global state"
+ ],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/global-state/issues",
+ "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2022-02-14T08:28:10+00:00"
+ },
+ {
+ "name": "sebastian/lines-of-code",
+ "version": "1.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/lines-of-code.git",
+ "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc",
+ "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc",
+ "shasum": ""
+ },
+ "require": {
+ "nikic/php-parser": "^4.6",
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library for counting the lines of code in PHP source code",
+ "homepage": "https://github.com/sebastianbergmann/lines-of-code",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
+ "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-11-28T06:42:11+00:00"
+ },
+ {
+ "name": "sebastian/object-enumerator",
+ "version": "4.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-enumerator.git",
+ "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
+ "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3",
+ "sebastian/object-reflector": "^2.0",
+ "sebastian/recursion-context": "^4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Traverses array structures and object graphs to enumerate all referenced objects",
+ "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
+ "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:12:34+00:00"
+ },
+ {
+ "name": "sebastian/object-reflector",
+ "version": "2.0.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-reflector.git",
+ "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
+ "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Allows reflection of object attributes, including inherited and non-public ones",
+ "homepage": "https://github.com/sebastianbergmann/object-reflector/",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
+ "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-10-26T13:14:26+00:00"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "4.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
+ "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "https://github.com/sebastianbergmann/recursion-context",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
+ "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:07:39+00:00"
+ },
+ {
+ "name": "sebastian/resource-operations",
+ "version": "3.0.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/resource-operations.git",
+ "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
+ "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides a list of PHP built-in functions that operate on resources",
+ "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/resource-operations/issues",
+ "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T06:45:17+00:00"
+ },
+ {
+ "name": "sebastian/type",
+ "version": "3.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/type.git",
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
+ "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^9.5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Collection of value objects that represent the types of the PHP type system",
+ "homepage": "https://github.com/sebastianbergmann/type",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/type/issues",
+ "source": "https://github.com/sebastianbergmann/type/tree/3.2.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2023-02-03T06:13:03+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "3.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "c6c1022351a901512170118436c764e473f6de8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
+ "reference": "c6c1022351a901512170118436c764e473f6de8c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=7.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/version/issues",
+ "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/sebastianbergmann",
+ "type": "github"
+ }
+ ],
+ "time": "2020-09-28T06:39:44+00:00"
+ },
+ {
+ "name": "squizlabs/php_codesniffer",
+ "version": "3.7.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879",
+ "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879",
+ "shasum": ""
+ },
+ "require": {
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ },
+ "bin": [
+ "bin/phpcs",
+ "bin/phpcbf"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Greg Sherwood",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "keywords": [
+ "phpcs",
+ "standards",
+ "static analysis"
+ ],
+ "support": {
+ "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
+ "source": "https://github.com/squizlabs/PHP_CodeSniffer",
+ "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
+ },
+ "time": "2023-02-22T23:07:41+00:00"
+ },
+ {
+ "name": "theseer/tokenizer",
+ "version": "1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/theseer/tokenizer.git",
+ "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
+ "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": "^7.2 || ^8.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Arne Blankerts",
+ "email": "arne@blankerts.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
+ "support": {
+ "issues": "https://github.com/theseer/tokenizer/issues",
+ "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/theseer",
+ "type": "github"
+ }
+ ],
+ "time": "2021-07-28T10:34:58+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": [],
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": ">=7",
+ "ext-json": "*"
+ },
+ "platform-dev": [],
+ "plugin-api-version": "2.3.0"
+}
\ No newline at end of file
diff --git a/packages/sdk/src/Common/AbstractCollection.php b/packages/sdk/src/Common/AbstractCollection.php
index c428ff59c..9433850bb 100644
--- a/packages/sdk/src/Common/AbstractCollection.php
+++ b/packages/sdk/src/Common/AbstractCollection.php
@@ -1,18 +1,22 @@
manager = $manager;
}
@@ -35,8 +38,7 @@ public function __construct(Manager $manager = null)
* @param AbstractEntity $entity
* @param string|null $key
*/
- public function addEntity(AbstractEntity $entity, string $key = null)
- {
+ public function addEntity(AbstractEntity $entity, string $key = null): void {
if (is_null($key)) {
$this->collection[] = $entity;
} else {
@@ -49,8 +51,7 @@ public function addEntity(AbstractEntity $entity, string $key = null)
*
* @param $entities
*/
- public function setEntity($entities)
- {
+ public function setEntity($entities): void {
if (is_array($entities) || is_object($entities)) {
foreach ($entities as $value) {
$this->add($value);
@@ -61,24 +62,21 @@ public function setEntity($entities)
/**
* @inheritDoc
*/
- public function getIterator()
- {
- return new \ArrayIterator($this->collection);
+ public function getIterator(): Traversable {
+ return new ArrayIterator($this->collection);
}
/**
* @return int|null
*/
- public function count(): int
- {
+ public function count(): int {
return count($this->collection);
}
/**
* @return array
*/
- public function jsonSerialize(): array
- {
+ public function jsonSerialize(): array {
return $this->collection;
}
}
diff --git a/packages/sdk/src/Common/AbstractEntity.php b/packages/sdk/src/Common/AbstractEntity.php
index 48aacbcdc..d7229cfe5 100644
--- a/packages/sdk/src/Common/AbstractEntity.php
+++ b/packages/sdk/src/Common/AbstractEntity.php
@@ -3,14 +3,17 @@
namespace MercadoPago\PP\Sdk\Common;
use MercadoPago\PP\Sdk\Interfaces\EntityInterface;
+use MercadoPago\PP\Sdk\Sdk;
+use JsonSerializable;
+use IteratorAggregate;
+use Exception;
/**
* Class AbstractEntity
*
* @package MercadoPago\PP\Sdk\Common
*/
-abstract class AbstractEntity implements \JsonSerializable, EntityInterface
-{
+abstract class AbstractEntity implements JsonSerializable, EntityInterface {
/**
* @var Manager
*/
@@ -26,8 +29,7 @@ abstract class AbstractEntity implements \JsonSerializable, EntityInterface
*
* @param Manager|null $manager
*/
- public function __construct(Manager $manager = null)
- {
+ public function __construct(Manager $manager = null) {
$this->manager = $manager;
$this->setExcludedProperties();
}
@@ -37,8 +39,7 @@ public function __construct(Manager $manager = null)
*
* @return mixed
*/
- public function __get(string $name)
- {
+ public function __get(string $name) {
return $this->{$name};
}
@@ -46,14 +47,13 @@ public function __get(string $name)
* @param string $name
* @param mixed $value
*/
- public function __set(string $name, $value)
- {
- if (!property_exists($this, $name)) {
+ public function __set(string $name, $value): void {
+ if ( ! property_exists($this, $name)) {
return;
}
- if (is_subclass_of($this->{$name}, AbstractEntity::class) ||
- is_subclass_of($this->{$name}, AbstractCollection::class)
+ if (is_subclass_of($this->{$name}, 'MercadoPago\PP\Sdk\Common\AbstractEntity') ||
+ is_subclass_of($this->{$name}, 'MercadoPago\PP\Sdk\Common\AbstractCollection')
) {
$this->{$name}->setEntity($value);
} else {
@@ -66,27 +66,23 @@ public function __set(string $name, $value)
*
* @return bool
*/
- public function __isset(string $name)
- {
+ public function __isset(string $name) {
return isset($this->{$name});
}
/**
* @param string $name
*/
- public function __unset(string $name)
- {
+ public function __unset(string $name): void {
unset($this->{$name});
}
-
/**
* Set values for an entity's attributes.
*
* @param $data
*/
- public function setEntity($data)
- {
+ public function setEntity($data): void {
if (is_array($data) || is_object($data)) {
foreach ($data as $key => $value) {
$this->__set($key, $value);
@@ -100,8 +96,7 @@ public function setEntity($data)
*
* @return array
*/
- public function getProperties(): array
- {
+ public function getProperties(): array {
return get_object_vars($this);
}
@@ -110,18 +105,17 @@ public function getProperties(): array
*
* @return array
*/
- public function toArray(): array
- {
- $data = [];
- $properties = $this->getProperties();
+ public function toArray(): array {
+ $data = array();
+ $properties = $this->getProperties();
$excludedPropertiesCount = count($this->excluded_properties);
foreach ($properties as $property => $value) {
- if ($property === 'manager' || $property === 'excluded_properties') {
+ if ('manager' === $property || 'excluded_properties' === $property) {
continue;
}
- if ($excludedPropertiesCount !== 0 && in_array($property, $this->excluded_properties)) {
+ if (0 !== $excludedPropertiesCount && in_array($property, $this->excluded_properties, true)) {
continue;
}
@@ -130,7 +124,7 @@ public function toArray(): array
continue;
}
- if (($value instanceof \IteratorAggregate) || (is_array($value) && count($value))) {
+ if (($value instanceof IteratorAggregate) || (is_array($value) && count($value))) {
foreach ($value as $index => $item) {
if ($item instanceof self) {
$data[$property][$index] = $item->toArray();
@@ -153,20 +147,19 @@ public function toArray(): array
* @param array $params
*
* @return mixed
- * @throws \Exception
+ * @throws Exception
*/
- public function read(array $params = [])
- {
+ public function read(array $params = array()) {
$method = 'get';
- $class = get_called_class();
+ $class = get_called_class();
$entity = new $class($this->manager);
$customHeaders = $this->getHeaders()['read'];
- $header = $this->manager->getHeader($customHeaders);
+ $header = $this->manager->getHeader($customHeaders);
- $uri = $this->manager->getEntityUri($entity, $method, $params);
+ $uri = $this->manager->getEntityUri($entity, $method, $params);
$response = $this->manager->execute($entity, $uri, $method, $header);
-
+ $this->obfuscateAuthorizationHeader($header);
return $this->manager->handleResponse($response, $method, $entity);
}
@@ -174,26 +167,24 @@ public function read(array $params = [])
* Save method (POST).
*
* @return mixed
- * @throws \Exception
+ * @throws Exception
*/
- public function save()
- {
+ public function save() {
$method = 'post';
$customHeaders = $this->getHeaders()['save'];
- $header = $this->manager->getHeader($customHeaders);
+ $header = $this->manager->getHeader($customHeaders);
- $uri = $this->manager->getEntityUri($this, $method);
+ $uri = $this->manager->getEntityUri($this, $method);
$response = $this->manager->execute($this, $uri, $method, $header);
-
+ $this->obfuscateAuthorizationHeader($header);
return $this->manager->handleResponse($response, $method);
}
/**
* @return array
*/
- public function jsonSerialize(): array
- {
+ public function jsonSerialize(): array {
return $this->toArray();
}
@@ -202,8 +193,28 @@ public function jsonSerialize(): array
*
* @return void
*/
- public function setExcludedProperties()
- {
- $this->excluded_properties = [];
+ public function setExcludedProperties(): void {
+ $this->excluded_properties = array();
+ }
+
+ /**
+ * Obfuscate Authorization Header.
+ *
+ * @return void
+ */
+ public function obfuscateAuthorizationHeader(array $headers): void {
+ Sdk::$cache['last_headers'] = preg_replace('/(Authorization: Bearer) (.*)/i', '$1 xxx', $headers);
+ }
+
+ /**
+ * Get last Headers.
+ *
+ * @return array
+ */
+ public function getLastHeaders(): array {
+ if (isset(Sdk::$cache['last_headers'])) {
+ return Sdk::$cache['last_headers'];
+ }
+ return array();
}
}
diff --git a/packages/sdk/src/Common/Config.php b/packages/sdk/src/Common/Config.php
index 85b1caff4..ea11e05f3 100644
--- a/packages/sdk/src/Common/Config.php
+++ b/packages/sdk/src/Common/Config.php
@@ -7,8 +7,7 @@
*
* @package MercadoPago\PP\Sdk\Common
*/
-class Config
-{
+class Config {
/**
* @var string
*/
@@ -54,8 +53,7 @@ public function __construct(
*
* @return mixed
*/
- public function __get(string $name)
- {
+ public function __get(string $name) {
return $this->{$name};
}
@@ -63,8 +61,7 @@ public function __get(string $name)
* @param string $name
* @param string $value
*/
- public function __set(string $name, string $value)
- {
+ public function __set(string $name, string $value): void {
if (property_exists($this, $name)) {
$this->{$name} = $value;
}
diff --git a/packages/sdk/src/Common/Constants.php b/packages/sdk/src/Common/Constants.php
index 059f94839..72eee0ed9 100644
--- a/packages/sdk/src/Common/Constants.php
+++ b/packages/sdk/src/Common/Constants.php
@@ -7,8 +7,8 @@
*
* @package MercadoPago\PP\Sdk\Common
*/
-class Constants
-{
- const BASEURL_MP = 'https://api.mercadopago.com';
- const BASEURL_ML = 'https://api.mercadolibre.com';
+class Constants {
+ public const BASEURL_MP = 'https://api.mercadopago.com';
+
+ public const BASEURL_ML = 'https://api.mercadolibre.com';
}
diff --git a/packages/sdk/src/Common/Manager.php b/packages/sdk/src/Common/Manager.php
index 9662b5932..1275f9612 100644
--- a/packages/sdk/src/Common/Manager.php
+++ b/packages/sdk/src/Common/Manager.php
@@ -4,14 +4,14 @@
use MercadoPago\PP\Sdk\HttpClient\HttpClientInterface;
use MercadoPago\PP\Sdk\HttpClient\Response;
+use Exception;
/**
* Class Manager
*
* @package MercadoPago\PP\Sdk\Common
*/
-class Manager
-{
+class Manager {
/**
* @var HttpClientInterface
*/
@@ -28,8 +28,7 @@ class Manager
* @param HttpClientInterface $client
* @param Config $config
*/
- public function __construct(HttpClientInterface $client, Config $config)
- {
+ public function __construct(HttpClientInterface $client, Config $config) {
$this->client = $client;
$this->config = $config;
}
@@ -44,9 +43,8 @@ public function __construct(HttpClientInterface $client, Config $config)
*
* @return mixed
*/
- public function execute(AbstractEntity $entity, string $uri, string $method = 'get', array $headers = [])
- {
- if ($method == 'get') {
+ public function execute(AbstractEntity $entity, string $uri, string $method = 'get', array $headers = array()) {
+ if ('get' == $method) {
return $this->client->{$method}($uri, $headers);
}
@@ -62,13 +60,12 @@ public function execute(AbstractEntity $entity, string $uri, string $method = 'g
* @param array $params
*
* @return mixed
- * @throws \Exception
+ * @throws Exception
*/
- public function getEntityUri(AbstractEntity $entity, string $method, array $params = [])
- {
+ public function getEntityUri(AbstractEntity $entity, string $method, array $params = array()) {
if (method_exists($entity, 'getUris')) {
$uri = $entity->getUris()[$method];
- $matches = [];
+ $matches = array();
preg_match_all('/\\:\\w+/', $uri, $matches);
foreach ($matches[0] as $match) {
@@ -76,7 +73,7 @@ public function getEntityUri(AbstractEntity $entity, string $method, array $para
if (array_key_exists($key, $params)) {
$uri = str_replace($match, $params[$key], $uri);
- } elseif (property_exists($entity, $key) && !is_null($entity->{$key})) {
+ } elseif (property_exists($entity, $key) && ! is_null($entity->{$key})) {
$uri = str_replace($match, $entity->{$key}, $uri);
} else {
$uri = str_replace($match, '', $uri);
@@ -85,7 +82,7 @@ public function getEntityUri(AbstractEntity $entity, string $method, array $para
return $uri;
} else {
- throw new \Exception('Method not available for ' . get_class($entity) . ' entity');
+ throw new Exception('Method not available for ' . get_class($entity) . ' entity');
}
}
@@ -94,14 +91,13 @@ public function getEntityUri(AbstractEntity $entity, string $method, array $para
*
* @return array
*/
- public function getDefaultHeader(): array
- {
- return [
+ public function getDefaultHeader(): array {
+ return array(
'Authorization: Bearer ' . $this->config->__get('access_token'),
'x-platform-id: ' . $this->config->__get('platform_id'),
'x-product-id: ' . $this->config->__get('product_id'),
'x-integrator-id: ' . $this->config->__get('integrator_id')
- ];
+ );
}
/**
@@ -110,8 +106,7 @@ public function getDefaultHeader(): array
*
* @return array
*/
- public function getHeader(array $customHeaders = []): array
- {
+ public function getHeader(array $customHeaders = array()): array {
$defaultHeaders = $this->getDefaultHeader();
return array_merge($defaultHeaders, $customHeaders);
}
@@ -124,20 +119,20 @@ public function getHeader(array $customHeaders = []): array
* @param AbstractEntity|null $entity
*
* @return mixed
- * @throws \Exception
+ * @throws Exception
*/
- public function handleResponse(Response $response, string $method, AbstractEntity $entity = null)
- {
+ public function handleResponse(Response $response, string $method, AbstractEntity $entity = null) {
if ($response->getStatus() == '200' || $response->getStatus() == '201') {
- if ($entity && $method == 'get') {
+ if ($entity && 'get' == $method) {
$entity->setEntity($response->getData());
return $entity;
}
return $response->getData();
- } elseif (intval($response->getStatus()) >= 400 && intval($response->getStatus()) < 500) {
- throw new \Exception($response->getData()['message']);
+ }
+ if ((int) ($response->getStatus()) >= 400 && (int) ($response->getStatus()) < 500) {
+ throw new Exception($response->getData()['message']);
} else {
- throw new \Exception("Internal API Error");
+ throw new Exception("Internal API Error");
}
}
}
diff --git a/packages/sdk/src/Entity/Notification/Notification.php b/packages/sdk/src/Entity/Notification/Notification.php
index b31889d25..56006b91e 100644
--- a/packages/sdk/src/Entity/Notification/Notification.php
+++ b/packages/sdk/src/Entity/Notification/Notification.php
@@ -9,28 +9,30 @@
/**
* Class Notification
*
- * @property string $ip_address
* @property string $notification_id
* @property string $notification_url
* @property string $status
- * @property string $external_reference
- * @property float $transaction_id
+ * @property string $transaction_id
* @property string $transaction_type
+ * @property string $platform_id
+ * @property string $external_reference
+ * @property string $preference_id
* @property float $transaction_amount
- * @property float $total_pending
- * @property float $total_approved
* @property float $total_paid
- * @property float $total_rejected
+ * @property float $total_approved
+ * @property float $total_pending
* @property float $total_refunded
+ * @property float $total_rejected
* @property float $total_cancelled
* @property float $total_charged_back
+ * @property string $multiple_payment_transaction_id
* @property array $payments_metadata
- * @property PaymentDetails $payments_details
+ * @property PaymentDetailsList $payments_details
+ * @property RefundNotifyingList $refunds_notifying
*
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
-class Notification extends AbstractEntity implements RequesterEntityInterface
-{
+class Notification extends AbstractEntity implements RequesterEntityInterface {
/**
* @var string
*/
@@ -49,17 +51,27 @@ class Notification extends AbstractEntity implements RequesterEntityInterface
/**
* @var string
*/
- protected $external_reference;
+ protected $transaction_id;
/**
- * @var float
+ * @var string
*/
- protected $transaction_id;
+ protected $transaction_type;
/**
* @var string
*/
- protected $transaction_type;
+ protected $platform_id;
+
+ /**
+ * @var string
+ */
+ protected $external_reference;
+
+ /**
+ * @var string
+ */
+ protected $preference_id;
/**
* @var float
@@ -69,7 +81,7 @@ class Notification extends AbstractEntity implements RequesterEntityInterface
/**
* @var float
*/
- protected $total_pending;
+ protected $total_paid;
/**
* @var float
@@ -79,17 +91,17 @@ class Notification extends AbstractEntity implements RequesterEntityInterface
/**
* @var float
*/
- protected $total_paid;
+ protected $total_pending;
/**
* @var float
*/
- protected $total_rejected;
+ protected $total_refunded;
/**
* @var float
*/
- protected $total_refunded;
+ protected $total_rejected;
/**
* @var float
@@ -101,25 +113,35 @@ class Notification extends AbstractEntity implements RequesterEntityInterface
*/
protected $total_charged_back;
+ /**
+ * @var string
+ */
+ protected $multiple_payment_transaction_id;
+
/**
* @var array
*/
protected $payments_metadata;
/**
- * @var PaymentDetails
+ * @var PaymentDetailsList
*/
protected $payments_details;
+ /**
+ * @var RefundNotifyingList
+ */
+ protected $refunds_notifying;
+
/**
* Notification constructor.
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
$this->payments_details = new PaymentDetailsList($manager);
+ $this->refunds_notifying = new RefundNotifyingList($manager);
}
/**
@@ -127,9 +149,8 @@ public function __construct($manager)
*
* @return void
*/
- public function setExcludedProperties()
- {
- $this->excluded_properties = [];
+ public function setExcludedProperties(): void {
+ $this->excluded_properties = array();
}
/**
@@ -137,12 +158,11 @@ public function setExcludedProperties()
*
* @return array
*/
- public function getHeaders(): array
- {
- return [
- 'read' => [],
- 'save' => [],
- ];
+ public function getHeaders(): array {
+ return array(
+ 'read' => array(),
+ 'save' => array(),
+ );
}
/**
@@ -150,10 +170,9 @@ public function getHeaders(): array
*
* @return array
*/
- public function getUris(): array
- {
+ public function getUris(): array {
return array(
- 'get' => '/v1/bifrost/notification/status/:id',
+ 'get' => '/v1/asgard/notification/:id',
);
}
}
diff --git a/packages/sdk/src/Entity/Notification/PaymentDetails.php b/packages/sdk/src/Entity/Notification/PaymentDetails.php
index 2cd1559c1..11acc27f9 100644
--- a/packages/sdk/src/Entity/Notification/PaymentDetails.php
+++ b/packages/sdk/src/Entity/Notification/PaymentDetails.php
@@ -8,35 +8,35 @@
/**
* Class PaymentDetails
*
- * @property float $id
- * @property string $status
- * @property string $status_detail
- * @property string $payment_type_id
+ * @property int $id
* @property string $payment_method_id
+ * @property PaymentMethodInfo $payment_method_info
+ * @property string $payment_type_id
* @property float $total_amount
* @property float $paid_amount
- * @property float $coupon_amount
* @property float $shipping_cost
+ * @property float $coupon_amount
+ * @property string $status
+ * @property string $status_detail
* @property RefundList $refunds
-
+ *
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
-class PaymentDetails extends AbstractEntity
-{
+class PaymentDetails extends AbstractEntity {
/**
- * @var float
+ * @var int
*/
protected $id;
/**
* @var string
*/
- protected $status;
+ protected $payment_method_id;
/**
- * @var string
+ * @var PaymentMethodInfo
*/
- protected $status_detail;
+ protected $payment_method_info;
/**
* @var string
@@ -44,19 +44,19 @@ class PaymentDetails extends AbstractEntity
protected $payment_type_id;
/**
- * @var string
+ * @var float
*/
- protected $payment_method_id;
+ protected $total_amount;
/**
* @var float
*/
- protected $total_amount;
+ protected $paid_amount;
/**
* @var float
*/
- protected $paid_amount;
+ protected $shipping_cost;
/**
* @var float
@@ -64,14 +64,14 @@ class PaymentDetails extends AbstractEntity
protected $coupon_amount;
/**
- * @var float
+ * @var string
*/
- protected $shipping_cost;
+ protected $status;
/**
- * @var PaymentMethodInfo
+ * @var string
*/
- protected $payment_method_info;
+ protected $status_detail;
/**
* @var RefundList
@@ -83,8 +83,7 @@ class PaymentDetails extends AbstractEntity
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
$this->refunds = new RefundList($manager);
}
diff --git a/packages/sdk/src/Entity/Notification/PaymentDetailsList.php b/packages/sdk/src/Entity/Notification/PaymentDetailsList.php
index 55d6628fa..89d3f1e4f 100644
--- a/packages/sdk/src/Entity/Notification/PaymentDetailsList.php
+++ b/packages/sdk/src/Entity/Notification/PaymentDetailsList.php
@@ -9,16 +9,14 @@
*
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
-class PaymentDetailsList extends AbstractCollection
-{
+class PaymentDetailsList extends AbstractCollection {
/**
* Add entity to collection
*
* @param array $entity
* @param string|null $key
*/
- public function add(array $entity, string $key = null)
- {
+ public function add(array $entity, string $key = null): void {
$item = new PaymentDetails($this->manager);
$item->setEntity($entity);
parent::addEntity($item, $key);
diff --git a/packages/sdk/src/Entity/Notification/PaymentMethodInfo.php b/packages/sdk/src/Entity/Notification/PaymentMethodInfo.php
index 9586e164e..64680a6b5 100644
--- a/packages/sdk/src/Entity/Notification/PaymentMethodInfo.php
+++ b/packages/sdk/src/Entity/Notification/PaymentMethodInfo.php
@@ -7,10 +7,18 @@
/**
* Class PaymentMethodInfo
*
+ * @property string $barcode_content
+ * @property string $external_resource_url
+ * @property string $payment_method_reference_id
+ * @property string $date_of_expiration
+ * @property string $last_four_digits
+ * @property float $installments
+ * @property float $installment_rate
+ * @property double $installment_amount
+ *
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
-class PaymentMethodInfo extends AbstractEntity
-{
+class PaymentMethodInfo extends AbstractEntity {
/**
* @var string
*/
@@ -27,24 +35,24 @@ class PaymentMethodInfo extends AbstractEntity
protected $payment_method_reference_id;
/**
- * @var bool
+ * @var string
*/
protected $date_of_expiration;
/**
- * @var double
+ * @var string
*/
- protected $installments;
+ protected $last_four_digits;
/**
- * @var double
+ * @var float
*/
- protected $installment_rate;
+ protected $installments;
/**
- * @var string
+ * @var float
*/
- protected $last_four_digits;
+ protected $installment_rate;
/**
* @var double
diff --git a/packages/sdk/src/Entity/Notification/Refund.php b/packages/sdk/src/Entity/Notification/Refund.php
index 995000c0c..595f28259 100644
--- a/packages/sdk/src/Entity/Notification/Refund.php
+++ b/packages/sdk/src/Entity/Notification/Refund.php
@@ -7,17 +7,16 @@
/**
* Class Refund
*
- * @property float $id
+ * @property int $id
* @property string $status
* @property bool $notifying
- * @property object $metadata
+ * @property array $metadata
*
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
-class Refund extends AbstractEntity
-{
+class Refund extends AbstractEntity {
/**
- * @var float
+ * @var int
*/
protected $id;
@@ -32,7 +31,7 @@ class Refund extends AbstractEntity
protected $notifying;
/**
- * @var object
+ * @var array
*/
protected $metadata;
}
diff --git a/packages/sdk/src/Entity/Notification/RefundList.php b/packages/sdk/src/Entity/Notification/RefundList.php
index 0e2261570..496ee31e6 100644
--- a/packages/sdk/src/Entity/Notification/RefundList.php
+++ b/packages/sdk/src/Entity/Notification/RefundList.php
@@ -9,18 +9,29 @@
*
* @package MercadoPago\PP\Sdk\Entity\Notification
*/
-class RefundList extends AbstractCollection
-{
+class RefundList extends AbstractCollection {
/**
* Add entity to collection
*
* @param array $entity
* @param string|null $key
*/
- public function add(array $entity, string $key = null)
- {
+ public function add(array $entity, string $key = null): void {
$refund = new Refund($this->manager);
$refund->setEntity($entity);
parent::addEntity($refund, $key);
}
+
+ /**
+ * Add multiple entities to collection
+ *
+ * @param $entities
+ */
+ public function setEntity($entities): void {
+ if (is_array($entities) || is_object($entities)) {
+ foreach ($entities as $value) {
+ $this->add($value, $value["id"]);
+ }
+ }
+ }
}
diff --git a/packages/sdk/src/Entity/Notification/RefundNotifying.php b/packages/sdk/src/Entity/Notification/RefundNotifying.php
new file mode 100644
index 000000000..ee1915799
--- /dev/null
+++ b/packages/sdk/src/Entity/Notification/RefundNotifying.php
@@ -0,0 +1,31 @@
+manager);
+ $item->setEntity($entity);
+ parent::addEntity($item, $key);
+ }
+}
diff --git a/packages/sdk/src/Entity/Payment/AdditionalInfo.php b/packages/sdk/src/Entity/Payment/AdditionalInfo.php
index 902157227..7784c90fb 100644
--- a/packages/sdk/src/Entity/Payment/AdditionalInfo.php
+++ b/packages/sdk/src/Entity/Payment/AdditionalInfo.php
@@ -9,19 +9,43 @@
* Class AdditionalInfo
*
* @property string $ip_address
+ * @property string $referral_url
+ * @property boolean $drop_shipping
+ * @property string $delivery_promise
+ * @property string $contrated_plan
* @property ItemList $items
* @property AdditionalInfoPayer $payer
+ * @property Seller $seller
* @property Shipments $shipments
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class AdditionalInfo extends AbstractEntity
-{
+class AdditionalInfo extends AbstractEntity {
/**
* @var string
*/
protected $ip_address;
+ /**
+ * @var string
+ */
+ protected $referral_url;
+
+ /**
+ * @var boolean
+ */
+ protected $drop_shipping;
+
+ /**
+ * @var string
+ */
+ protected $delivery_promise;
+
+ /**
+ * @var string
+ */
+ protected $contrated_plan;
+
/**
* @var ItemList
*/
@@ -32,6 +56,11 @@ class AdditionalInfo extends AbstractEntity
*/
protected $payer;
+ /**
+ * @var Seller
+ */
+ protected $seller;
+
/**
* @var Shipments
*/
@@ -42,11 +71,11 @@ class AdditionalInfo extends AbstractEntity
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
- $this->items = new ItemList($manager);
- $this->payer = new AdditionalInfoPayer($manager);
+ $this->items = new ItemList($manager);
+ $this->payer = new AdditionalInfoPayer($manager);
+ $this->seller = new Seller($manager);
$this->shipments = new Shipments($manager);
}
}
diff --git a/packages/sdk/src/Entity/Payment/AdditionalInfoAddress.php b/packages/sdk/src/Entity/Payment/AdditionalInfoAddress.php
new file mode 100644
index 000000000..bf24a2b5c
--- /dev/null
+++ b/packages/sdk/src/Entity/Payment/AdditionalInfoAddress.php
@@ -0,0 +1,67 @@
+phone = new Phone($manager);
- $this->address = new AdditionalInfoPayerAddress($manager);
+ $this->address = new AdditionalInfoAddress($manager);
+ $this->phone = new Phone($manager);
+ $this->mobile = new Phone($manager);
+ $this->identification = new Identification($manager);
}
}
diff --git a/packages/sdk/src/Entity/Payment/AdditionalInfoPayerAddress.php b/packages/sdk/src/Entity/Payment/AdditionalInfoPayerAddress.php
index 4b3dfc95d..6abcaafa2 100644
--- a/packages/sdk/src/Entity/Payment/AdditionalInfoPayerAddress.php
+++ b/packages/sdk/src/Entity/Payment/AdditionalInfoPayerAddress.php
@@ -12,8 +12,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class AdditionalInfoPayerAddress extends AbstractEntity
-{
+class AdditionalInfoPayerAddress extends AbstractEntity {
/**
* @var string
*/
diff --git a/packages/sdk/src/Entity/Payment/Address.php b/packages/sdk/src/Entity/Payment/Address.php
index d82bc7b5e..5f3a24fc9 100644
--- a/packages/sdk/src/Entity/Payment/Address.php
+++ b/packages/sdk/src/Entity/Payment/Address.php
@@ -16,8 +16,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class Address extends AbstractEntity
-{
+class Address extends AbstractEntity {
/**
* @var string
*/
diff --git a/packages/sdk/src/Entity/Payment/ApplicationData.php b/packages/sdk/src/Entity/Payment/ApplicationData.php
new file mode 100644
index 000000000..e4760e0d3
--- /dev/null
+++ b/packages/sdk/src/Entity/Payment/ApplicationData.php
@@ -0,0 +1,25 @@
+manager);
$item->setEntity($entity);
parent::addEntity($item, $key);
diff --git a/packages/sdk/src/Entity/Payment/Multipayment.php b/packages/sdk/src/Entity/Payment/Multipayment.php
new file mode 100644
index 000000000..7998581ac
--- /dev/null
+++ b/packages/sdk/src/Entity/Payment/Multipayment.php
@@ -0,0 +1,29 @@
+transaction_info = new TransactionInfoList($manager);
+ }
+}
diff --git a/packages/sdk/src/Entity/Payment/MultipaymentV2.php b/packages/sdk/src/Entity/Payment/MultipaymentV2.php
new file mode 100644
index 000000000..ecd0455a2
--- /dev/null
+++ b/packages/sdk/src/Entity/Payment/MultipaymentV2.php
@@ -0,0 +1,29 @@
+transaction_info = new TransactionInfoList($manager);
+ }
+}
diff --git a/packages/sdk/src/Entity/Payment/Payer.php b/packages/sdk/src/Entity/Payment/Payer.php
index f9656422b..22ed85362 100644
--- a/packages/sdk/src/Entity/Payment/Payer.php
+++ b/packages/sdk/src/Entity/Payment/Payer.php
@@ -8,33 +8,44 @@
/**
* Class Payer
*
- * @property string $id
* @property string $entity_type
+ * @property string $type
+ * @property string $id
* @property string $email
+ * @property Identification $identification
* @property string $first_name
* @property string $last_name
- * @property PayerIdentification $identification
+ * @property string $operator_id
* @property Address $address
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class Payer extends AbstractEntity
-{
+class Payer extends AbstractEntity {
/**
* @var string
*/
- protected $id;
+ protected $entity_type;
/**
* @var string
*/
- protected $entity_type;
+ protected $type;
+
+ /**
+ * @var string
+ */
+ protected $id;
/**
* @var string
*/
protected $email;
+ /**
+ * @var Identification
+ */
+ protected $identification;
+
/**
* @var string
*/
@@ -46,9 +57,9 @@ class Payer extends AbstractEntity
protected $last_name;
/**
- * @var PayerIdentification
+ * @var string
*/
- protected $identification;
+ protected $operator_id;
/**
* @var Address
@@ -60,10 +71,9 @@ class Payer extends AbstractEntity
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
- $this->identification = new PayerIdentification($manager);
- $this->address = new Address($manager);
+ $this->identification = new Identification($manager);
+ $this->address = new Address($manager);
}
}
diff --git a/packages/sdk/src/Entity/Payment/PayerIdentification.php b/packages/sdk/src/Entity/Payment/PayerIdentification.php
index f43e8907c..2fda9b8ec 100644
--- a/packages/sdk/src/Entity/Payment/PayerIdentification.php
+++ b/packages/sdk/src/Entity/Payment/PayerIdentification.php
@@ -12,8 +12,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class PayerIdentification extends AbstractEntity
-{
+class PayerIdentification extends AbstractEntity {
/**
* @var string
*/
diff --git a/packages/sdk/src/Entity/Payment/Payment.php b/packages/sdk/src/Entity/Payment/Payment.php
index 025f40a03..099746383 100644
--- a/packages/sdk/src/Entity/Payment/Payment.php
+++ b/packages/sdk/src/Entity/Payment/Payment.php
@@ -9,131 +9,208 @@
/**
* Class Payment
*
- * @property string $session_id
- * @property string $description
- * @property string $external_reference
- * @property string $notification_url
- * @property int $installments
- * @property double $transaction_amount
- * @property string $payment_method_id
- * @property string $statement_descriptor
- * @property boolean $binary_mode
* @property string $date_of_expiration
- * @property string $callback_url
- * @property string $token
+ * @property string $operation_type
* @property string $issuer_id
- * @property string $campaign_id
- * @property double $coupon_amount
- * @property string $coupon_code
+ * @property string $payment_method_id
+ * @property string $description
+ * @property string $sponsor_id
+ * @property string $counter_currency
+ * @property double $shipping_amount
+ * @property string $store_id
* @property Payer $payer
+ * @property array $metadata
* @property AdditionalInfo $additional_info
+ * @property string $external_reference
+ * @property double $transaction_amount
+ * @property double $coupon_amount
+ * @property int $differential_pricing_id
+ * @property int $installments
* @property TransactionDetails $transaction_details
+ * @property bool $binary_mode
+ * @property string $statement_descriptor
+ * @property string $notification_url
+ * @property string $processing_mode
+ * @property string $merchant_account_id
* @property PointOfInteraction $point_of_interaction
- * @property object $metadata
+ * @property string $brand_id
+ * @property string $reserve_id
+ * @property array $collector
+ * @property string $callback_url
+ * @property double $application_fee
+ * @property int $campaign_id
+ * @property bool $capture
+ * @property string $coupon_code
+ * @property string $token
+ * @property string $session_id
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class Payment extends AbstractEntity implements RequesterEntityInterface
-{
+class Payment extends AbstractEntity implements RequesterEntityInterface {
/**
* @var string
*/
- protected $description;
+ protected $date_of_expiration;
/**
* @var string
*/
- protected $external_reference;
+ protected $operation_type;
/**
* @var string
*/
- protected $notification_url;
+ protected $issuer_id;
/**
- * @var int
+ * @var string
*/
- protected $installments;
+ protected $payment_method_id;
+
+ /**
+ * @var string
+ */
+ protected $description;
+
+ /**
+ * @var string
+ */
+ protected $sponsor_id;
+
+ /**
+ * @var string
+ */
+ protected $counter_currency;
/**
* @var double
*/
- protected $transaction_amount;
+ protected $shipping_amount;
/**
* @var string
*/
- protected $payment_method_id;
+ protected $store_id;
+
+ /**
+ * @var Payer
+ */
+ protected $payer;
+
+ /**
+ * @var array
+ */
+ protected $metadata;
+
+ /**
+ * @var AdditionalInfo
+ */
+ protected $additional_info;
/**
* @var string
*/
- protected $statement_descriptor;
+ protected $external_reference;
+
+ /**
+ * @var double
+ */
+ protected $transaction_amount;
+
+ /**
+ * @var double
+ */
+ protected $coupon_amount;
+
+ /**
+ * @var int
+ */
+ protected $differential_pricing_id;
+
+ /**
+ * @var int
+ */
+ protected $installments;
+
+ /**
+ * @var TransactionDetails
+ */
+ protected $transaction_details;
/**
- * @var boolean
+ * @var bool
*/
protected $binary_mode;
/**
* @var string
*/
- protected $date_of_expiration;
+ protected $statement_descriptor;
/**
* @var string
*/
- protected $callback_url;
+ protected $notification_url;
/**
* @var string
*/
- protected $token;
+ protected $processing_mode;
/**
* @var string
*/
- protected $issuer_id;
+ protected $merchant_account_id;
+
+ /**
+ * @var PointOfInteraction
+ */
+ protected $point_of_interaction;
/**
* @var string
*/
- protected $campaign_id;
+ protected $brand_id;
/**
- * @var double
+ * @var string
*/
- protected $coupon_amount;
+ protected $reserve_id;
+
+ /**
+ * @var array
+ */
+ protected $collector;
/**
* @var string
*/
- protected $coupon_code;
+ protected $callback_url;
/**
- * @var Payer
+ * @var double
*/
- protected $payer;
+ protected $application_fee;
/**
- * @var AdditionalInfo
+ * @var int
*/
- protected $additional_info;
+ protected $campaign_id;
/**
- * @var TransactionDetails
+ * @var bool
*/
- protected $transaction_details;
+ protected $capture;
/**
- * @var PointOfInteraction
+ * @var string
*/
- protected $point_of_interaction;
+ protected $coupon_code;
/**
- * @var object
+ * @var string
*/
- protected $metadata;
+ protected $token;
/**
* @var string
@@ -145,8 +222,7 @@ class Payment extends AbstractEntity implements RequesterEntityInterface
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
$this->payer = new Payer($manager);
$this->additional_info = new AdditionalInfo($manager);
@@ -159,9 +235,8 @@ public function __construct($manager)
*
* @return void
*/
- public function setExcludedProperties()
- {
- $this->excluded_properties = ['session_id'];
+ public function setExcludedProperties(): void {
+ $this->excluded_properties = array('session_id');
}
/**
@@ -169,12 +244,11 @@ public function setExcludedProperties()
*
* @return array
*/
- public function getHeaders(): array
- {
- return [
- 'read' => [],
- 'save' => ['x-meli-session-id: ' . $this->session_id],
- ];
+ public function getHeaders(): array {
+ return array(
+ 'read' => array(),
+ 'save' => array('x-meli-session-id: ' . $this->session_id),
+ );
}
/**
@@ -182,8 +256,7 @@ public function getHeaders(): array
*
* @return array
*/
- public function getUris(): array
- {
+ public function getUris(): array {
return array(
'post' => '/v1/asgard/payments',
);
diff --git a/packages/sdk/src/Entity/Payment/PaymentV2.php b/packages/sdk/src/Entity/Payment/PaymentV2.php
new file mode 100644
index 000000000..132f50b73
--- /dev/null
+++ b/packages/sdk/src/Entity/Payment/PaymentV2.php
@@ -0,0 +1,16 @@
+ '/v2/asgard/payments',
+ );
+ }
+}
diff --git a/packages/sdk/src/Entity/Payment/Phone.php b/packages/sdk/src/Entity/Payment/Phone.php
index baab4f25d..a6f7821f2 100644
--- a/packages/sdk/src/Entity/Payment/Phone.php
+++ b/packages/sdk/src/Entity/Payment/Phone.php
@@ -8,13 +8,18 @@
* Class Phone
*
* @property string $number
+ * @property string $area_code
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class Phone extends AbstractEntity
-{
+class Phone extends AbstractEntity {
/**
* @var string
*/
protected $number;
+
+ /**
+ * @var string
+ */
+ protected $area_code;
}
diff --git a/packages/sdk/src/Entity/Payment/PointOfInteraction.php b/packages/sdk/src/Entity/Payment/PointOfInteraction.php
index d42d8e214..fa6c56410 100644
--- a/packages/sdk/src/Entity/Payment/PointOfInteraction.php
+++ b/packages/sdk/src/Entity/Payment/PointOfInteraction.php
@@ -3,18 +3,53 @@
namespace MercadoPago\PP\Sdk\Entity\Payment;
use MercadoPago\PP\Sdk\Common\AbstractEntity;
+use MercadoPago\PP\Sdk\Common\Manager;
/**
* Class PointOfInteraction
*
* @property string $type
+ * @property string $sub_type
+ * @property string $linked_to
+ * @property ApplicationData $application_data
+ * @property TransactionData $transaction_data
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class PointOfInteraction extends AbstractEntity
-{
+class PointOfInteraction extends AbstractEntity {
/**
* @var string
*/
protected $type;
+
+ /**
+ * @var string
+ */
+ protected $sub_type;
+
+ /**
+ * @var string
+ */
+ protected $linked_to;
+
+ /**
+ * @var ApplicationData
+ */
+ protected $application_data;
+
+ /**
+ * @var TransactionData
+ */
+ protected $transaction_data;
+
+ /**
+ * Payer constructor.
+ *
+ * @param Manager|null $manager
+ */
+ public function __construct($manager) {
+ parent::__construct($manager);
+ $this->application_data = new ApplicationData($manager);
+ $this->transaction_data = new TransactionData($manager);
+ }
}
diff --git a/packages/sdk/src/Entity/Payment/ReceiverAddress.php b/packages/sdk/src/Entity/Payment/ReceiverAddress.php
index dcf7ee3e9..8088e467e 100644
--- a/packages/sdk/src/Entity/Payment/ReceiverAddress.php
+++ b/packages/sdk/src/Entity/Payment/ReceiverAddress.php
@@ -8,15 +8,16 @@
* Class ReceiverAddress
*
* @property string $zip_code
- * @property string $state_name
- * @property string $city_name
* @property string $street_name
+ * @property string $city_name
+ * @property string $state_name
+ * @property string $street_number
+ * @property string $floor
* @property string $apartment
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class ReceiverAddress extends AbstractEntity
-{
+class ReceiverAddress extends AbstractEntity {
/**
* @var string
*/
@@ -25,7 +26,7 @@ class ReceiverAddress extends AbstractEntity
/**
* @var string
*/
- protected $state_name;
+ protected $street_name;
/**
* @var string
@@ -35,7 +36,17 @@ class ReceiverAddress extends AbstractEntity
/**
* @var string
*/
- protected $street_name;
+ protected $state_name;
+
+ /**
+ * @var string
+ */
+ protected $street_number;
+
+ /**
+ * @var string
+ */
+ protected $floor;
/**
* @var string
diff --git a/packages/sdk/src/Entity/Payment/Seller.php b/packages/sdk/src/Entity/Payment/Seller.php
new file mode 100644
index 000000000..9a147b849
--- /dev/null
+++ b/packages/sdk/src/Entity/Payment/Seller.php
@@ -0,0 +1,134 @@
+identification = new Identification($manager);
+ $this->phone = new Phone($manager);
+ $this->address = new AdditionalInfoAddress($manager);
+ }
+}
diff --git a/packages/sdk/src/Entity/Payment/Shipments.php b/packages/sdk/src/Entity/Payment/Shipments.php
index 388ace129..a3cd8b8d2 100644
--- a/packages/sdk/src/Entity/Payment/Shipments.php
+++ b/packages/sdk/src/Entity/Payment/Shipments.php
@@ -8,14 +8,55 @@
/**
* Class Shipments
*
- * @property ReceiverAddress $receiver_address
+ * @property string $delivery_promise
+ * @property string $drop_shipping
+ * @property string $local_pickup
+ * @property string $express_shipment
+ * @property string $safety
+ * @property boolean $withdrawn
+ * @property Tracking $tracking
+ * @property AdditionalInfoAddress $receiver_address
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class Shipments extends AbstractEntity
-{
+class Shipments extends AbstractEntity {
/**
- * @var ReceiverAddress
+ * @var string
+ */
+ protected $delivery_promise;
+
+ /**
+ * @var string
+ */
+ protected $drop_shipping;
+
+ /**
+ * @var string
+ */
+ protected $local_pickup;
+
+ /**
+ * @var string
+ */
+ protected $express_shipment;
+
+ /**
+ * @var string
+ */
+ protected $safety;
+
+ /**
+ * @var boolean
+ */
+ protected $withdrawn;
+
+ /**
+ * @var Tracking
+ */
+ protected $tracking;
+
+ /**
+ * @var AdditionalInfoAddress
*/
protected $receiver_address;
@@ -24,9 +65,9 @@ class Shipments extends AbstractEntity
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
- $this->receiver_address = new ReceiverAddress();
+ $this->tracking = new Tracking($manager);
+ $this->receiver_address = new AdditionalInfoAddress($manager);
}
}
diff --git a/packages/sdk/src/Entity/Payment/Tracking.php b/packages/sdk/src/Entity/Payment/Tracking.php
new file mode 100644
index 000000000..8eec4bcbe
--- /dev/null
+++ b/packages/sdk/src/Entity/Payment/Tracking.php
@@ -0,0 +1,25 @@
+bank_info = new BankInfo($manager);
+ }
+}
diff --git a/packages/sdk/src/Entity/Payment/TransactionDetails.php b/packages/sdk/src/Entity/Payment/TransactionDetails.php
index 8706faad6..29ae7b6ed 100644
--- a/packages/sdk/src/Entity/Payment/TransactionDetails.php
+++ b/packages/sdk/src/Entity/Payment/TransactionDetails.php
@@ -8,13 +8,24 @@
* Class TransactionDetails
*
* @property string $financial_institution
+ * @property string $bank_transfer_id
+ * @property string $transaction_id
*
* @package MercadoPago\PP\Sdk\Entity\Payment
*/
-class TransactionDetails extends AbstractEntity
-{
+class TransactionDetails extends AbstractEntity {
/**
* @var string
*/
protected $financial_institution;
+
+ /**
+ * @var string
+ */
+ protected $bank_transfer_id;
+
+ /**
+ * @var string
+ */
+ protected $transaction_id;
}
diff --git a/packages/sdk/src/Entity/Payment/TransactionInfo.php b/packages/sdk/src/Entity/Payment/TransactionInfo.php
new file mode 100644
index 000000000..0abf6d750
--- /dev/null
+++ b/packages/sdk/src/Entity/Payment/TransactionInfo.php
@@ -0,0 +1,37 @@
+manager);
+ $transactionInfo->setEntity($entity);
+ parent::addEntity($transactionInfo, $key);
+ }
+}
diff --git a/packages/sdk/src/Entity/Preference/Address.php b/packages/sdk/src/Entity/Preference/Address.php
index 0cf2e6d95..cbab35a68 100644
--- a/packages/sdk/src/Entity/Preference/Address.php
+++ b/packages/sdk/src/Entity/Preference/Address.php
@@ -8,23 +8,40 @@
* Class Address
*
* @property string $street_name
- * @property int $street_number
+ * @property string $street_number
+ * @property string $neighborhood
+ * @property string $city
+ * @property string $federal_unit
* @property string $zip_code
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class Address extends AbstractEntity
-{
+class Address extends AbstractEntity {
/**
* @var string
*/
protected $street_name;
/**
- * @var int
+ * @var string
*/
protected $street_number;
+ /**
+ * @var string
+ */
+ protected $neighborhood;
+
+ /**
+ * @var string
+ */
+ protected $city;
+
+ /**
+ * @var string
+ */
+ protected $federal_unit;
+
/**
* @var string
*/
diff --git a/packages/sdk/src/Entity/Preference/BackUrl.php b/packages/sdk/src/Entity/Preference/BackUrl.php
index 868e4c507..889db8edc 100644
--- a/packages/sdk/src/Entity/Preference/BackUrl.php
+++ b/packages/sdk/src/Entity/Preference/BackUrl.php
@@ -13,8 +13,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class BackUrl extends AbstractEntity
-{
+class BackUrl extends AbstractEntity {
/**
* @var string
*/
diff --git a/packages/sdk/src/Entity/Preference/DifferentialPricing.php b/packages/sdk/src/Entity/Preference/DifferentialPricing.php
index 854c053a9..0719be6be 100644
--- a/packages/sdk/src/Entity/Preference/DifferentialPricing.php
+++ b/packages/sdk/src/Entity/Preference/DifferentialPricing.php
@@ -11,8 +11,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class DifferentialPricing extends AbstractEntity
-{
+class DifferentialPricing extends AbstractEntity {
/**
* @var int
*/
diff --git a/packages/sdk/src/Entity/Preference/ExcludedPaymentMethod.php b/packages/sdk/src/Entity/Preference/ExcludedPaymentMethod.php
index 54e5945e5..0f50136c0 100644
--- a/packages/sdk/src/Entity/Preference/ExcludedPaymentMethod.php
+++ b/packages/sdk/src/Entity/Preference/ExcludedPaymentMethod.php
@@ -11,8 +11,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class ExcludedPaymentMethod extends AbstractEntity
-{
+class ExcludedPaymentMethod extends AbstractEntity {
/**
* @var string
*/
diff --git a/packages/sdk/src/Entity/Preference/ExcludedPaymentMethodList.php b/packages/sdk/src/Entity/Preference/ExcludedPaymentMethodList.php
index 863883604..69c4efc52 100644
--- a/packages/sdk/src/Entity/Preference/ExcludedPaymentMethodList.php
+++ b/packages/sdk/src/Entity/Preference/ExcludedPaymentMethodList.php
@@ -9,16 +9,14 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class ExcludedPaymentMethodList extends AbstractCollection
-{
+class ExcludedPaymentMethodList extends AbstractCollection {
/**
* Add entity to collection
*
* @param array $entity
* @param string|null $key
*/
- public function add(array $entity, string $key = null)
- {
+ public function add(array $entity, string $key = null): void {
$excludedPaymentMethod = new ExcludedPaymentMethod($this->manager);
$excludedPaymentMethod->setEntity($entity);
parent::addEntity($excludedPaymentMethod, $key);
diff --git a/packages/sdk/src/Entity/Preference/ExcludedPaymentType.php b/packages/sdk/src/Entity/Preference/ExcludedPaymentType.php
index 9dcf39683..ac1a63ace 100644
--- a/packages/sdk/src/Entity/Preference/ExcludedPaymentType.php
+++ b/packages/sdk/src/Entity/Preference/ExcludedPaymentType.php
@@ -11,8 +11,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class ExcludedPaymentType extends AbstractEntity
-{
+class ExcludedPaymentType extends AbstractEntity {
/**
* @var string
*/
diff --git a/packages/sdk/src/Entity/Preference/ExcludedPaymentTypeList.php b/packages/sdk/src/Entity/Preference/ExcludedPaymentTypeList.php
index 3aad404e4..2b1a2f7a4 100644
--- a/packages/sdk/src/Entity/Preference/ExcludedPaymentTypeList.php
+++ b/packages/sdk/src/Entity/Preference/ExcludedPaymentTypeList.php
@@ -9,16 +9,14 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class ExcludedPaymentTypeList extends AbstractCollection
-{
+class ExcludedPaymentTypeList extends AbstractCollection {
/**
* Add entity to collection
*
* @param array $entity
* @param string|null $key
*/
- public function add(array $entity, string $key = null)
- {
+ public function add(array $entity, string $key = null): void {
$excludedPaymentType = new ExcludedPaymentType($this->manager);
$excludedPaymentType->setEntity($entity);
parent::addEntity($excludedPaymentType, $key);
diff --git a/packages/sdk/src/Entity/Preference/FreeMethod.php b/packages/sdk/src/Entity/Preference/FreeMethod.php
index 6dbb8b895..d4fc0223f 100644
--- a/packages/sdk/src/Entity/Preference/FreeMethod.php
+++ b/packages/sdk/src/Entity/Preference/FreeMethod.php
@@ -11,8 +11,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class FreeMethod extends AbstractEntity
-{
+class FreeMethod extends AbstractEntity {
/**
* @var int
*/
diff --git a/packages/sdk/src/Entity/Preference/FreeMethodList.php b/packages/sdk/src/Entity/Preference/FreeMethodList.php
index 99d6fe751..def112549 100644
--- a/packages/sdk/src/Entity/Preference/FreeMethodList.php
+++ b/packages/sdk/src/Entity/Preference/FreeMethodList.php
@@ -9,16 +9,14 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class FreeMethodList extends AbstractCollection
-{
+class FreeMethodList extends AbstractCollection {
/**
* Add entity to collection
*
* @param array $entity
* @param string|null $key
*/
- public function add(array $entity, string $key = null)
- {
+ public function add(array $entity, string $key = null): void {
$freeMethod = new FreeMethod($this->manager);
$freeMethod->setEntity($entity);
parent::addEntity($freeMethod, $key);
diff --git a/packages/sdk/src/Entity/Preference/Item.php b/packages/sdk/src/Entity/Preference/Item.php
index ac8b0713e..191918c5f 100644
--- a/packages/sdk/src/Entity/Preference/Item.php
+++ b/packages/sdk/src/Entity/Preference/Item.php
@@ -7,28 +7,27 @@
/**
* Class Item
*
- * @property string $category_id
- * @property string $currency_id
- * @property string $description
* @property string $id
+ * @property string $title
+ * @property string $description
* @property string $picture_url
+ * @property string $category_id
* @property int $quantity
- * @property string $title
+ * @property string $currency_id
* @property float $unit_price
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class Item extends AbstractEntity
-{
+class Item extends AbstractEntity {
/**
* @var string
*/
- protected $category_id;
+ protected $id;
/**
* @var string
*/
- protected $currency_id;
+ protected $title;
/**
* @var string
@@ -38,12 +37,12 @@ class Item extends AbstractEntity
/**
* @var string
*/
- protected $id;
+ protected $picture_url;
/**
* @var string
*/
- protected $picture_url;
+ protected $category_id;
/**
* @var int
@@ -53,7 +52,7 @@ class Item extends AbstractEntity
/**
* @var string
*/
- protected $title;
+ protected $currency_id;
/**
* @var float
diff --git a/packages/sdk/src/Entity/Preference/ItemList.php b/packages/sdk/src/Entity/Preference/ItemList.php
index cb6a41ea7..648824bcf 100644
--- a/packages/sdk/src/Entity/Preference/ItemList.php
+++ b/packages/sdk/src/Entity/Preference/ItemList.php
@@ -9,16 +9,14 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class ItemList extends AbstractCollection
-{
+class ItemList extends AbstractCollection {
/**
* Add entity to collection
*
* @param array $entity
* @param string|null $key
*/
- public function add(array $entity, string $key = null)
- {
+ public function add(array $entity, string $key = null): void {
$item = new Item($this->manager);
$item->setEntity($entity);
parent::addEntity($item, $key);
diff --git a/packages/sdk/src/Entity/Preference/Payer.php b/packages/sdk/src/Entity/Preference/Payer.php
index e4841e407..fedcf2585 100644
--- a/packages/sdk/src/Entity/Preference/Payer.php
+++ b/packages/sdk/src/Entity/Preference/Payer.php
@@ -8,27 +8,35 @@
/**
* Class Payer
*
- * @property Address $address
- * @property string $date_created
+ * @property string $entity_type
+ * @property string $type
+ * @property string $id
* @property string $email
* @property PayerIdentification $identification
* @property string $name
- * @property Phone $phone
* @property string $surname
+ * @property string $operator_id
+ * @property Address $address
+ * @property Phone $phone
+ * @property string $date_created
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class Payer extends AbstractEntity
-{
+class Payer extends AbstractEntity {
/**
- * @var Address
+ * @var string
*/
- protected $address;
+ protected $entity_type;
/**
* @var string
*/
- protected $date_created;
+ protected $type;
+
+ /**
+ * @var string
+ */
+ protected $id;
/**
* @var string
@@ -45,6 +53,21 @@ class Payer extends AbstractEntity
*/
protected $name;
+ /**
+ * @var string
+ */
+ protected $surname;
+
+ /**
+ * @var string
+ */
+ protected $operator_id;
+
+ /**
+ * @var Address
+ */
+ protected $address;
+
/**
* @var Phone
*/
@@ -53,18 +76,17 @@ class Payer extends AbstractEntity
/**
* @var string
*/
- protected $surname;
+ protected $date_created;
/**
* Payer constructor.
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
- $this->address = new Address($manager);
+ $this->address = new Address($manager);
$this->identification = new PayerIdentification($manager);
- $this->phone = new Phone($manager);
+ $this->phone = new Phone($manager);
}
}
diff --git a/packages/sdk/src/Entity/Preference/PayerIdentification.php b/packages/sdk/src/Entity/Preference/PayerIdentification.php
index 19b63a2a0..bfb72f72e 100644
--- a/packages/sdk/src/Entity/Preference/PayerIdentification.php
+++ b/packages/sdk/src/Entity/Preference/PayerIdentification.php
@@ -7,20 +7,19 @@
/**
* Class PayerIdentification
*
- * @property string $number
* @property string $type
+ * @property string $number
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class PayerIdentification extends AbstractEntity
-{
+class PayerIdentification extends AbstractEntity {
/**
* @var string
*/
- protected $number;
+ protected $type;
/**
* @var string
*/
- protected $type;
+ protected $number;
}
diff --git a/packages/sdk/src/Entity/Preference/PaymentMethod.php b/packages/sdk/src/Entity/Preference/PaymentMethod.php
index 200ed4815..83d1d17dd 100644
--- a/packages/sdk/src/Entity/Preference/PaymentMethod.php
+++ b/packages/sdk/src/Entity/Preference/PaymentMethod.php
@@ -8,35 +8,34 @@
/**
* Class PaymentMethod
*
- * @property int $default_installments
- * @property string $default_payment_method_id
* @property ExcludedPaymentMethodList $excluded_payment_methods
* @property ExcludedPaymentTypeList $excluded_payment_types
+ * @property string $default_payment_method_id
+ * @property int $default_installments
* @property int $installments
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class PaymentMethod extends AbstractEntity
-{
+class PaymentMethod extends AbstractEntity {
/**
- * @var int
+ * @var ExcludedPaymentMethodList
*/
- protected $default_installments;
+ protected $excluded_payment_methods;
/**
- * @var string
+ * @var ExcludedPaymentTypeList
*/
- protected $default_payment_method_id;
+ protected $excluded_payment_types;
/**
- * @var ExcludedPaymentMethodList
+ * @var string
*/
- protected $excluded_payment_methods;
+ protected $default_payment_method_id;
/**
- * @var ExcludedPaymentTypeList
+ * @var int
*/
- protected $excluded_payment_types;
+ protected $default_installments;
/**
* @var int
@@ -48,8 +47,7 @@ class PaymentMethod extends AbstractEntity
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
$this->excluded_payment_methods = new ExcludedPaymentMethodList($manager);
$this->excluded_payment_types = new ExcludedPaymentTypeList($manager);
diff --git a/packages/sdk/src/Entity/Preference/Phone.php b/packages/sdk/src/Entity/Preference/Phone.php
index ba306369c..59167cb8c 100644
--- a/packages/sdk/src/Entity/Preference/Phone.php
+++ b/packages/sdk/src/Entity/Preference/Phone.php
@@ -12,8 +12,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class Phone extends AbstractEntity
-{
+class Phone extends AbstractEntity {
/**
* @var string
*/
diff --git a/packages/sdk/src/Entity/Preference/Preference.php b/packages/sdk/src/Entity/Preference/Preference.php
index ec819f12a..49ee90e2a 100644
--- a/packages/sdk/src/Entity/Preference/Preference.php
+++ b/packages/sdk/src/Entity/Preference/Preference.php
@@ -5,39 +5,39 @@
use MercadoPago\PP\Sdk\Common\AbstractEntity;
use MercadoPago\PP\Sdk\Common\Manager;
use MercadoPago\PP\Sdk\Interfaces\RequesterEntityInterface;
+use MercadoPago\PP\Sdk\Entity\Payment\AdditionalInfo;
/**
* Class Preference
*
- * @property string $additional_info
+ * @property AdditionalInfo $additional_info
* @property string $auto_return
- * @property BackUrl $back_urls
- * @property boolean $binary_mode
- * @property string $date_of_expiration
- * @property object $differential_pricing
+ * @property bool $binary_mode
* @property string $expiration_date_from
* @property string $expiration_date_to
- * @property boolean $expires
+ * @property bool $expires
* @property string $external_reference
- * @property ItemList $items
- * @property string $marketplace
- * @property float $marketplace_fee
- * @property object $metadata
* @property string $notification_url
- * @property Payer $payer
- * @property PaymentMethod $payment_methods
* @property string $purpose
+ * @property string $statement_descriptor
+ * @property ItemList $items
+ * @property PaymentMethod $payment_methods
+ * @property BackUrl $back_urls
+ * @property Payer $payer
* @property Shipment $shipments
+ * @property array $metadata
+ * @property string $date_of_expiration
+ * @property array $differential_pricing
+ * @property string $marketplace
+ * @property float $marketplace_fee
* @property string $sponsor_id
- * @property string $statement_descriptor
* @property TrackList $tracks
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class Preference extends AbstractEntity implements RequesterEntityInterface
-{
+class Preference extends AbstractEntity implements RequesterEntityInterface {
/**
- * @var string
+ * @var AdditionalInfo
*/
protected $additional_info;
@@ -47,44 +47,44 @@ class Preference extends AbstractEntity implements RequesterEntityInterface
protected $auto_return;
/**
- * @var BackUrl
+ * @var bool
*/
- protected $back_urls;
+ protected $binary_mode;
/**
- * @var boolean
+ * @var string
*/
- protected $binary_mode;
+ protected $expiration_date_from;
/**
* @var string
*/
- protected $date_of_expiration;
+ protected $expiration_date_to;
/**
- * @var object
+ * @var bool
*/
- protected $differential_pricing;
+ protected $expires;
/**
* @var string
*/
- protected $expiration_date_from;
+ protected $external_reference;
/**
* @var string
*/
- protected $expiration_date_to;
+ protected $notification_url;
/**
- * @var boolean
+ * @var string
*/
- protected $expires;
+ protected $purpose;
/**
* @var string
*/
- protected $external_reference;
+ protected $statement_descriptor;
/**
* @var ItemList
@@ -92,54 +92,54 @@ class Preference extends AbstractEntity implements RequesterEntityInterface
protected $items;
/**
- * @var string
+ * @var PaymentMethod
*/
- protected $marketplace;
+ protected $payment_methods;
/**
- * @var float
+ * @var BackUrl
*/
- protected $marketplace_fee;
+ protected $back_urls;
/**
- * @var object
+ * @var Payer
*/
- protected $metadata;
+ protected $payer;
/**
- * @var string
+ * @var Shipment
*/
- protected $notification_url;
+ protected $shipments;
/**
- * @var Payer
+ * @var array
*/
- protected $payer;
+ protected $metadata;
/**
- * @var PaymentMethod
+ * @var string
*/
- protected $payment_methods;
+ protected $date_of_expiration;
/**
- * @var string
+ * @var array
*/
- protected $purpose;
+ protected $differential_pricing;
/**
- * @var Shipment
+ * @var string
*/
- protected $shipments;
+ protected $marketplace;
/**
- * @var string
+ * @var float
*/
- protected $sponsor_id;
+ protected $marketplace_fee;
/**
* @var string
*/
- protected $statement_descriptor;
+ protected $sponsor_id;
/**
* @var TrackList
@@ -151,15 +151,15 @@ class Preference extends AbstractEntity implements RequesterEntityInterface
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
- $this->back_urls = new BackUrl($manager);
- $this->items = new ItemList($manager);
- $this->payer = new Payer($manager);
- $this->payment_methods = new PaymentMethod($manager);
- $this->shipments = new Shipment($manager);
- $this->tracks = new TrackList($manager);
+ $this->additional_info = new AdditionalInfo($manager);
+ $this->back_urls = new BackUrl($manager);
+ $this->items = new ItemList($manager);
+ $this->payer = new Payer($manager);
+ $this->payment_methods = new PaymentMethod($manager);
+ $this->shipments = new Shipment($manager);
+ $this->tracks = new TrackList($manager);
}
/**
@@ -167,9 +167,8 @@ public function __construct($manager)
*
* @return void
*/
- public function setExcludedProperties()
- {
- $this->excluded_properties = [];
+ public function setExcludedProperties(): void {
+ $this->excluded_properties = array();
}
/**
@@ -177,12 +176,11 @@ public function setExcludedProperties()
*
* @return array
*/
- public function getHeaders(): array
- {
- return [
- 'read' => [],
- 'save' => [],
- ];
+ public function getHeaders(): array {
+ return array(
+ 'read' => array(),
+ 'save' => array(),
+ );
}
/**
@@ -190,8 +188,7 @@ public function getHeaders(): array
*
* @return array
*/
- public function getUris(): array
- {
+ public function getUris(): array {
return array(
'post' => '/v1/asgard/preferences',
);
diff --git a/packages/sdk/src/Entity/Preference/ReceiverAddress.php b/packages/sdk/src/Entity/Preference/ReceiverAddress.php
index 3b6299bfa..43a53924c 100644
--- a/packages/sdk/src/Entity/Preference/ReceiverAddress.php
+++ b/packages/sdk/src/Entity/Preference/ReceiverAddress.php
@@ -7,32 +7,31 @@
/**
* Class ReceiverAddress
*
- * @property string $apartment
+ * @property string $zip_code
+ * @property string $street_name
* @property string $city_name
- * @property string $floor
* @property string $state_name
- * @property string $street_name
- * @property int $street_number
- * @property string $zip_code
+ * @property string $street_number
+ * @property string $floor
+ * @property string $apartment
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class ReceiverAddress extends AbstractEntity
-{
+class ReceiverAddress extends AbstractEntity {
/**
* @var string
*/
- protected $apartment;
+ protected $zip_code;
/**
* @var string
*/
- protected $city_name;
+ protected $street_name;
/**
* @var string
*/
- protected $floor;
+ protected $city_name;
/**
* @var string
@@ -42,15 +41,15 @@ class ReceiverAddress extends AbstractEntity
/**
* @var string
*/
- protected $street_name;
+ protected $street_number;
/**
- * @var int
+ * @var string
*/
- protected $street_number;
+ protected $floor;
/**
* @var string
*/
- protected $zip_code;
+ protected $apartment;
}
diff --git a/packages/sdk/src/Entity/Preference/Shipment.php b/packages/sdk/src/Entity/Preference/Shipment.php
index 1916297d3..eba3a355a 100644
--- a/packages/sdk/src/Entity/Preference/Shipment.php
+++ b/packages/sdk/src/Entity/Preference/Shipment.php
@@ -8,28 +8,32 @@
/**
* Class Shipment
*
+ * @property string $default_shipping_method
+ * @property ReceiverAddress $receiver_address
* @property float $cost
- * @property int $default_shipping_method
* @property string $dimensions
* @property FreeMethodList $free_methods
* @property boolean $free_shipping
* @property boolean $local_pickup
* @property string $mode
- * @property ReceiverAddress $receiver_address
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class Shipment extends AbstractEntity
-{
+class Shipment extends AbstractEntity {
/**
- * @var float
+ * @var string
*/
- protected $cost;
+ protected $default_shipping_method;
/**
- * @var int
+ * @var ReceiverAddress
*/
- protected $default_shipping_method;
+ protected $receiver_address;
+
+ /**
+ * @var float
+ */
+ protected $cost;
/**
* @var string
@@ -56,18 +60,12 @@ class Shipment extends AbstractEntity
*/
protected $mode;
- /**
- * @var ReceiverAddress
- */
- protected $receiver_address;
-
/**
* Shipment constructor.
*
* @param Manager|null $manager
*/
- public function __construct($manager)
- {
+ public function __construct($manager) {
parent::__construct($manager);
$this->free_methods = new FreeMethodList($manager);
$this->receiver_address = new ReceiverAddress($manager);
diff --git a/packages/sdk/src/Entity/Preference/Track.php b/packages/sdk/src/Entity/Preference/Track.php
index 34513d62b..8f2e2c3fc 100644
--- a/packages/sdk/src/Entity/Preference/Track.php
+++ b/packages/sdk/src/Entity/Preference/Track.php
@@ -12,8 +12,7 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class Track extends AbstractEntity
-{
+class Track extends AbstractEntity {
/**
* @var string
*/
diff --git a/packages/sdk/src/Entity/Preference/TrackList.php b/packages/sdk/src/Entity/Preference/TrackList.php
index 0a011bbd9..8725ae7e0 100644
--- a/packages/sdk/src/Entity/Preference/TrackList.php
+++ b/packages/sdk/src/Entity/Preference/TrackList.php
@@ -9,16 +9,14 @@
*
* @package MercadoPago\PP\Sdk\Entity\Preference
*/
-class TrackList extends AbstractCollection
-{
+class TrackList extends AbstractCollection {
/**
* Add entity to collection
*
* @param array $entity
* @param string|null $key
*/
- public function add(array $entity, string $key = null)
- {
+ public function add(array $entity, string $key = null): void {
$track = new Track($this->manager);
$track->setEntity($entity);
parent::addEntity($track, $key);
diff --git a/packages/sdk/src/HttpClient/HttpClient.php b/packages/sdk/src/HttpClient/HttpClient.php
index c189800ea..7ee5c8f0a 100644
--- a/packages/sdk/src/HttpClient/HttpClient.php
+++ b/packages/sdk/src/HttpClient/HttpClient.php
@@ -5,14 +5,14 @@
use MercadoPago\PP\Sdk\Common\AbstractEntity;
use MercadoPago\PP\Sdk\Common\AbstractCollection;
use MercadoPago\PP\Sdk\HttpClient\Requester\RequesterInterface;
+use Exception;
/**
* Class HttpClient
*
* @package MercadoPago\PP\Sdk\HttpClient
*/
-class HttpClient implements HttpClientInterface
-{
+class HttpClient implements HttpClientInterface {
/**
* Base Url
*
@@ -33,41 +33,28 @@ class HttpClient implements HttpClientInterface
* @param string $baseUrl
* @param RequesterInterface $requester
*/
- public function __construct(string $baseUrl, RequesterInterface $requester)
- {
+ public function __construct(string $baseUrl, RequesterInterface $requester) {
$this->baseUrl = $baseUrl;
$this->requester = $requester;
}
- public function get(string $uri, array $headers = []): Response
- {
+ public function get(string $uri, array $headers = array()): Response {
return $this->send('GET', $uri, $headers, null);
}
- public function put(string $uri, array $headers = [], $body = null): Response
- {
+ public function put(string $uri, array $headers = array(), $body = null): Response {
return $this->send('PUT', $uri, $headers, $body);
}
- public function post(string $uri, array $headers = [], $body = null): Response
- {
+ public function post(string $uri, array $headers = array(), $body = null): Response {
return $this->send('POST', $uri, $headers, $body);
}
- public function send(string $method, string $uri, array $headers = [], $body = null): Response
- {
- if (null !== $body && !is_string($body) &&
- !is_subclass_of($body, AbstractEntity::class) && !is_subclass_of($body, AbstractCollection::class)
+ public function send(string $method, string $uri, array $headers = array(), $body = null): Response {
+ if (null !== $body && ! is_string($body) &&
+ ! is_subclass_of($body, 'MercadoPago\PP\Sdk\Common\AbstractEntity') && ! is_subclass_of($body, 'MercadoPago\PP\Sdk\Common\AbstractCollection')
) {
- throw new \Exception(
- sprintf(
- '%s::send(): Argument #4 ($body) must be of type string|%s|%snull, %s given',
- self::class,
- AbstractEntity::class,
- AbstractCollection::class,
- gettype($body)
- )
- );
+ throw new Exception(sprintf('%s::send(): Argument #4 ($body) must be of type string|%s|%snull, %s given', self::class, 'MercadoPago\PP\Sdk\Common\AbstractEntity', 'MercadoPago\PP\Sdk\Common\AbstractCollection', gettype($body)));
}
return $this->sendRequest(
@@ -80,8 +67,7 @@ public function send(string $method, string $uri, array $headers = [], $body = n
*
* @return resource
*/
- private function createRequest(string $method, string $uri, array $headers = [], $body = null)
- {
+ private function createRequest(string $method, string $uri, array $headers = array(), $body = null) {
$url = $this->baseUrl . $uri;
return $this->requester->createRequest($method, $url, $headers, $body);
}
@@ -89,8 +75,7 @@ private function createRequest(string $method, string $uri, array $headers = [],
/**
* @param resource $request
*/
- public function sendRequest($request): Response
- {
+ public function sendRequest($request): Response {
return $this->requester->sendRequest($request);
}
}
diff --git a/packages/sdk/src/HttpClient/HttpClientInterface.php b/packages/sdk/src/HttpClient/HttpClientInterface.php
index ff56c6e9c..29458ac52 100644
--- a/packages/sdk/src/HttpClient/HttpClientInterface.php
+++ b/packages/sdk/src/HttpClient/HttpClientInterface.php
@@ -3,58 +3,58 @@
namespace MercadoPago\PP\Sdk\HttpClient;
use MercadoPago\PP\Sdk\Common\AbstractEntity;
+use Exception;
/**
* Interface HttpClientInterface
*
* @package MercadoPago\PP\Sdk\HttpClient
*/
-interface HttpClientInterface
-{
- /**
- * Sends a GET request.
- *
- * @param string $uri
- * @param array $headers
- * @return Response
- * @throws \Exception
- */
- public function get(string $uri, array $headers = []): Response;
+interface HttpClientInterface {
+ /**
+ * Sends a GET request.
+ *
+ * @param string $uri
+ * @param array $headers
+ * @return Response
+ * @throws Exception
+ */
+ public function get(string $uri, array $headers = array()): Response;
- /**
- * Sends a PUT request.
- *
- * @param string $uri
- * @param array $headers
- * @param string|AbstractEntity|null $body
- *
- * @return Response
- * @throws \Exception
- */
- public function put(string $uri, array $headers = [], $body = null): Response;
+ /**
+ * Sends a PUT request.
+ *
+ * @param string $uri
+ * @param array $headers
+ * @param string|AbstractEntity|null $body
+ *
+ * @return Response
+ * @throws Exception
+ */
+ public function put(string $uri, array $headers = array(), $body = null): Response;
- /**
- * Sends a POST request.
- *
- * @param string $uri
- * @param array $headers
- * @param string|AbstractEntity|null $body
- *
- * @return Response
- * @throws \Exception
- */
- public function post(string $uri, array $headers = [], $body = null): Response;
+ /**
+ * Sends a POST request.
+ *
+ * @param string $uri
+ * @param array $headers
+ * @param string|AbstractEntity|null $body
+ *
+ * @return Response
+ * @throws Exception
+ */
+ public function post(string $uri, array $headers = array(), $body = null): Response;
- /**
- * Sends a request with any HTTP method.
- *
- * @param string $method HTTP method to use
- * @param string $uri
- * @param array $headers
- * @param string|AbstractEntity|null $body
- *
- * @return Response
- * @throws \Exception
- */
- public function send(string $method, string $uri, array $headers = [], $body = null): Response;
+ /**
+ * Sends a request with any HTTP method.
+ *
+ * @param string $method HTTP method to use
+ * @param string $uri
+ * @param array $headers
+ * @param string|AbstractEntity|null $body
+ *
+ * @return Response
+ * @throws Exception
+ */
+ public function send(string $method, string $uri, array $headers = array(), $body = null): Response;
}
diff --git a/packages/sdk/src/HttpClient/Requester/CurlRequester.php b/packages/sdk/src/HttpClient/Requester/CurlRequester.php
index 90d36e430..db9fba245 100644
--- a/packages/sdk/src/HttpClient/Requester/CurlRequester.php
+++ b/packages/sdk/src/HttpClient/Requester/CurlRequester.php
@@ -5,24 +5,22 @@
use MercadoPago\PP\Sdk\Common\AbstractCollection;
use MercadoPago\PP\Sdk\Common\AbstractEntity;
use MercadoPago\PP\Sdk\HttpClient\Response;
+use Exception;
/**
* Class CurlRequester
*
* @package MercadoPago\PP\Sdk\HttpClient\Requester
*/
-class CurlRequester implements RequesterInterface
-{
+class CurlRequester implements RequesterInterface {
/**
* CurlRequester constructor.
*
- * @throws \Exception
+ * @throws Exception
*/
- public function __construct()
- {
- if (!extension_loaded('curl')) {
- throw new \Exception('cURL extension not found.' .
- 'You need to enable cURL in your php.ini or another configuration you have.');
+ public function __construct() {
+ if ( ! extension_loaded('curl')) {
+ throw new Exception('cURL extension not found.' . 'You need to enable cURL in your php.ini or another configuration you have.');
}
}
@@ -33,20 +31,19 @@ public function __construct()
* @param string|AbstractEntity|AbstractCollection|array|null $body
*
* @return resource
- * @throws \Exception
+ * @throws Exception
*/
- public function createRequest(string $method, string $uri, array $headers = [], $body = null)
- {
- $json_content = true;
- $form_content = false;
+ public function createRequest(string $method, string $uri, array $headers = array(), $body = null) {
+ $json_content = true;
+ $form_content = false;
$default_content_type = true;
if (isset($headers) && is_array($headers)) {
foreach ($headers as $h => $v) {
if ('content-type' === $h) {
$default_content_type = false;
- $json_content = 'application/json' === $v;
- $form_content = 'application/x-www-form-urlencoded' === $v;
+ $json_content = 'application/json' === $v;
+ $form_content = 'application/x-www-form-urlencoded' === $v;
break;
}
}
@@ -56,16 +53,16 @@ public function createRequest(string $method, string $uri, array $headers = [],
}
$connect = $this->curlInit();
- $this->setOption($connect, CURLOPT_USERAGENT, 'platform:v1-whitelabel,type:mp_sdk');
- $this->setOption($connect, CURLOPT_RETURNTRANSFER, true);
+ $this->setOption($connect, \CURLOPT_USERAGENT, 'platform:v1-whitelabel,type:mp_sdk');
+ $this->setOption($connect, \CURLOPT_RETURNTRANSFER, true);
// @TODO define CAINFO when implementing SDK
// $this->setOption($connect, CURLOPT_SSL_VERIFYPEER, true);
// $this->setOption( $connect, CURLOPT_CAINFO, $GLOBALS['LIB_LOCATION'] . '/cacert.pem' );
- $this->setOption($connect, CURLOPT_CUSTOMREQUEST, $method);
- $this->setOption($connect, CURLOPT_HTTPHEADER, $headers);
- $this->setOption($connect, CURLOPT_URL, $uri);
+ $this->setOption($connect, \CURLOPT_CUSTOMREQUEST, $method);
+ $this->setOption($connect, \CURLOPT_HTTPHEADER, $headers);
+ $this->setOption($connect, \CURLOPT_URL, $uri);
if (isset($body)) {
if ($json_content) {
@@ -76,14 +73,14 @@ public function createRequest(string $method, string $uri, array $headers = [],
}
if (function_exists('json_last_error')) {
$json_error = json_last_error();
- if (JSON_ERROR_NONE !== $json_error) {
- throw new \Exception("JSON Error [{$json_error}] - Data: " . $body);
+ if (\JSON_ERROR_NONE !== $json_error) {
+ throw new Exception("JSON Error [{$json_error}] - Data: " . $body);
}
}
} elseif ($form_content) {
$body = self::buildFormData($body);
}
- $this->setOption($connect, CURLOPT_POSTFIELDS, $body);
+ $this->setOption($connect, \CURLOPT_POSTFIELDS, $body);
}
return $connect;
@@ -92,18 +89,17 @@ public function createRequest(string $method, string $uri, array $headers = [],
/**
* @param resource $request
*
- * @throws \Exception
+ * @throws Exception
*/
- public function sendRequest($request): Response
- {
+ public function sendRequest($request): Response {
$response = new Response();
$api_result = $this->curlExec($request);
if ($this->curlErrno($request)) {
- throw new \Exception($this->curlError($request));
+ throw new Exception($this->curlError($request));
}
- $info = $this->curlGetInfo($request);
+ $info = $this->curlGetInfo($request);
$api_http_code = $info['http_code'];
// @TODO: call logging service when ready
@@ -125,12 +121,11 @@ public function sendRequest($request): Response
*
* @return string
*/
- public static function buildFormData(array $params): string
- {
+ public static function buildFormData(array $params): string {
if (function_exists('http_build_query')) {
return http_build_query($params, '', '&');
} else {
- $elements = [];
+ $elements = array();
foreach ($params as $name => $value) {
$elements[] = "{$name}=" . rawurldecode($value);
@@ -145,56 +140,49 @@ public static function buildFormData(array $params): string
*
* @return resource
*/
- protected function curlInit()
- {
+ protected function curlInit() {
return curl_init();
}
/**
* @codeCoverageIgnore
*/
- protected function curlClose($request)
- {
+ protected function curlClose($request): void {
curl_close($request);
}
/**
* @codeCoverageIgnore
*/
- protected function setOption($connect, $option, $value)
- {
+ protected function setOption($connect, $option, $value): void {
curl_setopt($connect, $option, $value);
}
/**
* @codeCoverageIgnore
*/
- protected function curlExec($request)
- {
+ protected function curlExec($request) {
return curl_exec($request);
}
/**
* @codeCoverageIgnore
*/
- protected function curlErrno($request): int
- {
+ protected function curlErrno($request): int {
return curl_errno($request);
}
/**
* @codeCoverageIgnore
*/
- protected function curlError($request): string
- {
+ protected function curlError($request): string {
return curl_error($request);
}
/**
* @codeCoverageIgnore
*/
- protected function curlGetInfo($request)
- {
+ protected function curlGetInfo($request) {
return curl_getinfo($request);
}
}
diff --git a/packages/sdk/src/HttpClient/Requester/RequesterInterface.php b/packages/sdk/src/HttpClient/Requester/RequesterInterface.php
index 2647bfefd..97f6a163a 100644
--- a/packages/sdk/src/HttpClient/Requester/RequesterInterface.php
+++ b/packages/sdk/src/HttpClient/Requester/RequesterInterface.php
@@ -11,14 +11,13 @@
*
* @package MercadoPago\PP\Sdk\HttpClient\Requester
*/
-interface RequesterInterface
-{
+interface RequesterInterface {
/**
* @param string|AbstractEntity|AbstractCollection|null $body
*
* @return resource
*/
- public function createRequest(string $method, string $uri, array $headers = [], $body = null);
+ public function createRequest(string $method, string $uri, array $headers = array(), $body = null);
/**
* @param resource $request
diff --git a/packages/sdk/src/HttpClient/Response.php b/packages/sdk/src/HttpClient/Response.php
index 516cedda7..0122a7e73 100644
--- a/packages/sdk/src/HttpClient/Response.php
+++ b/packages/sdk/src/HttpClient/Response.php
@@ -10,8 +10,7 @@
*
* @package MercadoPago\PP\Sdk\HttpClient
*/
-class Response
-{
+class Response {
/**
* Response status
*
@@ -29,8 +28,7 @@ class Response
/**
* Response constructor.
*/
- public function __construct()
- {
+ public function __construct() {
}
/**
@@ -38,8 +36,7 @@ public function __construct()
*
* @return int
**/
- public function getStatus(): int
- {
+ public function getStatus(): int {
return $this->status;
}
@@ -50,8 +47,7 @@ public function getStatus(): int
*
* @return void
**/
- public function setStatus(int $status)
- {
+ public function setStatus(int $status): void {
$this->status = $status;
}
@@ -60,8 +56,7 @@ public function setStatus(int $status)
*
* @return object|null
**/
- public function getData()
- {
+ public function getData() {
return $this->data;
}
@@ -72,8 +67,7 @@ public function getData()
*
* @return void
**/
- public function setData($data)
- {
+ public function setData($data): void {
$this->data = $data;
}
}
diff --git a/packages/sdk/src/Interfaces/EntityInterface.php b/packages/sdk/src/Interfaces/EntityInterface.php
index 2099fda98..ed2931de5 100644
--- a/packages/sdk/src/Interfaces/EntityInterface.php
+++ b/packages/sdk/src/Interfaces/EntityInterface.php
@@ -2,8 +2,7 @@
namespace MercadoPago\PP\Sdk\Interfaces;
-interface EntityInterface
-{
+interface EntityInterface {
/**
* @param string $name
*
@@ -60,5 +59,5 @@ public function jsonSerialize(): array;
*
* @return void
*/
- public function setExcludedProperties();
+ public function setExcludedProperties(): void;
}
diff --git a/packages/sdk/src/Interfaces/RequesterEntityInterface.php b/packages/sdk/src/Interfaces/RequesterEntityInterface.php
index ddb7ad073..69473301a 100644
--- a/packages/sdk/src/Interfaces/RequesterEntityInterface.php
+++ b/packages/sdk/src/Interfaces/RequesterEntityInterface.php
@@ -1,9 +1,9 @@
requester);
+ public function getEntityInstance(string $entityName, string $baseUrl) {
+ $client = new HttpClient($baseUrl, $this->requester);
$manager = new Manager($client, $this->config);
return new $entityName($manager);
}
@@ -66,24 +69,42 @@ public function getEntityInstance(string $entityName, string $baseUrl)
/**
* @return Preference
*/
- public function getPreferenceInstance()
- {
+ public function getPreferenceInstance() {
return $this->getEntityInstance('MercadoPago\PP\Sdk\Entity\Preference\Preference', Constants::BASEURL_MP);
}
/**
* @return Notification
*/
- public function getNotificationInstance()
- {
+ public function getNotificationInstance() {
return $this->getEntityInstance('MercadoPago\PP\Sdk\Entity\Notification\Notification', Constants::BASEURL_MP);
}
/**
* @return Payment
*/
- public function getPaymentInstance()
- {
+ public function getPaymentInstance() {
return $this->getEntityInstance('MercadoPago\PP\Sdk\Entity\Payment\Payment', Constants::BASEURL_MP);
}
+
+ /**
+ * @return PaymentV2
+ */
+ public function getPaymentV2Instance() {
+ return $this->getEntityInstance('MercadoPago\PP\Sdk\Entity\Payment\PaymentV2', Constants::BASEURL_MP);
+ }
+
+ /**
+ * @return Multipayment
+ */
+ public function getMultipaymentInstance() {
+ return $this->getEntityInstance('MercadoPago\PP\Sdk\Entity\Payment\Multipayment', Constants::BASEURL_MP);
+ }
+
+ /**
+ * @return MultipaymentV2
+ */
+ public function getMultipaymentV2Instance() {
+ return $this->getEntityInstance('MercadoPago\PP\Sdk\Entity\Payment\MultipaymentV2', Constants::BASEURL_MP);
+ }
}
diff --git a/packages/sdk/vendor/autoload.php b/packages/sdk/vendor/autoload.php
index 44b829dac..d7d5313b1 100644
--- a/packages/sdk/vendor/autoload.php
+++ b/packages/sdk/vendor/autoload.php
@@ -2,24 +2,24 @@
// autoload.php @generated by Composer
-if (PHP_VERSION_ID < 50600) {
- if (!headers_sent()) {
+if (\PHP_VERSION_ID < 50600) {
+ if ( ! headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
- $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
- if (!ini_get('display_errors')) {
- if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
- fwrite(STDERR, $err);
- } elseif (!headers_sent()) {
+ $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running ' . \PHP_VERSION . ', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.' . \PHP_EOL;
+ if ( ! ini_get('display_errors')) {
+ if (\PHP_SAPI === 'cli' || \PHP_SAPI === 'phpdbg') {
+ fwrite(\STDERR, $err);
+ } elseif ( ! headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
- E_USER_ERROR
+ \E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';
-return ComposerAutoloaderInit7df991cb6c45ae6eb5b10f00fabea309::getLoader();
+return ComposerAutoloaderInit9311624e15b6e009950b2fbe89edbcce::getLoader();
diff --git a/packages/sdk/vendor/composer/ClassLoader.php b/packages/sdk/vendor/composer/ClassLoader.php
index 7824d8f7e..d33f3be1b 100644
--- a/packages/sdk/vendor/composer/ClassLoader.php
+++ b/packages/sdk/vendor/composer/ClassLoader.php
@@ -11,6 +11,8 @@
*/
namespace Composer\Autoload;
+use InvalidArgumentException;
+use Closure;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
@@ -40,9 +42,8 @@
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
-class ClassLoader
-{
- /** @var \Closure(string):void */
+class ClassLoader {
+ /** @var Closure(string):void */
private static $includeFile;
/** @var string|null */
@@ -53,10 +54,12 @@ class ClassLoader
* @var array>
*/
private $prefixLengthsPsr4 = array();
+
/**
* @var array>
*/
private $prefixDirsPsr4 = array();
+
/**
* @var list
*/
@@ -71,6 +74,7 @@ class ClassLoader
* @var array>>
*/
private $prefixesPsr0 = array();
+
/**
* @var list
*/
@@ -103,8 +107,7 @@ class ClassLoader
/**
* @param string|null $vendorDir
*/
- public function __construct($vendorDir = null)
- {
+ public function __construct($vendorDir = null) {
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
@@ -112,9 +115,8 @@ public function __construct($vendorDir = null)
/**
* @return array>
*/
- public function getPrefixes()
- {
- if (!empty($this->prefixesPsr0)) {
+ public function getPrefixes() {
+ if ( ! empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
@@ -124,32 +126,28 @@ public function getPrefixes()
/**
* @return array>
*/
- public function getPrefixesPsr4()
- {
+ public function getPrefixesPsr4() {
return $this->prefixDirsPsr4;
}
/**
* @return list
*/
- public function getFallbackDirs()
- {
+ public function getFallbackDirs() {
return $this->fallbackDirsPsr0;
}
/**
* @return list
*/
- public function getFallbackDirsPsr4()
- {
+ public function getFallbackDirsPsr4() {
return $this->fallbackDirsPsr4;
}
/**
* @return array Array of classname => path
*/
- public function getClassMap()
- {
+ public function getClassMap() {
return $this->classMap;
}
@@ -158,8 +156,7 @@ public function getClassMap()
*
* @return void
*/
- public function addClassMap(array $classMap)
- {
+ public function addClassMap(array $classMap): void {
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
@@ -177,10 +174,9 @@ public function addClassMap(array $classMap)
*
* @return void
*/
- public function add($prefix, $paths, $prepend = false)
- {
+ public function add($prefix, $paths, $prepend = false): void {
$paths = (array) $paths;
- if (!$prefix) {
+ if ( ! $prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
$paths,
@@ -197,7 +193,7 @@ public function add($prefix, $paths, $prepend = false)
}
$first = $prefix[0];
- if (!isset($this->prefixesPsr0[$first][$prefix])) {
+ if ( ! isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths;
return;
@@ -223,14 +219,13 @@ public function add($prefix, $paths, $prepend = false)
* @param list|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
*
* @return void
*/
- public function addPsr4($prefix, $paths, $prepend = false)
- {
+ public function addPsr4($prefix, $paths, $prepend = false): void {
$paths = (array) $paths;
- if (!$prefix) {
+ if ( ! $prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
@@ -243,11 +238,11 @@ public function addPsr4($prefix, $paths, $prepend = false)
$paths
);
}
- } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+ } elseif ( ! isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ throw new InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths;
@@ -275,9 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false)
*
* @return void
*/
- public function set($prefix, $paths)
- {
- if (!$prefix) {
+ public function set($prefix, $paths): void {
+ if ( ! $prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
@@ -291,18 +285,17 @@ public function set($prefix, $paths)
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list|string $paths The PSR-4 base directories
*
- * @throws \InvalidArgumentException
+ * @throws InvalidArgumentException
*
* @return void
*/
- public function setPsr4($prefix, $paths)
- {
- if (!$prefix) {
+ public function setPsr4($prefix, $paths): void {
+ if ( ! $prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ throw new InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
@@ -316,8 +309,7 @@ public function setPsr4($prefix, $paths)
*
* @return void
*/
- public function setUseIncludePath($useIncludePath)
- {
+ public function setUseIncludePath($useIncludePath): void {
$this->useIncludePath = $useIncludePath;
}
@@ -327,8 +319,7 @@ public function setUseIncludePath($useIncludePath)
*
* @return bool
*/
- public function getUseIncludePath()
- {
+ public function getUseIncludePath() {
return $this->useIncludePath;
}
@@ -340,8 +331,7 @@ public function getUseIncludePath()
*
* @return void
*/
- public function setClassMapAuthoritative($classMapAuthoritative)
- {
+ public function setClassMapAuthoritative($classMapAuthoritative): void {
$this->classMapAuthoritative = $classMapAuthoritative;
}
@@ -350,8 +340,7 @@ public function setClassMapAuthoritative($classMapAuthoritative)
*
* @return bool
*/
- public function isClassMapAuthoritative()
- {
+ public function isClassMapAuthoritative() {
return $this->classMapAuthoritative;
}
@@ -362,9 +351,8 @@ public function isClassMapAuthoritative()
*
* @return void
*/
- public function setApcuPrefix($apcuPrefix)
- {
- $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
+ public function setApcuPrefix($apcuPrefix): void {
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), \FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
@@ -372,8 +360,7 @@ public function setApcuPrefix($apcuPrefix)
*
* @return string|null
*/
- public function getApcuPrefix()
- {
+ public function getApcuPrefix() {
return $this->apcuPrefix;
}
@@ -384,8 +371,7 @@ public function getApcuPrefix()
*
* @return void
*/
- public function register($prepend = false)
- {
+ public function register($prepend = false): void {
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
@@ -405,8 +391,7 @@ public function register($prepend = false)
*
* @return void
*/
- public function unregister()
- {
+ public function unregister(): void {
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
@@ -420,8 +405,7 @@ public function unregister()
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
- public function loadClass($class)
- {
+ public function loadClass($class) {
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
@@ -439,8 +423,7 @@ public function loadClass($class)
*
* @return string|false The path if found, false otherwise
*/
- public function findFile($class)
- {
+ public function findFile($class) {
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
@@ -449,7 +432,7 @@ public function findFile($class)
return false;
}
if (null !== $this->apcuPrefix) {
- $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+ $file = apcu_fetch($this->apcuPrefix . $class, $hit);
if ($hit) {
return $file;
}
@@ -463,7 +446,7 @@ public function findFile($class)
}
if (null !== $this->apcuPrefix) {
- apcu_add($this->apcuPrefix.$class, $file);
+ apcu_add($this->apcuPrefix . $class, $file);
}
if (false === $file) {
@@ -479,8 +462,7 @@ public function findFile($class)
*
* @return array
*/
- public static function getRegisteredLoaders()
- {
+ public static function getRegisteredLoaders() {
return self::$registeredLoaders;
}
@@ -489,10 +471,9 @@ public static function getRegisteredLoaders()
* @param string $ext
* @return string|false
*/
- private function findFileWithExtension($class, $ext)
- {
+ private function findFileWithExtension($class, $ext) {
// PSR-4 lookup
- $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+ $logicalPathPsr4 = strtr($class, '\\', \DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
@@ -501,7 +482,7 @@ private function findFileWithExtension($class, $ext)
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
- $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ $pathEnd = \DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
@@ -513,7 +494,7 @@ private function findFileWithExtension($class, $ext)
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+ if (file_exists($file = $dir . \DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
@@ -522,17 +503,17 @@ private function findFileWithExtension($class, $ext)
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
- . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', \DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
- $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+ $logicalPathPsr0 = strtr($class, '_', \DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ if (file_exists($file = $dir . \DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
@@ -542,7 +523,7 @@ private function findFileWithExtension($class, $ext)
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ if (file_exists($file = $dir . \DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
@@ -558,9 +539,8 @@ private function findFileWithExtension($class, $ext)
/**
* @return void
*/
- private static function initializeIncludeClosure()
- {
- if (self::$includeFile !== null) {
+ private static function initializeIncludeClosure(): void {
+ if (null !== self::$includeFile) {
return;
}
@@ -572,7 +552,7 @@ private static function initializeIncludeClosure()
* @param string $file
* @return void
*/
- self::$includeFile = \Closure::bind(static function($file) {
+ self::$includeFile = Closure::bind(static function($file): void {
include $file;
}, null, null);
}
diff --git a/packages/sdk/vendor/composer/InstalledVersions.php b/packages/sdk/vendor/composer/InstalledVersions.php
new file mode 100644
index 000000000..859253b3f
--- /dev/null
+++ b/packages/sdk/vendor/composer/InstalledVersions.php
@@ -0,0 +1,345 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer;
+
+use Composer\Autoload\ClassLoader;
+use Composer\Semver\VersionParser;
+use OutOfBoundsException;
+
+/**
+ * This class is copied in every Composer installed project and available to all
+ *
+ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions
+ *
+ * To require its presence, you can require `composer-runtime-api ^2.0`
+ *
+ * @final
+ */
+class InstalledVersions {
+ /**
+ * @var mixed[]|null
+ * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null
+ */
+ private static $installed;
+
+ /**
+ * @var bool|null
+ */
+ private static $canGetVendors;
+
+ /**
+ * @var array[]
+ * @psalm-var array}>
+ */
+ private static $installedByVendor = array();
+
+ /**
+ * Returns a list of all package names which are present, either by being installed, replaced or provided
+ *
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackages() {
+ $packages = array();
+ foreach (self::getInstalled() as $installed) {
+ $packages[] = array_keys($installed['versions']);
+ }
+
+ if (1 === \count($packages)) {
+ return $packages[0];
+ }
+
+ return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
+ }
+
+ /**
+ * Returns a list of all package names with a specific type e.g. 'library'
+ *
+ * @param string $type
+ * @return string[]
+ * @psalm-return list
+ */
+ public static function getInstalledPackagesByType($type) {
+ $packagesByType = array();
+
+ foreach (self::getInstalled() as $installed) {
+ foreach ($installed['versions'] as $name => $package) {
+ if (isset($package['type']) && $package['type'] === $type) {
+ $packagesByType[] = $name;
+ }
+ }
+ }
+
+ return $packagesByType;
+ }
+
+ /**
+ * Checks whether the given package is installed
+ *
+ * This also returns true if the package name is provided or replaced by another package
+ *
+ * @param string $packageName
+ * @param bool $includeDevRequirements
+ * @return bool
+ */
+ public static function isInstalled($packageName, $includeDevRequirements = true) {
+ foreach (self::getInstalled() as $installed) {
+ if (isset($installed['versions'][$packageName])) {
+ return $includeDevRequirements || ! isset($installed['versions'][$packageName]['dev_requirement']) || false === $installed['versions'][$packageName]['dev_requirement'];
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks whether the given package satisfies a version constraint
+ *
+ * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
+ *
+ * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
+ *
+ * @param VersionParser $parser Install composer/semver to have access to this class and functionality
+ * @param string $packageName
+ * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
+ * @return bool
+ */
+ public static function satisfies(VersionParser $parser, $packageName, $constraint) {
+ $constraint = $parser->parseConstraints((string) $constraint);
+ $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
+
+ return $provided->matches($constraint);
+ }
+
+ /**
+ * Returns a version constraint representing all the range(s) which are installed for a given package
+ *
+ * It is easier to use this via isInstalled() with the $constraint argument if you need to check
+ * whether a given version of a package is installed, and not just whether it exists
+ *
+ * @param string $packageName
+ * @return string Version constraint usable with composer/semver
+ */
+ public static function getVersionRanges($packageName) {
+ foreach (self::getInstalled() as $installed) {
+ if ( ! isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ $ranges = array();
+ if (isset($installed['versions'][$packageName]['pretty_version'])) {
+ $ranges[] = $installed['versions'][$packageName]['pretty_version'];
+ }
+ if (array_key_exists('aliases', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
+ }
+ if (array_key_exists('replaced', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
+ }
+ if (array_key_exists('provided', $installed['versions'][$packageName])) {
+ $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
+ }
+
+ return implode(' || ', $ranges);
+ }
+
+ throw new OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getVersion($packageName) {
+ foreach (self::getInstalled() as $installed) {
+ if ( ! isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if ( ! isset($installed['versions'][$packageName]['version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['version'];
+ }
+
+ throw new OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
+ */
+ public static function getPrettyVersion($packageName) {
+ foreach (self::getInstalled() as $installed) {
+ if ( ! isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if ( ! isset($installed['versions'][$packageName]['pretty_version'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['pretty_version'];
+ }
+
+ throw new OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
+ */
+ public static function getReference($packageName) {
+ foreach (self::getInstalled() as $installed) {
+ if ( ! isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ if ( ! isset($installed['versions'][$packageName]['reference'])) {
+ return null;
+ }
+
+ return $installed['versions'][$packageName]['reference'];
+ }
+
+ throw new OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @param string $packageName
+ * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
+ */
+ public static function getInstallPath($packageName) {
+ foreach (self::getInstalled() as $installed) {
+ if ( ! isset($installed['versions'][$packageName])) {
+ continue;
+ }
+
+ return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
+ }
+
+ throw new OutOfBoundsException('Package "' . $packageName . '" is not installed');
+ }
+
+ /**
+ * @return array
+ * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
+ */
+ public static function getRootPackage() {
+ $installed = self::getInstalled();
+
+ return $installed[0]['root'];
+ }
+
+ /**
+ * Returns the raw installed.php data for custom implementations
+ *
+ * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
+ * @return array[]
+ * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}
+ */
+ public static function getRawData() {
+ @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', \E_USER_DEPRECATED);
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ self::$installed = include __DIR__ . '/installed.php';
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ return self::$installed;
+ }
+
+ /**
+ * Returns the raw data of all installed.php which are currently loaded for custom implementations
+ *
+ * @return array[]
+ * @psalm-return list}>
+ */
+ public static function getAllRawData() {
+ return self::getInstalled();
+ }
+
+ /**
+ * Lets you reload the static array from another file
+ *
+ * This is only useful for complex integrations in which a project needs to use
+ * this class but then also needs to execute another project's autoloader in process,
+ * and wants to ensure both projects have access to their version of installed.php.
+ *
+ * A typical case would be PHPUnit, where it would need to make sure it reads all
+ * the data it needs from this class, then call reload() with
+ * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
+ * the project in which it runs can then also use this class safely, without
+ * interference between PHPUnit's dependencies and the project's dependencies.
+ *
+ * @param array[] $data A vendor/composer/installed.php data set
+ * @return void
+ *
+ * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data
+ */
+ public static function reload($data): void {
+ self::$installed = $data;
+ self::$installedByVendor = array();
+ }
+
+ /**
+ * @return array[]
+ * @psalm-return list}>
+ */
+ private static function getInstalled() {
+ if (null === self::$canGetVendors) {
+ self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
+ }
+
+ $installed = array();
+
+ if (self::$canGetVendors) {
+ foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
+ if (isset(self::$installedByVendor[$vendorDir])) {
+ $installed[] = self::$installedByVendor[$vendorDir];
+ } elseif (is_file($vendorDir . '/composer/installed.php')) {
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require $vendorDir . '/composer/installed.php';
+ $installed[] = self::$installedByVendor[$vendorDir] = $required;
+ if (null === self::$installed && strtr($vendorDir . '/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
+ self::$installed = $installed[count($installed) - 1];
+ }
+ }
+ }
+ }
+
+ if (null === self::$installed) {
+ // only require the installed.php file if this file is loaded from its dumped location,
+ // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
+ if (substr(__DIR__, -8, 1) !== 'C') {
+ /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */
+ $required = require __DIR__ . '/installed.php';
+ self::$installed = $required;
+ } else {
+ self::$installed = array();
+ }
+ }
+
+ if (array() !== self::$installed) {
+ $installed[] = self::$installed;
+ }
+
+ return $installed;
+ }
+}
diff --git a/packages/sdk/vendor/composer/autoload_classmap.php b/packages/sdk/vendor/composer/autoload_classmap.php
index b31e5fc9d..0671cc9cb 100644
--- a/packages/sdk/vendor/composer/autoload_classmap.php
+++ b/packages/sdk/vendor/composer/autoload_classmap.php
@@ -18,20 +18,32 @@
'MercadoPago\\PP\\Sdk\\Entity\\Notification\\PaymentMethodInfo' => $baseDir . '/src/Entity/Notification/PaymentMethodInfo.php',
'MercadoPago\\PP\\Sdk\\Entity\\Notification\\Refund' => $baseDir . '/src/Entity/Notification/Refund.php',
'MercadoPago\\PP\\Sdk\\Entity\\Notification\\RefundList' => $baseDir . '/src/Entity/Notification/RefundList.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Notification\\RefundNotifying' => $baseDir . '/src/Entity/Notification/RefundNotifying.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Notification\\RefundNotifyingList' => $baseDir . '/src/Entity/Notification/RefundNotifyingList.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\AdditionalInfo' => $baseDir . '/src/Entity/Payment/AdditionalInfo.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\AdditionalInfoAddress' => $baseDir . '/src/Entity/Payment/AdditionalInfoAddress.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\AdditionalInfoPayer' => $baseDir . '/src/Entity/Payment/AdditionalInfoPayer.php',
- 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\AdditionalInfoPayerAddress' => $baseDir . '/src/Entity/Payment/AdditionalInfoPayerAddress.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Address' => $baseDir . '/src/Entity/Payment/Address.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\ApplicationData' => $baseDir . '/src/Entity/Payment/ApplicationData.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\BankInfo' => $baseDir . '/src/Entity/Payment/BankInfo.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Identification' => $baseDir . '/src/Entity/Payment/Identification.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Item' => $baseDir . '/src/Entity/Payment/Item.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\ItemList' => $baseDir . '/src/Entity/Payment/ItemList.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Multipayment' => $baseDir . '/src/Entity/Payment/Multipayment.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\MultipaymentV2' => $baseDir . '/src/Entity/Payment/MultipaymentV2.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Payer' => $baseDir . '/src/Entity/Payment/Payer.php',
- 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\PayerIdentification' => $baseDir . '/src/Entity/Payment/PayerIdentification.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Payment' => $baseDir . '/src/Entity/Payment/Payment.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\PaymentV2' => $baseDir . '/src/Entity/Payment/PaymentV2.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Phone' => $baseDir . '/src/Entity/Payment/Phone.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\PointOfInteraction' => $baseDir . '/src/Entity/Payment/PointOfInteraction.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\ReceiverAddress' => $baseDir . '/src/Entity/Payment/ReceiverAddress.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Seller' => $baseDir . '/src/Entity/Payment/Seller.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Shipments' => $baseDir . '/src/Entity/Payment/Shipments.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Tracking' => $baseDir . '/src/Entity/Payment/Tracking.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\TransactionData' => $baseDir . '/src/Entity/Payment/TransactionData.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\TransactionDetails' => $baseDir . '/src/Entity/Payment/TransactionDetails.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\TransactionInfo' => $baseDir . '/src/Entity/Payment/TransactionInfo.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\TransactionInfoList' => $baseDir . '/src/Entity/Payment/TransactionInfoList.php',
'MercadoPago\\PP\\Sdk\\Entity\\Preference\\Address' => $baseDir . '/src/Entity/Preference/Address.php',
'MercadoPago\\PP\\Sdk\\Entity\\Preference\\BackUrl' => $baseDir . '/src/Entity/Preference/BackUrl.php',
'MercadoPago\\PP\\Sdk\\Entity\\Preference\\DifferentialPricing' => $baseDir . '/src/Entity/Preference/DifferentialPricing.php',
diff --git a/packages/sdk/vendor/composer/autoload_real.php b/packages/sdk/vendor/composer/autoload_real.php
index a580f507d..2f768594f 100644
--- a/packages/sdk/vendor/composer/autoload_real.php
+++ b/packages/sdk/vendor/composer/autoload_real.php
@@ -2,12 +2,10 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit7df991cb6c45ae6eb5b10f00fabea309
-{
+class ComposerAutoloaderInit9311624e15b6e009950b2fbe89edbcce {
private static $loader;
- public static function loadClassLoader($class)
- {
+ public static function loadClassLoader($class): void {
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
@@ -16,20 +14,19 @@ public static function loadClassLoader($class)
/**
* @return \Composer\Autoload\ClassLoader
*/
- public static function getLoader()
- {
+ public static function getLoader() {
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
- spl_autoload_register(array('ComposerAutoloaderInit7df991cb6c45ae6eb5b10f00fabea309', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInit9311624e15b6e009950b2fbe89edbcce', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
- spl_autoload_unregister(array('ComposerAutoloaderInit7df991cb6c45ae6eb5b10f00fabea309', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInit9311624e15b6e009950b2fbe89edbcce', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
- call_user_func(\Composer\Autoload\ComposerStaticInit7df991cb6c45ae6eb5b10f00fabea309::getInitializer($loader));
+ call_user_func(\Composer\Autoload\ComposerStaticInit9311624e15b6e009950b2fbe89edbcce::getInitializer($loader));
$loader->register(true);
diff --git a/packages/sdk/vendor/composer/autoload_static.php b/packages/sdk/vendor/composer/autoload_static.php
index db9c96600..cc1d00f87 100644
--- a/packages/sdk/vendor/composer/autoload_static.php
+++ b/packages/sdk/vendor/composer/autoload_static.php
@@ -3,23 +3,21 @@
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
+use Closure;
-class ComposerStaticInit7df991cb6c45ae6eb5b10f00fabea309
-{
+class ComposerStaticInit9311624e15b6e009950b2fbe89edbcce {
public static $prefixLengthsPsr4 = array (
'M' =>
array (
'MercadoPago\\PP\\Sdk\\' => 19,
),
);
-
public static $prefixDirsPsr4 = array (
'MercadoPago\\PP\\Sdk\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
);
-
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'MercadoPago\\PP\\Sdk\\Common\\AbstractCollection' => __DIR__ . '/../..' . '/src/Common/AbstractCollection.php',
@@ -33,20 +31,32 @@ class ComposerStaticInit7df991cb6c45ae6eb5b10f00fabea309
'MercadoPago\\PP\\Sdk\\Entity\\Notification\\PaymentMethodInfo' => __DIR__ . '/../..' . '/src/Entity/Notification/PaymentMethodInfo.php',
'MercadoPago\\PP\\Sdk\\Entity\\Notification\\Refund' => __DIR__ . '/../..' . '/src/Entity/Notification/Refund.php',
'MercadoPago\\PP\\Sdk\\Entity\\Notification\\RefundList' => __DIR__ . '/../..' . '/src/Entity/Notification/RefundList.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Notification\\RefundNotifying' => __DIR__ . '/../..' . '/src/Entity/Notification/RefundNotifying.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Notification\\RefundNotifyingList' => __DIR__ . '/../..' . '/src/Entity/Notification/RefundNotifyingList.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\AdditionalInfo' => __DIR__ . '/../..' . '/src/Entity/Payment/AdditionalInfo.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\AdditionalInfoAddress' => __DIR__ . '/../..' . '/src/Entity/Payment/AdditionalInfoAddress.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\AdditionalInfoPayer' => __DIR__ . '/../..' . '/src/Entity/Payment/AdditionalInfoPayer.php',
- 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\AdditionalInfoPayerAddress' => __DIR__ . '/../..' . '/src/Entity/Payment/AdditionalInfoPayerAddress.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Address' => __DIR__ . '/../..' . '/src/Entity/Payment/Address.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\ApplicationData' => __DIR__ . '/../..' . '/src/Entity/Payment/ApplicationData.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\BankInfo' => __DIR__ . '/../..' . '/src/Entity/Payment/BankInfo.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Identification' => __DIR__ . '/../..' . '/src/Entity/Payment/Identification.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Item' => __DIR__ . '/../..' . '/src/Entity/Payment/Item.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\ItemList' => __DIR__ . '/../..' . '/src/Entity/Payment/ItemList.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Multipayment' => __DIR__ . '/../..' . '/src/Entity/Payment/Multipayment.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\MultipaymentV2' => __DIR__ . '/../..' . '/src/Entity/Payment/MultipaymentV2.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Payer' => __DIR__ . '/../..' . '/src/Entity/Payment/Payer.php',
- 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\PayerIdentification' => __DIR__ . '/../..' . '/src/Entity/Payment/PayerIdentification.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Payment' => __DIR__ . '/../..' . '/src/Entity/Payment/Payment.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\PaymentV2' => __DIR__ . '/../..' . '/src/Entity/Payment/PaymentV2.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Phone' => __DIR__ . '/../..' . '/src/Entity/Payment/Phone.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\PointOfInteraction' => __DIR__ . '/../..' . '/src/Entity/Payment/PointOfInteraction.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\ReceiverAddress' => __DIR__ . '/../..' . '/src/Entity/Payment/ReceiverAddress.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Seller' => __DIR__ . '/../..' . '/src/Entity/Payment/Seller.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Shipments' => __DIR__ . '/../..' . '/src/Entity/Payment/Shipments.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\Tracking' => __DIR__ . '/../..' . '/src/Entity/Payment/Tracking.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\TransactionData' => __DIR__ . '/../..' . '/src/Entity/Payment/TransactionData.php',
'MercadoPago\\PP\\Sdk\\Entity\\Payment\\TransactionDetails' => __DIR__ . '/../..' . '/src/Entity/Payment/TransactionDetails.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\TransactionInfo' => __DIR__ . '/../..' . '/src/Entity/Payment/TransactionInfo.php',
+ 'MercadoPago\\PP\\Sdk\\Entity\\Payment\\TransactionInfoList' => __DIR__ . '/../..' . '/src/Entity/Payment/TransactionInfoList.php',
'MercadoPago\\PP\\Sdk\\Entity\\Preference\\Address' => __DIR__ . '/../..' . '/src/Entity/Preference/Address.php',
'MercadoPago\\PP\\Sdk\\Entity\\Preference\\BackUrl' => __DIR__ . '/../..' . '/src/Entity/Preference/BackUrl.php',
'MercadoPago\\PP\\Sdk\\Entity\\Preference\\DifferentialPricing' => __DIR__ . '/../..' . '/src/Entity/Preference/DifferentialPricing.php',
@@ -77,13 +87,11 @@ class ComposerStaticInit7df991cb6c45ae6eb5b10f00fabea309
'MercadoPago\\PP\\Sdk\\Sdk' => __DIR__ . '/../..' . '/src/Sdk.php',
);
- public static function getInitializer(ClassLoader $loader)
- {
- return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInit7df991cb6c45ae6eb5b10f00fabea309::$prefixLengthsPsr4;
- $loader->prefixDirsPsr4 = ComposerStaticInit7df991cb6c45ae6eb5b10f00fabea309::$prefixDirsPsr4;
- $loader->classMap = ComposerStaticInit7df991cb6c45ae6eb5b10f00fabea309::$classMap;
-
- }, null, ClassLoader::class);
+ public static function getInitializer(ClassLoader $loader) {
+ return Closure::bind(function () use ($loader): void {
+ $loader->prefixLengthsPsr4 = ComposerStaticInit9311624e15b6e009950b2fbe89edbcce::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInit9311624e15b6e009950b2fbe89edbcce::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticInit9311624e15b6e009950b2fbe89edbcce::$classMap;
+ }, null, 'Composer\Autoload\ClassLoader');
}
}
diff --git a/packages/sdk/vendor/composer/installed.json b/packages/sdk/vendor/composer/installed.json
new file mode 100644
index 000000000..d4daed1c6
--- /dev/null
+++ b/packages/sdk/vendor/composer/installed.json
@@ -0,0 +1,5 @@
+{
+ "packages": [],
+ "dev": false,
+ "dev-package-names": []
+}
\ No newline at end of file
diff --git a/packages/sdk/vendor/composer/installed.php b/packages/sdk/vendor/composer/installed.php
new file mode 100644
index 000000000..41def5d2e
--- /dev/null
+++ b/packages/sdk/vendor/composer/installed.php
@@ -0,0 +1,23 @@
+ array(
+ 'name' => 'mp-plugins/php-sdk',
+ 'pretty_version' => '1.3.1',
+ 'version' => '1.3.1.0',
+ 'reference' => NULL,
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev' => false,
+ ),
+ 'versions' => array(
+ 'mp-plugins/php-sdk' => array(
+ 'pretty_version' => '1.3.1',
+ 'version' => '1.3.1.0',
+ 'reference' => NULL,
+ 'type' => 'library',
+ 'install_path' => __DIR__ . '/../../',
+ 'aliases' => array(),
+ 'dev_requirement' => false,
+ ),
+ ),
+);
diff --git a/packages/sdk/vendor/composer/platform_check.php b/packages/sdk/vendor/composer/platform_check.php
index f79e574be..8e1b592b2 100644
--- a/packages/sdk/vendor/composer/platform_check.php
+++ b/packages/sdk/vendor/composer/platform_check.php
@@ -4,23 +4,23 @@
$issues = array();
-if (!(PHP_VERSION_ID >= 70000)) {
- $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.';
+if ( ! (\PHP_VERSION_ID >= 70000)) {
+ $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . \PHP_VERSION . '.';
}
if ($issues) {
- if (!headers_sent()) {
+ if ( ! headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
- if (!ini_get('display_errors')) {
- if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
- fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
- } elseif (!headers_sent()) {
- echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
+ if ( ! ini_get('display_errors')) {
+ if (\PHP_SAPI === 'cli' || \PHP_SAPI === 'phpdbg') {
+ fwrite(\STDERR, 'Composer detected issues in your platform:' . \PHP_EOL . \PHP_EOL . implode(\PHP_EOL, $issues) . \PHP_EOL . \PHP_EOL);
+ } elseif ( ! headers_sent()) {
+ echo 'Composer detected issues in your platform:' . \PHP_EOL . \PHP_EOL . str_replace('You are running ' . \PHP_VERSION . '.', '', implode(\PHP_EOL, $issues)) . \PHP_EOL . \PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
- E_USER_ERROR
+ \E_USER_ERROR
);
}
diff --git a/readme.txt b/readme.txt
deleted file mode 100644
index f55c5fa2a..000000000
--- a/readme.txt
+++ /dev/null
@@ -1,860 +0,0 @@
-=== Mercado Pago payments for WooCommerce ===
-Contributors: mercadopago, mercadolivre, claudiosanches, marcelohama
-Tags: ecommerce, mercadopago, woocommerce
-Requires at least: 5.6
-Tested up to: 6.2
-Requires PHP: 7.2 to 8.1
-Stable tag: 6.9.2
-License: GPLv2 or later
-License URI: https://www.gnu.org/licenses/gpl-2.0.html
-
-Offer to your clients the best experience in e-Commerce by using Mercado Pago as your payment method.
-
-== Description ==
-
-The official Mercado Pago plugin allows you to process payments for your online store, allowing users to finalize their purchase with their preferred payment method.
-
-To install it, **you don't need to have technical knowledge:** you can follow the [step by step of how to integrate it](https://www.mercadopago.com.ar/developers/es/guides/plugins/woocommerce/introduction/). from our developer website and start selling today.
-
-**Warning about v6.0.0:** when updating, if you have made custom layout changes to your checkout, it is possible that some of those customizations become misconfigured. If you have a separate store environment just for testing, please update there first in order to visualize and test the changes.
-
-### What to do with the Mercado Pago Plugin?
-* Activate **Checkout Pro** to offer logged-in payments with money in Mercado Pago account, saved cards and off means.
-* Offer payments without the need of having a Mercado Pago account, through the **Custom Checkout** for cards and off means, such as cash, bank transfer and PIX (only in Brazil).
-* Automatically convert the currency of your products: from Mexican pesos to U.S. dollars and vice versa.
-* Sell in **installments** and offer the current promotions in Checkout Pro or apply your own discount coupon in Custom Checkout.
-* Test your store before going into production with our Sandbox environment.
-* **Receive the money** from your sales on the same day.
-* **IMPORTANT:** At the moment the Mercado Envios service is deactivated.
-* **Mercado Pago customers can use already stored cards** For your customers who use Mercado Pago to buy without having to fill in card details at the store's checkout.
-
-### Adapted to your business
-
-Prepared for any type of store and category: electronics, clothing, kitchen, bazaar, whatever you want!
-Just focus on selling and **we'll take care of the security:** keep your store's payments protected with our fraud prevention and analysis tool.
-
-Boost your sales with Mercado Pago payments for WooCommerce!
-
-### Sell more with the paid market
-
-[Leave your details](https://www.mercadopago.com.br/quero-usar/?utm_campaign=%5BMP%20OP%5D%20Core%20Checkouts%202021&utm_source=plugin-woocommerce&utm_medium=plugin&utm_term=plugin-woocommerce&utm_content=plugin-woocommerce) to talk to our team of experts and understand how to sell more (for now only available for Brazil).
-
-== Screenshots ==
-
-1. RECEIVE THE MONEY FROM YOUR SALES ON THE SAME DAY
-2. This is what the Checkout Pro looks like in your store. You can choose between a modal experience or a redirect experience.
-3. This is what the Customized Checkout looks like in your store. You can activate payments with cards and also cash.
-4. Once you install the Mercado Pago Plugin, you will find the 3 checkouts available in the Payment settings in WooCommerce. You can activate them simultaneously or choose one of them. Remember that they must be configured before enabling them.
-5. To configure it, follow the step by step indicated in each Checkout. Remember that you can review the official documentation of our plugin on the Mercado Pago developer website.
-6. ACCEPT ALL PAYMENT METHODS
-
-== Frequently Asked Questions ==
-
-= I had a question during setup, where can I check the documentation? =
-
-In our developer website you will find the step by step of [how to integrate the Mercado Pago Plugin](https://www.mercadopago.com.ar/developers/es/guides/plugins/woocommerce/introduction/) in your online store.
-
-= What are the requirements for the plugin to work properly? =
-
-You must have an SSL certificate, connecting your website with the HTTPS protocol.
-
-If you need to check the protocol configuration, [test it here](https://www.ssllabs.com/ssltest/).
-
-Finally, remember that the plugin receives IPN (Instant Payment Notification) notifications automatically, you don't need to configure it!
-
-= I already finished the configuration but the Sandbox environment is not working. =
-
-Remember that to test the Checkout Pro you must log out of your Mercado Pago account, as it is not possible to use it to sell and buy at the same time.
-
-Please note that with the Test Environment enabled, the Checkout Pro does not send notifications as does the Custom Checkout.
-
-= How do I configure the sending of emails to my customers? =
-
-The configuration of sending emails must be done from the WooCommerce administrator. The Mercado Pago Plugin only contemplates sending transactions made in the Checkout Pro.
-
-= I reviewed the documentation and these FAQs but still have problems in my store, what can I do? =
-
-If you have already reviewed the documentation and have not found a solution, you can contact our support team through their [contact form](https://www.mercadopago.com.ar/developers/es/support/). Please note that we guarantee a response within {7 days} of your query.
-
-= How can I set up PIX as a payment method? =
-
-PIX is a payment method that exists only in Brazil.
-
-To enable PIX as a payment method in the Custom Checkout of your store, you need to have your key registered in Mercado Pago. [See how to do it](https://www.mercadopago.com.br/stop/pix?url=https%3A%2F%2Fwww.mercadopago.com.br%2Fadmin-pix-keys%2Fmy-keys&authentication_mode=required).
-
-After registering the key, log into the WooCommerce administrator and navigate to the **Payments** section.
-
-Look for the option **Pague com PIX**, configure it and activate PIX.
-
-You can set up a time limit for customers to pay after they receive the code, among other settings.
-
-== Installation ==
-
-= Minimum Technical Requirements =
-* WordPress version
-* Compatibility and dependency of WooCommerce VXX
-* LAMP Environment (Linux, Apache, MySQL, PHP)
-* SSL Certificate
-* Additional configuration: safe_mode off, memory_limit higher than 256MB
-
-Install the module in two different ways: automatically, from the “Plugins” section of WordPress, or manually, downloading and copying the plugin files into your directory.
-
-Automatic Installation by WordPress admin
-1. Access "Plugins" from the navigation side menu of your WordPress administrator.
-2. Once inside Plugins, click on 'Add New' and search for 'Mercado Pago payments for WooCommerce' in the WordPress Plugin list
-3. Click on "Install."
-
-Done! It will be in the "Installed Plugins" section and from there you can activate it.
-
-Manual Installation
-1. Download the [zip] (https://github.com/mercadopago/cart-woocommerce/archive/master.zip) now or from the o WordPress Module [Directory] (https://br.wordpress.org/plugins/woocommerce-mercadopago/)
-2. Unzip the folder and rename it to ”woocommerce-mercadopago”
-3. Copy the "woocommerce-mercadopago" file into your WordPress directory, inside the "Plugins" folder.
-
-Done!
-
-= Installing this plugin does not affect the speed of your store! =
-
-If you installed it correctly, you will see it in your list of "Installed Plugins" on the WordPress work area. Please enable it and proceed to your Mercado Pago account integration and setup.
-
-= Mercado Pago Integration =
-1. Create a Mercado Pago [seller account](https://www.mercadopago.com.br/registration-company?confirmation_url=https%3A%2F%2Fwww.mercadopago.com.br%2Fcomo-cobrar) if you don't have one yet. It's free and takes only seconds!
-2. Get your [credentials](https://www.mercadopago.com.br/developers/pt/guides/localization/credentials), they are the keys that uniquely identify you within the platform.
-3. Set checkout payment preferences and make other advanced settings to change default options.
-4. Approve your account to go to [Production](https://www.mercadopago.com.br/developers/pt/guides/payments/api/goto-production/) and receive real payments.
-
-= Configuration =
-Set up both the plugin and the checkouts you want to activate on your payment avenue. Follow these five steps instructions and get everything ready to receive payments:
-
-1. Add your **credentials** to test the store and charge with your Mercado Pago account **according to the country** where you are registered.
-2. Approve your account in order to charge.
-3. Fill in the basic information of your business in the plugin configuration.
-4. Set up **payment preferences** for your customers.
-5. Access **advanced** plugin and checkout **settings** only when you want to change the default settings.
-
-Check out our official documentation for more information on the specific fields to configure.
-
-== Changelog ==
-
-= v6.9.2 (23/06/2023) =
-* Fixed
-- Fixed bug that was causing the admin panel to become unresponsive or inaccessible
-
-= v6.9.0 (12/06/2023) =
-* Features
-- Add default activation for Credits Gateway when Basic Gateway is enabled
-- Declare this plugin compatible with High-Performance Order Storage (HPOS)
-* Changed
-- Replace post methods with equivalent methods compatible with HPOS
-* Fixed
-- devsite link's in readme
-
-= v6.8.1 (22/05/2023) =
-* Fixed
-- Rollback version
-
-= v6.8.0 (22/05/2023) =
-* Features
-- Add default activation for Credits Gateway when Basic Gateway is enabled
-
-= v6.7.5 (17/05/2023) =
-* Fixed
-- Fixed property discount_action_url becoming public instead private
-
-= v6.7.4 (15/05/2023) =
-* Changed
-- Changed function from str_contains to strpos to be compatible for WordPress versions lower than 5.9
-- Changed the way to handle custom notification url using or not using Mercado Pago default params
-
-= v6.7.3 (02/05/2023) =
-* Features
-- Test compatibility with WooCommerce v7.6
-- Test compatibility with WordPress v6.2
-
-* Changes
-- process_nonce_validation was removed from process_payment
-
-* Fixes
-- Fix http_user_agent log using wp_is_mobile() instead regex
-
-= v6.7.2 (20/03/2023) =
-* Features
-- Add new fields in update-metadata
- - Cho Pro will add the fields: ```installments, transaction_details, total_paid_amount, transaction_amount, last_four_digits, e o payment_type```
- - Cho Custom will add the fields: ```payment_type e last_four_digits```
- - In future release, all metadata field prefixed with "mp_" will be removed
-
-- Add security js client and retrive session id from MP_DEVICE_SESSION_ID
- - this improvement will increase the credit card approval rate
-
-* Changes
-
-- Interest attached to the order total
-* Bug fixes
-- Fix nonce validation when "allow costumers to create an account during checkout" is enabled
-
-= v6.7.1 (15/02/2023) =
-* Changes
-- Changed Credits Tooltips experience
-- Changed generic css classes name
-
-* Bug fixes
-- Fixed PIX QR Code generation
-
-= v6.7.0 (23/01/2023) =
-* Changes
-- Added security improvements
-
-= v6.6.0 (11/01/2023) =
-* Features
-- Added manual notification sync
-- Added payment ids to order metadata on callback
-- Added select-id and hidden-id attributes to document
-
-* Changes
-- Changed user permissions needed for security
-
-* Bug fixes
-- Fixed order amount with gateway discount
-- Fixed css class assignment to nonexistent element
-- Fixed selection of installments when there is an inversion of checkouts
-
-= v6.5.0 (22/12/2022) =
-* Features
-- Added Mercado Credits payment method
-- Added user permissions needed (administrator or editor) for security
-
-* Changes
-- Documented use of a 3rd Party or external service
-- Improved Checkout Pro layout
-
-* Bug fixes
-- Removed nonce validation from checkouts to use WC nonce validation
-
-= v6.4.1 (14/12/2022) =
-* Features
-- Added bank interest disclaimer
-
-* Changes
-- Removed CURLOPT_SSL_VERIFYPEER flag to get server default value
-
-= v6.4.0 (07/12/2022) =
-* Features
-- Added Mercado Pago PHP SDK
-- Added min width for checkout select inputs
-- Added nonce validation to avoid CSRF Vulnerabilities
-
-* Changes
-- Changed notification flow to use PHP SDK
-- Changed payments and preferences flow to use PHP SDK
-
-* Bug fixes
-- Fixed plugin translations
-- Fixed plugin configuration page links
-
-= v6.3.1 (13/10/2022) =
-* Changes
-- Improved discarded notification response
-- Removed loader and timeout on custom checkout
-
-= v6.3.0 (27/09/2022) =
-* Features
-- Added interest information on the order confirmation screen for payments with custom checkout
-
-* Bug fixes
-- Fixed timeout and error display in custom checkout
-- Removed hyphen from zip code to display correct address for payments with ticket checkout
-- Alignment of expiration and security code fields in custom checkout
-
-= v6.2.0 (13/09/2022) =
-* Features
-- Added Mercado Credits tooltip
-- Added loader on custom checkout to avoid timeout, handle and show errors on screen
-- Added validation on REST Client to avoid return empty array on requests response
-
-* Changes
-- Changed Wallet Button layout to encourage more usage
-
-* Bug fixes
-- Fixed email sending method for order placed with PIX
-
-= v6.1.0 (22/08/2022) =
-* Features
-- Added notices scripts on plugin
-- Added validation to avoid installments equal to zero
-- Added trigger to payment_method_selected event if it not triggered on checkout custom load
-- Added rule in notification to allow an approved payment to update if order status is pending, on_hold or failed
-- Added client to handle caronte scripts success and error
-
-* Changes
-- Removed the test credentials requirement to configure the plugin
-- Adjusted credential saving flow to avoid saving two public_key or access_token
-- Changed how to load melidata script on window.load
-- Send email from Pix and QRCode only for orders with pending status
-- Audited npm packages
-
-* Bug fixes
-- Fixed plugin and platform version on melidata client
-- Fixed order status when a partial refund is made
-- Fixed currency conversion value to display at checkout
-
-= v6.0.2 (13/07/2022) =
-* Features
-- Added preg_replace for notification external params
-
-= v6.0.1 (27/06/2022) =
-* Bug fixes
-- Added validation to invalid length on cardNumber to not clear or remove fields
-
-= v6.0.0 (22/06/2022) =
-* Features
-- Added ideal checkout template
-- Added secure inputs for Checkout Custom
-
-* Changes
-- Updated melidata script to load only on plugin pages
-
-= v5.8.0 (07/06/2022) =
-* Features
-- Added melidata script to collect metrics from plugin
-
-* Bug fixes
-- Changed mp logo
-
-= v5.7.6 (19/04/2022) =
-* Bug fixes
-- Adjusted IPN notification to recognize discount coupon
-- Added coupon information in order details
-- Changed default value of checkout ticket date_expiration
-
-= v5.7.5 (31/03/2022) =
-* Bug fixes
-- Instance a non-static class to call a method (Fatal error on PHP 8)
-
-= v5.7.4 (25/02/2022) =
-* Bug fixes
-- Changed php constant
-
-= v5.7.3 (16/02/2022) =
-* Bug fixes
-- fixed cho pro excluded payments
-- fixed cho ticket excluded payments
-- validate if has a checkout prod set all to prod
-- fixed mp order screen
-
-= v5.7.2 (14/02/2022) =
-* Bug fixes
-- Using Jquery from wp.ajax
-
-= v5.7.1 (14/02/2022) =
-* Bug fixes
-- Adjusted js and css load of mercado pago pool
-- Repass all active gateways
-
-= v5.7.0 (14/02/2022) =
-* Features
-- Redesign Admin
-- Performance improvements
-- Added research in the Mercado Pago plugin configuration pages
-
-* Bug fixes
-- Adjusted the css of payment ticket images and text
-
-= v5.6.1 (11/01/2022) =
-* Bug fixes
-- Set important to Mercado Pago inputs, to prevent ghost input type
-- Updated Mercado Pago's logo images
-
-= v5.6.0 (01/12/2021) =
-* Features
-- Support to PayCash in Mexico
-- Simplified filling for ticket
-
-* Bug fixes
-- Adjusted term and conditions CSS
-- Admin Order Details validation if is Mercado Pago order
-- Updated develop dependencies
-
-= v5.5.0 (19/10/2021) =
-* Features
-- Render pix image from backend for e-mails
-- Added link to terms and conditions of Mercado Pago on checkout screen
-
-* Bug fixes
-- Fixed retry payment
-
-= v5.4.1 (22/09/2021) =
-* Bug fixes
-- On the order page, the payment was fetched with the wrong token
-- When the plugin was updated the checkout mode visually went to test
-
-= 5.4.0 (20/09/2021) =
-* Features
-- Performance improvements
-- Improved status of declined payments
-- Improvements in store test flow
-- Improved text distribution in the Wallet Button alert
-- Inclusion of interest-free installment button in payment settings (PSJ)
-- Inclusion of Pix code on the customer panel for later consultation
-- Inclusion of visual information on the status of the credential
-- Adding more QR Code expiration options to the PIX
-
-* Bug fixes
-- Fix QR Code breaking email layout
-
-= 5.3.1 (12/08/2021) =
-* Bug fixes
-- Adjusted notification url, checking if it's a friendly url or not
-
-= 5.3.0 (10/08/2021) =
-* Features
-- Credentials order on painel
-- The seller can change checkout names
-
-= v5.2.0 (26/07/2021) =
-* Features
-- New payment method Wallet Button (wallet purchase)
-- Added support to PHP 8
-- Added support to PHPUnit
-- Added support to source_news in notification
-
-* Bug fixes
-- Changed pix e-mail template
-- Removed gulp dependency
-- New pre-commit hooks
-
-= v5.1.1 (22/04/2021) =
-* Features
- - Added WooCommerce linter
-
-= v5.1.0 (29/03/2021) =
-* Features
- - Added new Pix Gateway for Brazil
- - Added Payment type at order panel
-
-* Bug fixes
- - Fixed post in configuration page, removed html
-
-= v5.0.1 (10/03/2021) =
-* Features
- - Compatibility with old notification urls
-
-= v5.0.0 (24/02/2021) =
-* Features
- - Compatibility with WooCommerce v5.0.0
- - Compatibility with WordPress v5.6.2
- - Added Wordpress Code Standard at plugin
-
-* Bug fixes
- - Fixed round amount
-
-= v4.6.4 (11/02/2021) =
-* Bug fixes
- - Removed payments methods in option custom checkout OFF
-
-= v4.6.3 (06/01/2021) =
-* Features
- - Compatibility with WooCommerce v4.9.2
- - Compatibility with WordPress v5.6.1
- - Added index to all directories for more security
-
-* Bug fixes
- - Fixed wc-api request check when is ?wc_api or wc-api
- - Fixed close of rating notification
-
-= v4.6.2 (06/01/2021) =
-* Bug fixes
- - Changed loading of Mercado Pago SDK at custom checkout
-
-= v4.6.1 (04/01/2021) =
-* Features
- - Add support to LearnPress
- - Compatibility with Wordpress v5.6 and WooCommerce v4.8
- - Added version in SDK Mercado Pago
- - Added compatibility with WooCommerce Accepted Payment Methods plugin
-
-* Bug fixes
- - Changed event load of credit-card.js in checkout page
- - Changed API to get payment_methods in Checkout Custo Offline and Checkout pro
- - Changed event load in admin payments config
- - Changed name Checkout Mercado Pago to Checkout Pro
-
-= v4.6.0 (01/12/2020) =
-* Features
- - Add review rating banner
- - Improve security on checkouts, xss javascript sanitizer
- - Support section block added in checkout settings
-
-* Bug fixes
- - Fixed error that prevents configuring the Mercado Pago plugin
-
-= v4.5.0 (26/10/2020) =
-* Features
- - Compatibility with WooCommerce v4.6.x
- - Improved security (added access token in the header for all calls to Mercado Livre and Mercado Pago endpoints)
- - Add new endpoint to validate Access Token and Public key to substitute old process to validation
- - Improved performance with CSS minification
-
-* Bug fixes
- - Fixed conflict with wc-api webhook and Mercado Pago webhook/IPN.
- - Fixed alert in currency conversion
- - Fixed tranlate in currency conversion
- - Bug fixed when updating orders that have two or more payments associated.
-
-* Bug fixes
- - Fixed conflict with wc-api webhook and Mercado Pago webhook/IPN.
-
-= v4.4.0 (21/09/2020) =
-* Features
- - Compatibility with WooCommerce v4.5.x
-
-* Bug fixes
- - Adjusted error when shipping is not used
-
-= v4.3.1 (10/09/2020) =
-* Bug fixes
- - Adjusted inventory (for canceled orders) on payments made at the personalized offline checkout
-
-= v4.3.0 (31/08/2020) =
-* Features
- - Improve plugin initialization
- - Compatibility with Wordpress v5.5 and WooCommerce v4.4.x
-
-* Bug fixes
- - Fixed currency conversion API - Alert added at checkout when currency conversion fails
- - Adjusted inventory (for canceled orders) on payments made at the personalized offline checkout
- - Adjusted translation in general
- - Adjusted currency translation alert
-
-= v4.2.2 (27/07/2020) =
-* Features
- - Added feature: cancelled orders on WooCommerce are automatically cancelled on Mercado Pago
- - Compatibility with Wordpress v5.4 and WooCommerce v4.3.x
-
-* Bug fixes
- - Fixed notification bug - No longer updates completed orders
- - Fixed currency conversion API - No longer allows payments without currency conversion
- - Fixed payment procesisng for virtual products
- - Added ABSPATH in every PHP file
- - Adjusted installments translation
- - Adjusted state names for Transparent Checkout in Brazil
- - Adjusted currency translation translations
- - Removed text in code written in Spanish
-
-== Changelog ==
-= v4.2.1 (18/05/2020) =
-* Bug fixes
- - Corrected CI document input validation on Uruguay Custom Offline Checkout.
-
-= v4.2.0 (13/05/2020) =
-* Features
- - Added compatibility with WooCommerce version 4.1.0
- - Added Integrator ID field on checkouts’ configuration screens
- - Added validation for Public Keys
- - Added alert to activate the WooCommerce plugin whenever it is inactive
- - Added alert to install the WooCommerce plugin whenever it is uninstalled
- - Added assets versioning
- - Added minification of JS files
- - Added debug mode for JS in order to use files without minification
- - Added payment flow for WebPay in Chile for Checkout Custom Offline
- - Updated documentation and regionalized links
-
-* Bug fixes
- - Corrected notification status on charged_back
- - Corrected issue when invalid credentials were switched
- - Corrected checkout options for Store Name, Store Category and Store ID
- - Corrected validation on the cardNumber field whenever card number is removed
- - Corrected input masks on CPNJ and CPF; CNPJ validation and translation in Brazil for Custom Checkout Offline;
- - Corrected mercadopago.js loading
- - Corrected processing of payment status notifications
- - Corrected personalized URLs for successful, refused and pending payments on Checkout Mercado Pago
- - Added success and error messages on received payment notifications
- - Added alphabetical order on offline payment methods for Checkout Custom
- - Added CI document input on Custom Checkout OFF in Uruguay
- - Added compatibility with third-party discount plugins which attribute value on order->fees (computation of fees_cost upon purchase)
- - Added validation, focus and error messages on all JS inputs on Checkout Custom Online and Offline
- - Usability improvements for Checkout Custom - Credit Card on mobile devices
- - Adjusted error messages on online Checkout Custom Online
- - Adjusted status updates on Checkout Custom Offline orders
- - Updated documentation and guide links
-
-= v4.1.1 (10/01/2020) =
-* Feature
- - Currency Conversion in Checkout Mercado Pago added
-
-* Bug fixes
- - Currency Conversion for CHO Custom ON and OFF fixed
- - Shipping Cost in the creation of Preferences fixed
- - ME2 shipping mode in the creation of Preferences removed
- - Checkout Mercado Pago class instance fixed when the first configurations are saved
-
-= v4.1.0 (06/01/2020) =
-* Feature
- - Updated plugin name from "WooCommerce Mercado Pago" to "Mercado Pago payments for WooCommerce".
- - Feature currency conversion returned.
- - New feature to check if cURL is installed
- - Refactored Javascript code for custom checkout Debit and credit card. Performance improvement, reduced number of SDK calls. Fixed validation errors. Javascript code refactored to the order review page. Removed select from mexico payment method.
-
-* Bug fixes
- - Fixed credential issue when the plugin is upgraded from version 3.x.x to 4xx. Unable to save empty credential.
- - Fixed issue to validate credential when checkout is active. The same problem occurs when removing the enabled checkout credential.
- - Fixed error: Undefined index: MLA in WC_WooMercadoPago_Credentials.php on line 163.
- - Fixed error: Call to a member function analytics_save_settings() in WC_WooMercadoPago_Hook_Abstract.php on line 68. Has affected users that cleared the credential and filled new credential production.
- - Fixed load of WC_WooMercadoPago_Module.php file.
- - Fixed error Uncaught Error: Call to a member function homologValidate().
- - Fixed error Undefined index: section in WC_WooMercadoPago_PaymentAbstract.php on line 303. Affected users who did not have homologous accounts
- - Fixed issue to validate credential when checkout is active. The same problem occurs when removing the enabled checkout credential.
- - Fixed issue to calculate commission and discount.
- - Fixed Layout of checkout custom input.
- - Fixed translation ES of Modo Producción, Habilitá and definí
- - Fixed Uncaught Error call to a member function update_status() in WC_WooMercadoPago_Notification_Abstract.php. Handle Mercado Pago Notification Failures and Exceptions.
- - Fix PT-BR debit card translation on admin.
- - Fix PT-BR debit card translation on checkout.
- - Remove "One Step Checkout" from CHO Custom Off.
- - Remove Mercado Creditos from Custom CHO OFF.
- - Fixed issue to check if WooCommerce plugin is installed
-
-* Break change
- - Removed feature and support to Mercado Envios shipping. Before install the plugin verify if your store has another method of shipping configured.
-
-= v4.0.8 (13/09/2019) =
-* Bug fixes
- - Fixed mercado envios
- - Fexed show fee in checkout
- - Fixed translation file
- - Fixed constant file
-
-= v4.0.7 (12/09/2019) =
-* Bug fixes
- - Fixed layout incompatibility
- - Fixed process to validate card at custom checkout
- - Fixed payment due at ticket
- - Fixed spanish translation
-
-= v4.0.6 (09/09/2019) =
-* Bug fixes
- - Problem with all translations fixed
-
-= v4.0.5 (04/09/2019) =
-* Bug fixes
- - Problem with translations in Portuguese fixed
-
-= v4.0.4 (03/09/2019) =
-* Bug fixes
- - Conflict between php5.6 and php7 solved
-
-= v4.0.3 (03/09/2019) =
-* Bug fixes
- - Fixed basic checkout layout when theme uses bootstrap
- - Fixed all Custom checkout layout when theme uses bootstrap
- - Fixed input blank in basic checkout config
-
-= v4.0.2 (02/09/2019) =
-* Feature All
- - Performance improvement
- - UX and UI improvements
- - Code refactoring
- - Design standards: SOLID, Abstract Factory and Singleton
- - SDK Refactor: Avoid repeated external requests.
- - New Credential Validation Logic
- - Plugin Content Review
- - Adjustment in translations
- - Unification of general plugin settings with payment method setup, simplifying setup steps
- - Logs to assist support and integration
-* Bug fixes
- - Added product_id
- - Fixed payment account_money
- - Fixed translation Spanish Neutral and Argentino
-
-= v4.0.2-Beta (13/08/2019) =
-* Bug fixes
- - Fixed bug when update plugin from version 3.0.17
- - Fixed bug thats change production mode of basic, custom and ticket checkout when update version.
- - Added statement_descriptor in basic checkout
- - Fixed title space checkout custom
-
-= v4.0.1-Beta (09/08/2019) =
-* Bug fixes
- - Fixed notification IPN and Webhook
- - Fixed payment processing
- - Fixed Argentina ticket checkout
- - Fixed rule for custom checkout to generate token
- - Fixed layout checkouts
-
-= v4.0.0-Beta (02/08/2019) =
-* Feature All
- - Performance improvement
- - UX and UI improvements
- - Code refactoring
- - Design standards: SOLID, Abstract Factory and Singleton
- - SDK Refactor: Avoid repeated external requests.
- - New Credential Validation Logic
- - Plugin Content Review
- - Adjustment in translations
- - Unification of general plugin settings with payment method setup, simplifying setup steps
- - Logs to assist support and integration
-
-= v3.1.1 (03/05/2019) =
-* Feature All
- - Added alert message on all ADMIN pages for setting access_token and public_key credentials, as client_id and client_secret credentials will no longer be used. Basic Checkout will continue to work by setting these new credentials.
- - We have added minor translation enhancements.
- - We add error message when any API error occurs while validating credentials.
-
-= v3.1.0 (17/04/2019) =
-* Feature All
- - We are no longer using client_id and client_secret credentials. This will affect the functioning of the basic checkout. You will need to configure access_token and public_key, in the plugin settings have. You can access the link to get the credentials inside of configurations of plugin.
-* Improvements
- - Performance enhancements have been made, removing unnecessary requests and adding scope limitation for some functionality.
-
-= v3.0.17 (07/08/2018) =
-* Feature All
- - Adding X Product ID
- - Migration from v0 (collections) to v1
-
-= v3.0.16 (20/07/2018) =
-* Feature MCO
- - Adding PSE gateway for Colombia
-* Improvements
- - Some code improvements
-
-= v3.0.15 (15/03/2018) =
-* Improvements
- - Allowing customization by merchants, in ticket fields (credits to https://github.com/fernandoacosta)
- - Fixed a bug in Mercado Envios processment.
-
-= v3.0.14 (13/03/2018) =
-* Improvements
- - Discount and fee by gateway accepts two leading zeros after decimal point;
- - Customers now have the option to not save their credit cards;
- - Checkout banner is now customizable.
-
-= v3.0.13 (01/03/2018) =
-* Bug fixes
- - Fixed a bug in modal window for Basic Checkout.
-
-= v3.0.12 (28/02/2018) =
-* Improvements
- - Added date limit for ticket payment;
- - Added option for extra tax by payment gateway;
- - Increased stability.
-
-= v3.0.11 (19/02/2018) =
-* Improvements
- - Improved feedback messages when an order fails;
- - Improved credential validation for custom checkout by credit cards.
-
-= v3.0.10 (29/01/2018) =
-* Improvements
- - Improved layout in Credit Card and Ticket forms;
- - Improved support to WordPress themes.
-
-= v3.0.9 (16/01/2018) =
-* Bug fixes
- - Fixed a bug in the URL of product image;
- - Fix count error in sdk (credits to xchwarze).
-
-= v3.0.8 (05/01/2018) =
-* Improvements
- - Increased support and handling to older PHP;
- - IPN/Webhook now customizable.
-
-= v3.0.7 (21/12/2017) =
-* Improvements
- - Checking presence of older versions to prevent inconsistences.
-
-= v3.0.6 (13/12/2017) =
-* Improvements
- - Added validation for dimensions of products;
- - Added country code for analytics.
-* Bug fixes
- - Fixed a problem related to the title of payment method, that were in blank when configuring the module for the first time.
-
-= v3.0.5 (22/11/2017) =
-* Bug fixes
- - Fixed a bug in the URL of javascript source for light-box window.
-
-= v3.0.4 (13/11/2017) =
-* Improvements
- - Improved webhook of ticket printing to a less generic one.
-* Bug fixes
- - FIxed a bug related to payment status of tickets.
-
-= v3.0.3 (25/10/2017) =
-* Features
- - Rollout to Uruguay for Custom Checkout and Tickets.
-* Bug fixes
- - Not showing ticket form when not needed.
-
-= v3.0.2 (19/10/2017) =
-* Bug fixes
- - Fixed the absence of [zip_code] field in registered tickets for Brazil.
-
-= v3.0.1 (04/10/2017) =
-* Bug fixes
- - We fixed a Javascript problem that are occurring when payments were retried in custom checkout and tickets;
- - Resolved the size of Mercado Pago icon in checkout form.
-* Improvements
- - Allowing absence of SSL if debug mode is enabled;
- - Optmizations in form layout of custom checkout and tickets;
- - Validating currency consistency before trying conversions;
- - References to the new docummentations.
-
-= v3.0.0 (25/09/2017) =
-* Features
- - All features already present in Woo-Mercado-Pago-Module 2.x;
- - Customization of status mappings between order and payments.
-* Improvements
- - Added CNPJ document for brazilian tickets;
- - Optimization in HTTP requests and algorithms;
- - Removal of several redundancies;
- - HTML and Javascript separation;
- - Improvements in the checklist of system status;
- - More intuitive menus and admin navigations.
-
-= 2.0.9 (2017/03/21) =
-* Improvements
- - Included sponsor_id to indicate the platform to MercadoPago.
-
-= 2.0.8 (2016/10/24) =
-* Features
- - Open MercadoPago Modal when the page load;
-* Bug fixes
- - Changed notification_url to avoid payment notification issues.
-
-= 2.0.7 (2016/10/21) =
-* Bug fixes
- - Improve MercadoPago Modal z-index to avoid issues with any theme.
-
-= 2.0.6 (2016/07/29) =
-* Bug fixes
- - Fixed fatal error on IPN handler while log is disabled.
-
-= 2.0.5 (2016/07/04) =
-* Improvements
- - Improved Payment Notification handler;
- - Added full support for Chile in the settings.
-
-= 2.0.4 (2016/06/22) =
-* Bug fixes
- - Fixed `back_urls` parameter.
-
-= 2.0.3 (2016/06/21) =
-* Improvements
- - Added support for `notification_url`.
-
-= 2.0.2 (2016/06/21) =
-* Improvements
- - Fixed support for WooCommerce 2.6.
-
-= 2.0.1 (2015/03/12) =
-* Improvements
- - Removed the SSL verification for the new MercadoPago standards.
-
-= 2.0.0 (2014/08/16) =
-* Features
- - Adicionado suporte para a moeda `COP`, lembrando que depende da configuração do seu MercadoPago para isso funcionar;
- - Adicionado suporte para traduções no Transifex.
-* Bug fixes
- * Corrigido o nome do arquivo principal;
- * Corrigida as strings de tradução;
- * Corrigido o link de cancelamento.
diff --git a/templates/checkout/basic-checkout.php b/templates/checkout/basic-checkout.php
index b5f979e1b..a60cff21f 100644
--- a/templates/checkout/basic-checkout.php
+++ b/templates/checkout/basic-checkout.php
@@ -1,83 +1,71 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+ if (document.getElementById("payment_method_woo-mercado-pago-custom")) {
+ jQuery("form.checkout").on(
+ "checkout_place_order_woo-mercado-pago-basic",
+ function() {
+ cardFormLoad();
+ }
+ );
+ }
+
\ No newline at end of file
diff --git a/templates/checkout/credential/alert/alert-pix-not-registered.php b/templates/checkout/credential/alert/alert-pix-not-registered.php
index bcde174f7..d1ea17aa4 100644
--- a/templates/checkout/credential/alert/alert-pix-not-registered.php
+++ b/templates/checkout/credential/alert/alert-pix-not-registered.php
@@ -1,20 +1,14 @@
-
-
-
+
+
\ No newline at end of file
diff --git a/templates/checkout/credential/generic-alert.php b/templates/checkout/credential/generic-alert.php
index be539a46c..79169df3e 100644
--- a/templates/checkout/credential/generic-alert.php
+++ b/templates/checkout/credential/generic-alert.php
@@ -1,17 +1,10 @@
-
+
\ No newline at end of file
diff --git a/templates/checkout/credential/index.php b/templates/checkout/credential/index.php
index 258f3fae9..891711d6d 100644
--- a/templates/checkout/credential/index.php
+++ b/templates/checkout/credential/index.php
@@ -1,12 +1,5 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/checkout/credential/steps-pix.php b/templates/checkout/credential/steps-pix.php
index b1f36ace9..752f4f7c5 100644
--- a/templates/checkout/credential/steps-pix.php
+++ b/templates/checkout/credential/steps-pix.php
@@ -1,63 +1,58 @@
\ No newline at end of file
diff --git a/templates/checkout/credential/steps.php b/templates/checkout/credential/steps.php
index 3bc30da7e..d4260d8a4 100644
--- a/templates/checkout/credential/steps.php
+++ b/templates/checkout/credential/steps.php
@@ -1,55 +1,49 @@
-
-
-
-
1
-
-
-
-
-
-
-
2
-
-
-
-
-
-
-
3
-
-
-
-
-
-
-
4
-
-
-
-
-
-
-
5
-
-
-
-
-
-
+
+
+
+
+
1
+
+
+
+
+
+
+
2
+
+
+
+
+
+
+
3
+
+
+
+
+
+
+
4
+
+
+
+
+
+
+
5
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/checkout/credits-checkout.php b/templates/checkout/credits-checkout.php
index 031d48817..b593525f7 100644
--- a/templates/checkout/credits-checkout.php
+++ b/templates/checkout/credits-checkout.php
@@ -1,73 +1,60 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
- Log in or create an account in Mercado Pago. If you use Mercado Libre, you already have one!', 'woocommerce-mercadopago'); ?>",
- "choose how many installments you want to pay.', 'woocommerce-mercadopago'); ?>",
- "with money in your account, card of from the Mercado Pago app.', 'woocommerce-mercadopago'); ?>"
- ]'
- list-mode='count'
- >
-
-
-
-
-
-
-
-
-
-
-
+ Log in or create an account in Mercado Pago. If you use Mercado Libre, you already have one!', LKN_WC_MERCADOPAGO_TEXT_DOMAIN); ?>",
+ "choose how many installments you want to pay.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN); ?>",
+ "with money in your account, card of from the Mercado Pago app.', LKN_WC_MERCADOPAGO_TEXT_DOMAIN); ?>"
+ ]' list-mode='count'>
+
+
+
+
+
+
+
+
+
+
+
+ if (document.getElementById("payment_method_woo-mercado-pago-custom")) {
+ jQuery("form.checkout").on(
+ "checkout_place_order_woo-mercado-pago-basic",
+ function() {
+ cardFormLoad();
+ }
+ );
+ }
+
\ No newline at end of file
diff --git a/templates/checkout/custom-checkout.php b/templates/checkout/custom-checkout.php
index 451322c65..d7271a20c 100644
--- a/templates/checkout/custom-checkout.php
+++ b/templates/checkout/custom-checkout.php
@@ -1,217 +1,231 @@
+ if (document.getElementById("payment_method_woo-mercado-pago-custom")) {
+ jQuery("form.checkout").on(
+ "checkout_place_order_woo-mercado-pago-ticket",
+ function() {
+ cardFormLoad();
+ }
+ );
+ }
+
\ No newline at end of file
diff --git a/templates/components/activable-input.php b/templates/components/activable-input.php
index 1f9ee60b1..783f14caf 100644
--- a/templates/components/activable-input.php
+++ b/templates/components/activable-input.php
@@ -1,39 +1,51 @@
-
-
-
-
-
-
-
-
-
+?>
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/components/card-info.php b/templates/components/card-info.php
index fb8d5245c..49f79847b 100644
--- a/templates/components/card-info.php
+++ b/templates/components/card-info.php
@@ -1,29 +1,33 @@
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/components/checkbox-list.php b/templates/components/checkbox-list.php
index 0649a455b..734431833 100644
--- a/templates/components/checkbox-list.php
+++ b/templates/components/checkbox-list.php
@@ -1,50 +1,57 @@
-
-
-
-
-
-
- $payment_method_type ) { ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+?>
+
+
+
+
+
+
+
+
+
+ $payment_method_type ) { ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/components/credits-checkout-example.php b/templates/components/credits-checkout-example.php
index 76d9269ae..9ee7a9156 100644
--- a/templates/components/credits-checkout-example.php
+++ b/templates/components/credits-checkout-example.php
@@ -1,33 +1,30 @@
-
-
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/components/credits-info-example.php b/templates/components/credits-info-example.php
index d7de25bca..0d58803c7 100644
--- a/templates/components/credits-info-example.php
+++ b/templates/components/credits-info-example.php
@@ -1,60 +1,56 @@
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/components/index.php b/templates/components/index.php
index 258f3fae9..891711d6d 100644
--- a/templates/components/index.php
+++ b/templates/components/index.php
@@ -1,12 +1,5 @@
-
+
\ No newline at end of file
diff --git a/templates/components/toggle-switch.php b/templates/components/toggle-switch.php
index c31946b40..cbc617592 100644
--- a/templates/components/toggle-switch.php
+++ b/templates/components/toggle-switch.php
@@ -1,48 +1,53 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+?>
+
+
\ No newline at end of file
diff --git a/templates/components/wallet-button.php b/templates/components/wallet-button.php
index e34fa476d..11d4e65e0 100644
--- a/templates/components/wallet-button.php
+++ b/templates/components/wallet-button.php
@@ -1,23 +1,17 @@
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/credits/mp-credits-modal.php b/templates/credits/mp-credits-modal.php
index d4eff34af..bb2539576 100644
--- a/templates/credits/mp-credits-modal.php
+++ b/templates/credits/mp-credits-modal.php
@@ -1,91 +1,98 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/index.php b/templates/index.php
index 258f3fae9..891711d6d 100644
--- a/templates/index.php
+++ b/templates/index.php
@@ -1,12 +1,5 @@
-
+
\ No newline at end of file
diff --git a/templates/order-received/index.php b/templates/order-received/index.php
index 258f3fae9..891711d6d 100644
--- a/templates/order-received/index.php
+++ b/templates/order-received/index.php
@@ -1,12 +1,5 @@
-
-
-
-
-
-
-
-
-
( )
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ (
+
+
+ )
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/order-received/show-pix.php b/templates/order-received/show-pix.php
index 601499e34..0b26e09f6 100644
--- a/templates/order-received/show-pix.php
+++ b/templates/order-received/show-pix.php
@@ -1,92 +1,94 @@
-
+
-
+
-
+
-
+
-
-
-
-
-
-
1
-
-
-
-
- 2
-
-
-
-
-
- 3
-
-
-
-
-
- 4
-
-
-
-
+
+
+
+
+
+
1
+
+
+
+
+
+ 2
+
+
+
+
+
+
+ 3
+
+
+
+
+
+
+ 4
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/order-received/show-ticket.php b/templates/order-received/show-ticket.php
index 756a96e71..0ea63609f 100644
--- a/templates/order-received/show-ticket.php
+++ b/templates/order-received/show-ticket.php
@@ -1,25 +1,21 @@
-
+
-
-
-
+
+
+
-
+
\ No newline at end of file
diff --git a/templates/order/generic-order-note.php b/templates/order/generic-order-note.php
index 2cc6e140b..78e9246ce 100644
--- a/templates/order/generic-order-note.php
+++ b/templates/order/generic-order-note.php
@@ -1,33 +1,21 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/order/index.php b/templates/order/index.php
index 258f3fae9..891711d6d 100644
--- a/templates/order/index.php
+++ b/templates/order/index.php
@@ -1,12 +1,5 @@
\ No newline at end of file
diff --git a/templates/pix/pix-image-template.php b/templates/pix/pix-image-template.php
index 2a8fe3d1e..35e87850a 100644
--- a/templates/pix/pix-image-template.php
+++ b/templates/pix/pix-image-template.php
@@ -1,22 +1,15 @@
-
-
-
+ src=""
+ alt="pix">
+
-
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/receipt/custom-checkout.php b/templates/receipt/custom-checkout.php
index 79ea2d30b..e7e8b442f 100644
--- a/templates/receipt/custom-checkout.php
+++ b/templates/receipt/custom-checkout.php
@@ -1,45 +1,40 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index e53ee6676..fdf12e6b3 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -3,12 +3,12 @@
$_tests_dir = getenv( 'WP_TESTS_DIR' );
if ( ! $_tests_dir ) {
- $_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
+ $_tests_dir = rtrim( sys_get_temp_dir(), '/\\' ) . '/wordpress-tests-lib';
}
if ( ! file_exists( $_tests_dir . '/includes/functions.php' ) ) {
- echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?";
- exit( 1 );
+ echo "Could not find $_tests_dir/includes/functions.php, have you run bin/install-wp-tests.sh ?";
+ exit( 1 );
}
// Give access to tests_add_filter() function.
@@ -17,18 +17,18 @@
/**
* Manually load the plugin being tested.
*/
-function _manually_load_plugin() {
- require dirname( dirname( __FILE__ ) ) . '/woocommerce-mercadopago.php';
+function _manually_load_plugin(): void {
+ require dirname( __DIR__ ) . '/lkn-wc-mercadopago.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
function is_woocommerce_active() {
- return true;
+ return true;
}
function woothemes_queue_update( $file, $file_id, $product_id ) {
- return true;
+ return true;
}
// Start up the WP testing environment.
diff --git a/tests/includes/admin/notices/test-class-wc-woomercadopago-notices.php b/tests/includes/admin/notices/test-class-wc-woomercadopago-notices.php
index bf1555de3..e2db06313 100644
--- a/tests/includes/admin/notices/test-class-wc-woomercadopago-notices.php
+++ b/tests/includes/admin/notices/test-class-wc-woomercadopago-notices.php
@@ -1,22 +1,23 @@
+ public function tearDown(): void {
+ parent::tearDown();
+ }
+
+ public function test_get_alert_frame(): void {
+ $notices = WC_WooMercadoPago_Notices::get_alert_frame( 'unit', 'test');
+ $imgSrc = str_replace(
+ '/tests',
+ '',
+ plugins_url( '../../assets/images/minilogo.png', plugin_dir_path( __FILE__ ) )
+ );
+ $assert = '
@@ -26,6 +27,6 @@ function test_get_alert_frame() {