Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lançamento da versão inicial. #67

Merged
merged 255 commits into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
7134b76
feat: estrutura para criação de Plano na vindi
mBalao9 Mar 11, 2020
5d0b8d8
feat(vindihelpers.php): fN para adição de atributos customizados no WC
mBalao9 Mar 12, 2020
641e46f
feat(routes.php): rota para criação de planos
mBalao9 Mar 12, 2020
6f1e2ed
feat(planscontroller.php): criando produto e plano na vindi
mBalao9 Mar 12, 2020
91165d7
feat(customercontroller.php): criação de cliente na vindi
mBalao9 Mar 13, 2020
aa97dc0
feat(customercontroller.php): atualizando informações de usuário na API
mBalao9 Mar 13, 2020
e2a750f
Merge pull request #6 from mentores-digital/feature/testCreateProduct
MatheusKindrazki Mar 13, 2020
34f4b16
Update README.md
MatheusKindrazki Mar 13, 2020
2eb5272
fix: alterando .env
thihxm Mar 13, 2020
60d2c8d
Merge pull request #7 from mentores-digital/thihxm-patch-1
MatheusKindrazki Mar 13, 2020
3118b89
Delete .env.php
MatheusKindrazki Mar 13, 2020
828c3bb
Validação do token + mensagem de erro token inválido
thihxm Mar 16, 2020
b3044e3
Merge pull request #8 from mentores-digital/feature/validation
MatheusKindrazki Mar 17, 2020
53e4a49
feat: ciclo do cupom
thihxm Mar 17, 2020
7cf0927
Merge branch 'develop' of github.com:mentores-digital/vindi-plugin in…
thihxm Mar 18, 2020
21aba6e
Máscara de cartão de crédito
thihxm Mar 18, 2020
a07528d
feat(bankslippayment.php): criação do Gateway de Boleto
thihxm Mar 18, 2020
279ee33
Merge pull request #12 from mentores-digital/feature/gateway-boleto
MatheusKindrazki Mar 23, 2020
fec1bce
fechar notificação de token inválido
thihxm Apr 7, 2020
15ed3e0
Revert "fechar notificação de token inválido"
thihxm Apr 7, 2020
ff711cf
fechar notificação de token inválido
thihxm Apr 7, 2020
0bb41e2
mostrar notificação token invalido ao entrar
thihxm Apr 7, 2020
c187732
Revert "mostrar notificação token invalido ao entrar"
thihxm Apr 7, 2020
fe90458
mostrar notificação token invalido ao entrar
thihxm Apr 7, 2020
9fd9e03
fechar notificação de token inválido
thihxm Apr 7, 2020
415723f
Merge branch 'feature/fechar-aviso-token-invalido' into develop
thihxm Apr 8, 2020
430f801
correção na checagem da api key
thihxm Apr 8, 2020
0116a48
criação de templates para os métodos de pagamento
thihxm Apr 8, 2020
4e50479
troca da mascara de cartão
thihxm Apr 8, 2020
ed6ef74
Merge branch 'feature/templates-checkout-cc-e-boleto' into develop
thihxm Apr 8, 2020
f5de3e7
correção no update de usuário na vindi
thihxm Apr 9, 2020
dc67c7e
fix: alterando configurações de bootstrap
MatheusKindrazki Apr 13, 2020
0aefaaa
Merge pull request #14 from mentores-digital/feature/fechar-aviso-tok…
MatheusKindrazki Apr 13, 2020
56165bf
feat: corrigindo erros de execução do teste
MatheusKindrazki Apr 13, 2020
b110bca
fix(bootstrap.php): correção de execução de testes
MatheusKindrazki Apr 13, 2020
e160e4c
fix(tests/phpunit/vindi/base/test-initial-subscription.php): add Setting
MatheusKindrazki Apr 13, 2020
b721d74
fix(teste-initial-subscription.php): adicionando Settings
MatheusKindrazki Apr 13, 2020
6bc3165
Merge branch 'develop' into feature/templates-checkout-cc-e-boleto
MatheusKindrazki Apr 13, 2020
5c77519
Merge pull request #16 from mentores-digital/feature/templates-checko…
MatheusKindrazki Apr 13, 2020
0bee245
feat: corrigindo erros de execução do teste
MatheusKindrazki Apr 13, 2020
f6b68e2
fix: alterando configurações de bootstrap
MatheusKindrazki Apr 13, 2020
5363032
fix(tests/phpunit/vindi/base/test-initial-subscription.php): add Setting
MatheusKindrazki Apr 13, 2020
ff0987e
fix(teste-initial-subscription.php): adicionando Settings
MatheusKindrazki Apr 13, 2020
92329f4
Merge branch 'feature/correcao-update-usuario' into develop
thihxm Apr 15, 2020
91eb9e2
refactor(couponsmetabox.php): simplificação na inserção de campos novos
thihxm Apr 15, 2020
52a6c8d
fix: correção das configurações triplicadas
thihxm Apr 15, 2020
f8d8cbd
refactor(planscontroller.php): troca do modo de verificar novo produto
thihxm Apr 15, 2020
1b82e37
feat: ativar/desativar plano e produto na vindi
thihxm Apr 15, 2020
2776835
style: $vindiSettings -> $vindi_settings
thihxm Apr 15, 2020
00daa54
feat: remoção de usuário
thihxm Apr 15, 2020
8b3112b
Merge branch 'feature/remover-produto-usuario-plano' into develop
thihxm Apr 15, 2020
85d2a05
fix(planscontroller.php): correção na verificação dos id's da vidi
thihxm Apr 16, 2020
a592b9b
Merge branch 'feature/remover-produto-usuario-plano' into develop
thihxm Apr 16, 2020
c5a9043
feat(couponsmetabox.php): remoção das opções do WC de cupom recorrente
thihxm Apr 16, 2020
1ce4457
Merge pull request #19 from mentores-digital/feature/remover-produto-…
MatheusKindrazki Apr 16, 2020
cf6f9ce
fix: padronização das variáveis
MatheusKindrazki Apr 16, 2020
ea99a63
feat(conversions.php): adicionando conversos de dia mes e ano
MatheusKindrazki Apr 17, 2020
1d36691
refactor: criação de um produto variável com efeito na vindi
MatheusKindrazki Apr 18, 2020
2d1fca0
fix(./test/test-vindi.php): ajustando variável de Testes
MatheusKindrazki Apr 18, 2020
8b3fc4c
feat(routesapi.php): tratamento retornos + rotas checkout
thihxm Apr 20, 2020
d37e4bb
refactor: remoção do desetruturamento do retorno da comunicação api
thihxm Apr 20, 2020
48231ac
feat(paymentprocessor.php): implementação do processador de pagamentos
thihxm Apr 20, 2020
786de81
feat(paymentgateway.php): centralização funções do gateway de pagamento
thihxm Apr 20, 2020
0001931
feat: limpeza dos gateways de pagamento
thihxm Apr 20, 2020
7a7b423
fix(test-initial-subscription.php): correção no teste principal
thihxm Apr 20, 2020
0b69f75
Merge branch 'feature/processar-pagamento' into develop
thihxm Apr 20, 2020
934a927
fix(settings.php): troca da ordem de execução da action de salvamento
thihxm Apr 20, 2020
8840bb8
feat: update de Produto e Plano dentro da VIndi
MatheusKindrazki Apr 20, 2020
38ed19a
Merge pull request #21 from mentores-digital/feature/correcao-salvame…
MatheusKindrazki Apr 20, 2020
790c228
Merge branch 'develop' into feature/update-plan-and-product
MatheusKindrazki Apr 20, 2020
7364575
refactor: remoção das desestruturações desnecessárias
thihxm Apr 20, 2020
231c5ba
Merge pull request #23 from mentores-digital/feature/update-plan-and-…
thihxm Apr 20, 2020
a6830fa
feat(paymentprocessor.php): criação do usuário se ele não existe
thihxm Apr 20, 2020
4abc452
feat(bankslip-download.html.php): template de download do boleto
thihxm Apr 23, 2020
fe1cdda
feat(bankslippayment.php): adição do download do boleto dentro da order
thihxm Apr 23, 2020
c963ae2
fix(bankslippayment.php): checagem se a order não foi cancelada
thihxm Apr 23, 2020
e87bbe5
refactor(settings.php): eliminar a necessidade de instanciar VindiRoutes
thihxm Apr 23, 2020
521ac2e
refactor(settings.php): instânciando a variavel $routes
thihxm Apr 23, 2020
d404277
feat(admin-settings.html.php): novas mensagens nas configurações
thihxm Apr 23, 2020
814d9d5
feat(webhooks.php): adição do suporte aos webhooks Vindi
thihxm Apr 23, 2020
b632932
feat(webhooks.php): adição dos webhooks
thihxm Apr 23, 2020
5f4ee1d
fix: upgrade dos pacotes node
thihxm Apr 23, 2020
55fab01
fix(creditpayment.php): inicialização das variáveis das opções
thihxm Apr 23, 2020
f7244c0
Merge pull request #27 from mentores-digital/feature/inicializacao-va…
MatheusKindrazki Apr 24, 2020
d9cc4bb
feat: habilitar opções de nfe
thihxm Apr 24, 2020
031cec7
refactor(creditpayment.php): remoção do handler local de pagamento
thihxm Apr 27, 2020
5400d2a
feat(paymentgateway.php): habilitando o reembolso automático da vindi
thihxm Apr 27, 2020
b4097d8
feat(subscriptionstatushandler.php): cancelar assinatura ao estornar
thihxm Apr 27, 2020
1a74439
Merge branch 'feature/reembolso' into develop
thihxm Apr 27, 2020
37b1253
feat(routesapi.php): checagem se o produto existe antes de enviar
thihxm Apr 27, 2020
ae5a9bc
feat(productcontroller.php): criação de produto simples
thihxm Apr 27, 2020
a069dba
refactor: alterando o instanciamento dos gateways
thihxm Apr 28, 2020
12224c0
style: espaços em branco + nome errado da variável (fora do padrão)
thihxm Apr 28, 2020
46fb39a
feat(paymentprocessor.php): criação do produto dentro da vindi
thihxm Apr 28, 2020
faea372
refactor: alteração no modo de busca da meta_data
thihxm Apr 28, 2020
0b79bd3
style(paymentgateway.php): reembolso -> Transação
thihxm Apr 28, 2020
e1edd46
fix(test-initial-subscription.php): erro na inicialização do gateway
thihxm Apr 28, 2020
5176550
Merge branch 'feature/criar-produto-simples' into develop
thihxm Apr 28, 2020
45788f0
style: post metas renomeados
thihxm Apr 29, 2020
88f0d71
feat(paymentprocessor.php): compra de multiplas assinaturas
thihxm Apr 29, 2020
103f263
refactor: algumas correções mínimas
thihxm Apr 30, 2020
6d7d85d
Merge pull request #28 from mentores-digital/feature/enviar-nfe
MatheusKindrazki May 4, 2020
94f3ee1
Merge pull request #29 from mentores-digital/feature/reembolso
MatheusKindrazki May 4, 2020
5761dae
Merge pull request #30 from mentores-digital/feature/criar-produto-si…
MatheusKindrazki May 4, 2020
9976bd3
feat(productstatus.php): notificação de produto criado/atualizado
thihxm May 4, 2020
62f53a9
feat: tradução das mensagens
thihxm May 4, 2020
b8c0d14
refactor(paymentprocessor.php): reestruturação processador de pagamentos
thihxm May 5, 2020
b386c4a
fix(planscontroller.php): error ao cirar plano sem data de expiralção
thihxm May 6, 2020
e9ad932
feat(paymentprocessor.php): envio dos produtos simples como uma fatura
thihxm May 11, 2020
7bbda37
feat: adicionar taxa separadamente + webhooks com post_meta novo
thihxm May 12, 2020
4a6883a
feat: tradução mensagens do cupom + limitação no desconto carrinho fixo
thihxm May 13, 2020
3b3def8
feat(paymentprocessor.php): descontos aplicados separadamente
thihxm May 13, 2020
6b86254
docs(paymentprocessor.php): descrição das funções
thihxm May 13, 2020
8b61fdc
feat(paymentprocessor.php): cancelar todas as assinaturas se der erro
thihxm May 13, 2020
4ea8e3e
feat(paymentprocessor.php): adição do nome do produto no post_meta
thihxm May 13, 2020
65302c6
feat(bankslippayment.php): mostrar todos os boletos
thihxm May 13, 2020
8628934
refactor(bankslip-download.html.php): remoção do $key no for
thihxm May 13, 2020
5fe0a6f
feat: inicio da troca do método de verificar dependencias
thihxm May 14, 2020
cf497f2
feat: algumas verificações de dependencia
thihxm May 14, 2020
5954239
feat(paymentprocessor.php): multiplos boletos
thihxm May 14, 2020
3f01d15
Merge branch 'feature/comprar-multiplas-assinaturas' into develop
thihxm May 14, 2020
39cb8cb
Merge branch 'feature/comprar-multiplas-assinaturas' into develop
thihxm May 14, 2020
bef90ad
Merge pull request #31 from mentores-digital/feature/comprar-multipla…
MatheusKindrazki May 14, 2020
d150b6f
feat(webhooks.php): webhook bill_paid corrigido
thihxm May 14, 2020
b5d166f
fix(paymentprocessor.php): alterado modo de checagem de todas as faturas
thihxm May 14, 2020
8f8d28b
Merge branch 'feature/webhook-bill-paid' into develop
thihxm May 14, 2020
2ad0b99
refactor(bankslip-download.html.php): nova verificação do bill status
thihxm May 15, 2020
590eb36
feat: cancelamento de fatura espelhanda na vindi ou no woocommerce
thihxm May 15, 2020
101336b
Merge branch 'feature/webhook-bill-canceled' into develop
thihxm May 15, 2020
6bbf0e0
refactor: remoção de log desnecessário
thihxm May 15, 2020
1fd16c5
Merge branch 'feature/webhook-bill-canceled' into develop
thihxm May 15, 2020
2d557a3
fix(customercontroller.php): troca para operador ternário
thihxm May 15, 2020
c1bdb50
feat(dependencies.php): novo verificador de dependências
thihxm May 18, 2020
fd3a787
refactor(dependencies.php): maneira correta de adicionar o alerta
thihxm May 18, 2020
36b50c0
Merge branch 'feature/dependencias' into develop
thihxm May 18, 2020
7f0f223
refactor: remoção de views desnecessárias
thihxm May 18, 2020
55eb722
Merge branch 'feature/dependencias' into develop
thihxm May 18, 2020
c497341
fix: melhoria na responsividade a erros da api key
thihxm May 18, 2020
7eda61e
refactor(settings.php): variável invalidToken renomeada
thihxm May 18, 2020
aaadff9
Merge branch 'feature/correcao-configuracoes' into develop
thihxm May 18, 2020
b7009fe
Merge pull request #36 from mentores-digital/feature/correcao-configu…
MatheusKindrazki May 18, 2020
5bb5d6f
fix: validando existência do .env
May 19, 2020
eb3d427
fix: checagem se o post é um rascunho
thihxm May 19, 2020
c5e0f34
fix(paymentprocessor.php): habilitar o pagamento de produtos simples
thihxm May 19, 2020
28e9029
Merge pull request #37 from mentores-digital/feature/bug-criacao-produto
MatheusKindrazki May 19, 2020
1214d06
Merge pull request #38 from mentores-digital/feature/processamento-se…
MatheusKindrazki May 19, 2020
1b681b6
feat(paymentprocessor.php): adição do frete somente em 1 produto
thihxm May 19, 2020
1a5c856
Merge pull request #39 from mentores-digital/feature/frete
MatheusKindrazki May 19, 2020
e225625
feat(paymentprocessor.php): bloqueio compra de produtos simples e trials
thihxm May 20, 2020
b5191fc
refactor(paymentprocessor.php): verificar pedido antes de buscar cliente
thihxm May 20, 2020
1d7c939
Merge branch 'feature/frete-correcao' into develop
thihxm May 20, 2020
ebb1b2f
fix(paymentprocessor.php): busca do item equivalente ao item do trial
thihxm May 20, 2020
7c3cdfa
Merge pull request #40 from mentores-digital/feature/frete-correcao
MatheusKindrazki May 20, 2020
0ef5046
Merge pull request #41 from mentores-digital/feature/bug-assinatura-c…
MatheusKindrazki May 20, 2020
24d30a0
Merge branch 'develop' into feature/ajustes-de-bugs
MatheusKindrazki May 21, 2020
43e6608
feat: tratativa renovação pedido
thihxm May 21, 2020
36f3dd6
fix(paymentgateway.php): correção do reembolso
thihxm May 21, 2020
e452f57
Merge branch 'feature/novo-reembolso' into develop
thihxm May 21, 2020
0c9e8af
Merge pull request #42 from mentores-digital/feature/novo-reembolso
MatheusKindrazki May 22, 2020
95d9677
refactor(paymentprocessor.php): dando update das informações do usuário
MatheusKindrazki May 22, 2020
125cca8
fix(teste-api.php): removendo teste de criação de usuário
MatheusKindrazki May 22, 2020
c2e9441
refactor(productstatus.php): remocao do comentario
thihxm May 22, 2020
4dc15f3
fix(routesapi.php): rota errada
thihxm May 22, 2020
b9bf604
fix(planscontroller.php): correcao dos envio de planos
thihxm May 22, 2020
34e6730
feat: adicao de juros
thihxm May 22, 2020
abec780
Merge pull request #44 from mentores-digital/feature/ajustes-de-bugs
MatheusKindrazki May 22, 2020
91aabf2
feat: enviar juros somente se houver parcelamento
thihxm May 22, 2020
deb83af
Merge pull request #43 from mentores-digital/feature/converter-produt…
MatheusKindrazki May 22, 2020
563b8f5
feat: juros adicionados na compra
thihxm May 25, 2020
fc08611
Merge branch 'develop' into feature/juros
thihxm May 26, 2020
aa784ef
Merge pull request #45 from mentores-digital/feature/juros
thihxm May 26, 2020
2dae372
feat(paymentprocessor.php): cancelamento de faturas caso erro no pedido
thihxm May 26, 2020
5d41d59
fix(productcontroller.php): remoção da checagem se produto é assinatura
thihxm May 26, 2020
5a6a4b1
Merge pull request #46 from mentores-digital/feature/cancelar-fatura-…
MatheusKindrazki May 26, 2020
e16b0b6
Merge pull request #47 from mentores-digital/feature/bug-atualizacao-…
MatheusKindrazki May 26, 2020
a005c57
feat: somente um campo de api
thihxm May 28, 2020
64848ec
refactor(settings.php): retorno do check sandbox para posição anterior
thihxm Jun 2, 2020
a75c9d5
refactor(settings.php): remoção de comentário com código exemplo
thihxm Jun 3, 2020
2221d4a
fix(customercontroller.php): correção do envio de informações sem valor
thihxm Jun 3, 2020
879ac53
Merge branch 'feature/correcoes-reuniao' into develop
thihxm Jun 3, 2020
fed929b
fix(routesapi.php): adicionado suporte a boletos webservice
thihxm Jun 3, 2020
caa89a9
Merge pull request #50 from mentores-digital/feature/correcoes-reuniao
MatheusKindrazki Jun 5, 2020
27e2b59
Merge pull request #51 from mentores-digital/feature/validacao-boletos
MatheusKindrazki Jun 5, 2020
3c5473a
feat(admin-settings.html.php): cSS Alerta
welltrojan Jun 5, 2020
b94d7a9
refactor(dependencies.php): separação dos arquivos de dependencias
thihxm Jun 5, 2020
4ad54d4
feat(product-status.php): alertas style
welltrojan Jun 5, 2020
f5733e8
feat(dependencies.php): adicionar todos os erros
thihxm Jun 5, 2020
94f6004
Merge pull request #53 from mentores-digital/feature/views-dependencias
welltrojan Jun 5, 2020
88e9a19
Merge branch 'feature/views-dependencias' into develop
thihxm Jun 5, 2020
7cf0dd3
feat: gitignore
welltrojan Jun 5, 2020
2181ee0
feat: merge
welltrojan Jun 5, 2020
f258472
feat(missing-dependency.php): alertas
welltrojan Jun 5, 2020
ddff64b
feat: cartão CSS
welltrojan Jun 8, 2020
fc264f2
Merge pull request #52 from mentores-digital/feature/estilizacao
thihxm Jun 8, 2020
0e9d278
fix(interestpricehandler.php): remoção de juros no pagamento por boleto
thihxm Jun 8, 2020
9ccec59
feat: troca para juros simples
thihxm Jun 8, 2020
526c1da
Merge pull request #57 from mentores-digital/feature/correcao-juros
welltrojan Jun 8, 2020
c35da0c
Merge branch 'feature/correcao-juros' into develop
thihxm Jun 8, 2020
11262a4
test(test-dependencies.php): teste de dependências criticas
thihxm Jun 9, 2020
8527518
test: correção da ordem dos hooks + ativar somente arquivos necessários
thihxm Jun 9, 2020
d643cb0
test(dependencies.php): desabilitar verificação de versões se for teste
thihxm Jun 9, 2020
922bf52
fix: correção de loop infinito se produto/plano nao fosse criado
thihxm Jun 10, 2020
397a1f7
Ajusta nome da Vindi
laerte-guimaraes Jun 10, 2020
16fa216
Ajusta validação de certificado SSL por tipo de ambiente
laerte-guimaraes Jun 10, 2020
ff4fe8e
Remove constante desnecessária
laerte-guimaraes Jun 10, 2020
d38dd70
Ajusta URL de retorno para webhooks Vindi
laerte-guimaraes Jun 10, 2020
cbce218
Altera exposição do método para dinâmico
laerte-guimaraes Jun 10, 2020
7a9574e
Merge pull request #1 from laerte-guimaraes/develop
laerte-guimaraes Jun 10, 2020
cddf938
Corrige mensagem sobre o plugin na tela de configurações
laerte-guimaraes Jun 10, 2020
073ed9e
fix: correção de loop infinito se produto/plano nao fosse criado
thihxm Jun 10, 2020
6dc0cbe
test(test-gateways.php): testar tipo dos gateways de pagamento
thihxm Jun 10, 2020
317a4a1
test(test-payment-processor.php): teste de dados
thihxm Jun 10, 2020
859b10c
test(test-payment-processor.php): teste comentado
thihxm Jun 10, 2020
a3be93c
refactor: remoção do post_meta 'vindi_product_created'
thihxm Jun 16, 2020
1396f90
refactor: remoção do post_meta 'vindi_product_created'
thihxm Jun 16, 2020
96228c8
test(test-product.php): testes de produto
thihxm Jun 16, 2020
6c0986a
refactor(customercontroller.php): utilização dos getters dos metas
thihxm Jun 17, 2020
014f154
test(test-customer.php): testes de usuário
thihxm Jun 17, 2020
a334902
refactor(customercontroller.php): buscar por um resgistro do user_meta
thihxm Jun 18, 2020
042c324
refactor(paymentprocessor.php): buscar id do produto utilizando o getter
thihxm Jun 18, 2020
e04ea33
refactor(test-customer.php): centralização do update meta do usuário
thihxm Jun 18, 2020
4d0b1ec
test(test-payment-processor.php): teste do processador de pagamentos
thihxm Jun 18, 2020
f050b61
Merge branch 'feature/tests' into develop
thihxm Jun 18, 2020
5b4188e
feat(admin-settings.html.php): cSS Alerta
welltrojan Jun 5, 2020
d5d42d9
feat(product-status.php): alertas style
welltrojan Jun 5, 2020
80e445a
feat: gitignore
welltrojan Jun 5, 2020
d035db3
feat(missing-dependency.php): alertas
welltrojan Jun 5, 2020
de96665
feat: cartão CSS
welltrojan Jun 8, 2020
69a6d88
Merge pull request #58 from mentores-digital/feature/bug-criacao-produto
MatheusKindrazki Jun 18, 2020
214b5a3
Merge pull request #59 from laerte-guimaraes/patch-1
MatheusKindrazki Jun 18, 2020
7ca0f2d
Merge pull request #60 from laerte-guimaraes/develop
MatheusKindrazki Jun 18, 2020
8673624
refactor(admin.sass): ícones renomeados
thihxm Jun 18, 2020
7b6ed9d
Merge pull request #61 from laerte-guimaraes/fix/webhook_url
MatheusKindrazki Jun 18, 2020
7b035f4
Merge pull request #62 from laerte-guimaraes/patch-2
MatheusKindrazki Jun 18, 2020
0635e5a
feat(creditcard-checkout.html.php): estilização do input de cartão
thihxm Jun 19, 2020
877947e
feat(bankslip-download.html.php): estilização da lista de boletos
thihxm Jun 19, 2020
9105aee
refactor: remoção do config.codekit3
thihxm Jun 19, 2020
6bfa3e2
feat(routesapi.php): utilizar último cartão cadastrado
thihxm Jun 19, 2020
3b0f608
Merge branch 'develop' into feature/estilizacao-frontend
thihxm Jun 19, 2020
457342b
Merge pull request #63 from mentores-digital/feature/estilizacao-fron…
MatheusKindrazki Jun 19, 2020
9cd9baa
docs(changelog.md): adição do changelog da versão 1.0.0
thihxm Jun 22, 2020
21a80bf
feat(vindi-woocommerce.pot): arquivo de tradução gerado
thihxm Jun 22, 2020
4774174
feat: merge
thihxm Jun 22, 2020
86edf95
docs(changelog.md): juros no parcelamento
thihxm Jun 22, 2020
b61dc59
Merge pull request #64 from mentores-digital/feature/changelog
MatheusKindrazki Jun 22, 2020
d252d10
Merge branch 'feature/changelog' into develop
thihxm Jun 22, 2020
0783997
feat: banner + nome para publicar
thihxm Jun 22, 2020
8b8100c
Merge pull request #65 from mentores-digital/feature/banner
MatheusKindrazki Jun 22, 2020
0a49695
feat(readme.txt): readme para o worpress.org
thihxm Jun 22, 2020
757db32
Merge pull request #66 from mentores-digital/feature/licenca-wordpres…
MatheusKindrazki Jun 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(test-product.php): testes de produto
  • Loading branch information
thihxm committed Jun 16, 2020
commit 96228c83273e609035ec22e5d7b42810fe2aa0ba
4 changes: 2 additions & 2 deletions src/controllers/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function trash($post_id)
return;
}

$vindi_product_id = get_post_meta($product->id, 'vindi_product_id', true);
$vindi_product_id = get_post_meta($post_id, 'vindi_product_id', true);

if(empty($vindi_product_id)) {
return;
Expand Down Expand Up @@ -195,7 +195,7 @@ function untrash($post_id)
return;
}

$vindi_product_id = get_post_meta($product->id, 'vindi_product_id', true);
$vindi_product_id = get_post_meta($post_id, 'vindi_product_id', true);

if(empty($vindi_product_id)) {
return;
Expand Down
138 changes: 138 additions & 0 deletions tests/phpunit/vindi/base/test-product.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<?php

include_once VINDI_PATH . 'src/includes/admin/Settings.php';
include_once VINDI_PATH . 'src/routes/RoutesApi.php';
include_once VINDI_PATH . 'src/controllers/ProductController.php';
include_once VINDI_PATH . 'src/utils/PaymentProcessor.php';
include_once VINDI_PATH . 'src/utils/PaymentGateway.php';
include_once VINDI_PATH . 'src/services/VindiHelpers.php';
include_once VINDI_PATH . 'src/includes/gateways/CreditPayment.php';

class Vindi_Test_Product_Controller extends Vindi_Test_Base
{
private $mock_data;
public function setUp()
{
$this->mock_data = array(
'id' => 463389,
'name' => '[WC] Dummy Product',
'code' => 'WC-10',
'unit' => null,
'status' => 'active',
'description' => '',
'invoice' => 'always',
'created_at' => '2020-06-08T11:20:57.000-03:00',
'updated_at' => '2020-06-08T11:20:57.000-03:00',
'pricing_schema' => array(
'id' => 'string',
'short_format' => 'R$ 10,0',
'price' => 10.0,
'minimum_price' => null,
'schema_type' => 'flat',
'pricing_ranges' => array(),
'created_at' => '2020-06-08T11:20:57.000-03:00'
),
'metadata' => array()
);
}

public function tearDown()
{
$this->mock_data = null;
}

public function test_create_product()
{
// Skip this test because of the complexity of creating products in WC pre-3.0.
if (VindiHelpers::is_wc_lt('3.0')) {
// Dummy assertion.
$this->assertEquals(VindiHelpers::is_wc_lt('3.0'), true);
return;
}

$routes = $this->createMock(VindiRoutes::class);
$routes->method('createProduct')->willReturn($this->mock_data);
$settings = $this->createMock(VindiSettings::class);
$settings->routes = $routes;

$product_controller = new ProductController($settings);

$product = WC_Helper_Product::create_simple_product();
delete_post_meta($product->get_id(), 'vindi_product_id');

$createdProduct = $product_controller->create($product->get_id(), '', '', true);
$this->assertEquals($createdProduct, $this->mock_data);
}

public function test_update_product()
{
// Skip this test because of the complexity of creating products in WC pre-3.0.
if (VindiHelpers::is_wc_lt('3.0')) {
// Dummy assertion.
$this->assertEquals(VindiHelpers::is_wc_lt('3.0'), true);
return;
}

$routes = $this->createMock(VindiRoutes::class);
$routes->method('createProduct')->willReturn($this->mock_data);
$routes->method('updateProduct')->willReturn($this->mock_data);
$settings = $this->createMock(VindiSettings::class);
$settings->routes = $routes;

$product_controller = new ProductController($settings);

$product = WC_Helper_Product::create_simple_product();

$createdProduct = $product_controller->update($product->get_id(), '', '', true);
$this->assertEquals($createdProduct, $this->mock_data);
}

public function test_untrash_product()
{
// Skip this test because of the complexity of creating products in WC pre-3.0.
if (VindiHelpers::is_wc_lt('3.0')) {
// Dummy assertion.
$this->assertEquals(VindiHelpers::is_wc_lt('3.0'), true);
return;
}

$routes = $this->createMock(VindiRoutes::class);
$routes->method('createProduct')->willReturn($this->mock_data);
$routes->method('updateProduct')->willReturn($this->mock_data);
$settings = $this->createMock(VindiSettings::class);
$settings->routes = $routes;

$product_controller = new ProductController($settings);

$product = WC_Helper_Product::create_simple_product();

$createdProduct = $product_controller->untrash($product->get_id());
$this->assertEquals($createdProduct, $this->mock_data);
}

public function test_trash_product()
{
// Skip this test because of the complexity of creating products in WC pre-3.0.
if (VindiHelpers::is_wc_lt('3.0')) {
// Dummy assertion.
$this->assertEquals(VindiHelpers::is_wc_lt('3.0'), true);
return;
}

$trash_data = $this->mock_data;
$trash_data['status'] = 'inactive';

$routes = $this->createMock(VindiRoutes::class);
$routes->method('createProduct')->willReturn($this->mock_data);
$routes->method('updateProduct')->willReturn($trash_data);
$settings = $this->createMock(VindiSettings::class);
$settings->routes = $routes;

$product_controller = new ProductController($settings);

$product = WC_Helper_Product::create_simple_product();

$createdProduct = $product_controller->trash($product->get_id());
$this->assertEquals($createdProduct, $trash_data);
}
}; ?>