Skip to content

Commit f97d869

Browse files
committed
PHPAY-27: fix: adding singleton pattern
1 parent c0ba554 commit f97d869

25 files changed

+1876
-6363
lines changed

.github/CONTRIBUTING.md

Whitespace-only changes.

.husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ISSUE_ID=$(echo "$BRANCH_NAME" | grep -o -E "$REGEX_ISSUE_ID")
1111
COMMIT_MESSAGE=$(cat "$1")
1212

1313
if [ -z "$ISSUE_ID" ]; then
14-
echo "${BRed}Branch name does not follow the expected pattern...${KN}"
14+
echo "🛑 ${BRed} Branch name does not follow the expected pattern...${KN}"
1515
exit 1
1616
fi
1717

.husky/pre-push

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env sh
2+
3+
echo "============================================="
4+
echo "Running pre-push hook 🚀"
5+
echo "============================================="
6+
echo "\n"
7+
echo "============================================="
8+
echo "Running pint tests 🧪"
9+
echo "============================================="
10+
11+
pint_output=$(./vendor/bin/pint --test 2>&1)
12+
13+
if [ $? -ne 0 ]; then
14+
echo "Pint tests failed. Please fix the issues before pushing."
15+
exit 1
16+
fi
17+
18+
echo "🟢 Pint Ok!"
19+
20+
echo "\n"
21+
22+
echo "============================================="
23+
echo "Running pest tests 🧪"
24+
echo "============================================="
25+
26+
pest_output=$(./vendor/bin/pest --colors=always --stop-on-failure 2>&1)
27+
28+
if [ $? -ne 0 ]; then
29+
echo "🛑 Pest tests failed. Please fix the issues before pushing."
30+
echo "$pest_output"
31+
exit 1
32+
fi
33+
34+
echo "🟢 Pest Ok!"
35+
echo "\n"

README.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ O PHPay é uma biblioteca que ajuda desenvolvedores e empresas a integrarem faci
99
## 🚀 Principais Recursos
1010

1111
Integração com o Asaas para:
12-
Gerenciamento de clientes.
13-
Criação e envio de cobranças.
14-
Consultas de pagamentos e QR Codes.
15-
Fácil de usar: configuração mínima para começar.
16-
Extensível: suporte para novos gateways será adicionado em breve.
12+
13+
- Gerenciamento de clientes.
14+
- Criação e envio de cobranças.
15+
- Consultas de pagamentos e QR Codes.
16+
- Fácil de usar: configuração mínima para começar.
17+
- Extensível: suporte para novos gateways será adicionado em breve.
18+
1719
📦 Instalação
1820
Instale via Composer:
1921

@@ -28,8 +30,6 @@ require 'vendor/autoload.php';
2830

2931
use PHPay\PHPay;
3032

31-
$asaas = PHPay::asaas('SUA_CHAVE_API');
32-
3333
$client = [
3434
'name' => 'João da Silva',
3535
'cpf_cnpj' => '99999999999' // valid
@@ -41,7 +41,7 @@ $invoice = [
4141
'description' => 'Pagamento de teste',
4242
];
4343

44-
$response = $asaas
44+
$response = PHPay::asaas('SUA_CHAVE_API')
4545
->client($client)
4646
->invoice($invoice)
4747
->qrCodePix();
@@ -51,10 +51,9 @@ print_r($response);
5151

5252
## 📝 Roadmap
5353

54-
- [] Integração com o Asaas.
55-
- [] Suporte para outros gateways (ex.: Mercado Pago, Stripe).
56-
- [] Melhorias na documentação.
57-
- [] Testes unitários e exemplos de uso avançado.
54+
- Integração com Asaas.
55+
- Integração com Efí.
56+
- Lançamento v1.0.0
5857

5958
## 🌟 Contribuindo
6059

composer.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
"name": "mariolucasdev/phpay",
2+
"name": "phpay-io/phpay",
33
"type": "library",
44
"autoload": {
55
"psr-4": {
6-
"PHPay\\": "src/"
6+
"PHPay\\": "src/",
7+
"Asaas\\": "src/Gateways/Asaas/"
78
}
89
},
910
"authors": [
@@ -13,7 +14,7 @@
1314
}
1415
],
1516
"require-dev": {
16-
"pestphp/pest": "^3.5",
17+
"pestphp/pest": "3.5",
1718
"laravel/pint": "^1.18"
1819
},
1920
"config": {
@@ -22,8 +23,8 @@
2223
}
2324
},
2425
"require": {
25-
"laravel/framework": "^11.32",
26-
"vlucas/phpdotenv": "^5.6"
26+
"php": "^8.1",
27+
"ext-curl": "*"
2728
},
2829
"scripts": {
2930
"test": "vendor/bin/pest"

0 commit comments

Comments
 (0)