@dryinov8/zumbopay-ts 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @dryinov8/zumbopay-ts
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@dryinov8/zumbopay-ts)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
6
|
|
|
@@ -28,13 +28,13 @@ Compatível com **Node.js**, **Next.js** (App Router & Pages), **React**, **Vite
|
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
# npm
|
|
31
|
-
npm install @
|
|
31
|
+
npm install @dryinov8/zumbopay-ts
|
|
32
32
|
|
|
33
33
|
# pnpm
|
|
34
|
-
pnpm add @
|
|
34
|
+
pnpm add @dryinov8/zumbopay-ts
|
|
35
35
|
|
|
36
36
|
# yarn
|
|
37
|
-
yarn add @
|
|
37
|
+
yarn add @dryinov8/zumbopay-ts
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
*(Se pretender utilizar os componentes React, certifique-se de que tem `react` e `react-dom` instalados no seu projeto).*
|
|
@@ -132,7 +132,7 @@ Se **não** passar nenhum UUID de carteira, o SDK consulta automaticamente a rot
|
|
|
132
132
|
### 1. Iniciar STK Push (M-Pesa, e-Mola ou mKesh) no Backend
|
|
133
133
|
|
|
134
134
|
```typescript
|
|
135
|
-
import { ZumboPayClient } from 'zumbopay-ts';
|
|
135
|
+
import { ZumboPayClient } from '@dryinov8/zumbopay-ts';
|
|
136
136
|
|
|
137
137
|
const zumboPay = new ZumboPayClient({
|
|
138
138
|
apiKey: process.env.ZUMBOPAY_API_KEY!,
|
|
@@ -225,7 +225,7 @@ Importe o componente ou o hook através do submódulo `zumbopay-ts/react`:
|
|
|
225
225
|
|
|
226
226
|
```tsx
|
|
227
227
|
import React, { useState } from 'react';
|
|
228
|
-
import { ZumboPayModal } from 'zumbopay-ts/react';
|
|
228
|
+
import { ZumboPayModal } from '@dryinov8/zumbopay-ts/react';
|
|
229
229
|
|
|
230
230
|
export function CheckoutButton() {
|
|
231
231
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -263,7 +263,7 @@ export function CheckoutButton() {
|
|
|
263
263
|
### Opção B: Hook Personalizado (`useZumboPay`)
|
|
264
264
|
|
|
265
265
|
```tsx
|
|
266
|
-
import { useZumboPay } from 'zumbopay-ts/react';
|
|
266
|
+
import { useZumboPay } from '@dryinov8/zumbopay-ts/react';
|
|
267
267
|
|
|
268
268
|
export function CustomPaymentForm() {
|
|
269
269
|
const {
|
|
@@ -315,7 +315,7 @@ Para garantir que as notificações de pagamento recebidas no seu servidor prov
|
|
|
315
315
|
|
|
316
316
|
```typescript
|
|
317
317
|
import { NextRequest, NextResponse } from 'next/server';
|
|
318
|
-
import { verifyWebhookSignature } from 'zumbopay-ts';
|
|
318
|
+
import { verifyWebhookSignature } from '@dryinov8/zumbopay-ts';
|
|
319
319
|
|
|
320
320
|
export async function POST(req: NextRequest) {
|
|
321
321
|
const rawBody = await req.text();
|
|
@@ -345,7 +345,7 @@ export async function POST(req: NextRequest) {
|
|
|
345
345
|
## 🛠️ Utilitários de Telefonia de Moçambique
|
|
346
346
|
|
|
347
347
|
```typescript
|
|
348
|
-
import { normalizePhone, detectOperator, isValidMozPhone } from 'zumbopay-ts';
|
|
348
|
+
import { normalizePhone, detectOperator, isValidMozPhone } from '@dryinov8/zumbopay-ts';
|
|
349
349
|
|
|
350
350
|
normalizePhone('+258 (84) 123-4567'); // '258841234567'
|
|
351
351
|
detectOperator('841234567'); // 'mpesa'
|
|
@@ -372,4 +372,4 @@ Consulte o histórico de alterações em `CHANGELOG.md`.
|
|
|
372
372
|
|
|
373
373
|
Distribuído sob a licença MIT. Consulte `LICENSE` para mais detalhes.
|
|
374
374
|
|
|
375
|
-
Desenvolvido por **[
|
|
375
|
+
Desenvolvido por **[Salvado Matavele](https://github.com/salvamatavele)**.
|
package/package.json
CHANGED