@adonis-agora/payments 0.18.0 → 0.19.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/CHANGELOG.md +12 -0
- package/README.md +67 -0
- package/dist/assets/spa/assets/{index-CmP4DYhG.js → index-DBJQRh8m.js} +2 -2
- package/dist/assets/spa/assets/{index-CmP4DYhG.js.map → index-DBJQRh8m.js.map} +1 -1
- package/dist/assets/spa/index.html +1 -1
- package/dist/src/drivers/stripe.d.ts.map +1 -1
- package/dist/src/drivers/stripe.js +20 -2
- package/dist/src/drivers/stripe.js.map +1 -1
- package/dist/src/payments_manager.js +1 -1
- package/dist/src/payments_manager.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @adonis-agora/payments
|
|
2
2
|
|
|
3
|
+
## 0.19.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#146](https://github.com/DavideCarvalho/adonis-agora-payments/pull/146) [`c071147`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/c071147d5e455ad3514055db5fb1c19c4279f79a) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Ship a README. The package listed `README.md` in `files` but had none, so its npm page was empty.
|
|
8
|
+
|
|
9
|
+
## 0.19.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#144](https://github.com/DavideCarvalho/adonis-agora-payments/pull/144) [`876b94a`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/876b94a62c9e29d5f1bee733174e654de1bd3f1e) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Support stripe-node 23. Its default API version (`2026-09-30.endive`) removed `payment_method_types` from PaymentIntent creation in favour of `allowed_payment_method_types`, and the Stripe driver used the old field to hold a charge to its method (Pix stays Pix): on stripe 23 every charge that named a method would have sent a parameter the API no longer takes. The driver now reads `Stripe.API_VERSION` from the SDK the app installed and sends `allowed_payment_method_types` from 2026-09-30 on, `payment_method_types` before it, so stripe 17 through 23 all work. The `stripe` peer range now includes `^23.0.0`.
|
|
14
|
+
|
|
3
15
|
## 0.18.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# `@adonis-agora/payments`
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@adonis-agora/payments) [](https://www.npmjs.com/package/@adonis-agora/payments) [](https://github.com/DavideCarvalho/adonis-agora-payments/actions/workflows/ci.yml) [](https://www.npmjs.com/package/@adonis-agora/payments)
|
|
4
|
+
|
|
5
|
+
> Payments and billing for **AdonisJS** — 18 gateways behind one driver contract, a
|
|
6
|
+
> Cashier-style subscription layer, idempotent webhook processing and invoice emission. Part of
|
|
7
|
+
> the [Agora](https://davidecarvalho.github.io/agora/) ecosystem.
|
|
8
|
+
|
|
9
|
+
**Gateways:** Asaas, AbacatePay, Woovi, Pagar.me, PagBank, Efí, InfinitePay, Mercado Pago ·
|
|
10
|
+
Stripe, Adyen, PayPal, Mollie, Razorpay, Square · Paddle, Lemon Squeezy, Polar, Dodo Payments.
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
node ace add @adonis-agora/payments
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Use
|
|
19
|
+
|
|
20
|
+
Configure gateways in `config/payments.ts` and route each payment method to one:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import env from '#start/env'
|
|
24
|
+
import { defineConfig, payments } from '@adonis-agora/payments'
|
|
25
|
+
|
|
26
|
+
export default defineConfig({
|
|
27
|
+
default: 'asaas',
|
|
28
|
+
providers: {
|
|
29
|
+
asaas: payments.asaas({
|
|
30
|
+
apiKey: env.get('PAYMENTS_ASAAS_KEY'),
|
|
31
|
+
webhookToken: env.get('PAYMENTS_ASAAS_WEBHOOK_TOKEN'),
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
methods: { pix: 'asaas', credit_card: 'asaas' },
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Then charge through the routed driver:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { getPayments } from '@adonis-agora/payments/services/main'
|
|
42
|
+
|
|
43
|
+
const payments = getPayments()
|
|
44
|
+
|
|
45
|
+
const customer = await payments.driver('pix').createCustomer({
|
|
46
|
+
name: 'Jane Doe',
|
|
47
|
+
email: 'jane@example.com',
|
|
48
|
+
taxId: '123.456.789-00',
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
const payment = await payments.driver('pix').charge({
|
|
52
|
+
customerId: customer.id,
|
|
53
|
+
amount: 1990, // integer cents: R$ 19,90
|
|
54
|
+
externalReference: order.id, // your own row; comes back on every webhook for this charge
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
// payment.pixCode → the copy-paste BR code to show the customer
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
Gateways, webhooks, subscriptions and billing, invoices, testing and production notes:
|
|
63
|
+
**https://davidecarvalho.github.io/agora/docs/payments**
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT
|