@untools/pay-paystack 0.1.0

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 ADDED
@@ -0,0 +1,92 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ## 0.1.0 (2026-05-08)
6
+
7
+ ### Features
8
+
9
+ * add charge ID handling with utility functions and update webhook payload structure ([98421bb](https://github.com/aevrHQ/pay/commit/98421bb6d1f37706af4bb21cafa01f227ea1b90f))
10
+ * add comprehensive Payment Pages vNext grilling session specification for multi-provider and multi-currency support ([1704be4](https://github.com/aevrHQ/pay/commit/1704be47898ec6b4b27fb94cd02b7dbbd6354ca2))
11
+ * add CurrencyFreaks FX adapter for @untools/pay ([cc235c0](https://github.com/aevrHQ/pay/commit/cc235c084f5f25290c6e191f9a16b39c1c74e6fb))
12
+ * add customer phone input and fallback handling in demo app ([eb1b53c](https://github.com/aevrHQ/pay/commit/eb1b53c861e376f6599a9bb8af21338492b5a388))
13
+ * add dockable log panel with toggle functionality for improved output logging ([471488c](https://github.com/aevrHQ/pay/commit/471488ceba791c06d04ffa1f6ee8890f94818d5c))
14
+ * add documentation maintenance instructions and update prompt for JSDoc compliance ([e0080be](https://github.com/aevrHQ/pay/commit/e0080be86e1cdf32a8158bbc4e4a5c303001f7b6))
15
+ * add GitHub Actions workflow for deploying documentation ([864ce7a](https://github.com/aevrHQ/pay/commit/864ce7a915952120cddac68e2a55872e80d890c9))
16
+ * add integration tests for cross-currency checkout session quotes ([9658897](https://github.com/aevrHQ/pay/commit/965889782aeda537afdda66bbe8a184f96e7f6c3))
17
+ * add resize handle functionality to dockable log panel for improved user experience ([9e3b9ab](https://github.com/aevrHQ/pay/commit/9e3b9ab8439cba005d0464e9e136c611b156a03c))
18
+ * add support for apps workspace and implement transaction verification in HundredPayAdapter ([621a198](https://github.com/aevrHQ/pay/commit/621a19810757cc8faa4e93b45a81cc2ec6b90647))
19
+ * add support for checkout modes in payment provider adapters ([2794299](https://github.com/aevrHQ/pay/commit/2794299b3398eef44a9b936ec9ba50e6536ecbb1))
20
+ * add support for custom currency registration and enhance operations with new adjustment and verification methods ([a240b64](https://github.com/aevrHQ/pay/commit/a240b64fb2b70dc04e3f6eb98e8998a1d295e6e6))
21
+ * add support for mongoose and prisma storage adapters with configuration updates ([00ebe83](https://github.com/aevrHQ/pay/commit/00ebe83ed0ae029105bc608f7b993c9878d551a8))
22
+ * add support for optional redirect URL in embedded checkout for Flutterwave ([f646692](https://github.com/aevrHQ/pay/commit/f64669242ece0aef283992663f4909e6916b9217))
23
+ * add sweep job endpoints for manual session and payment management ([15770a6](https://github.com/aevrHQ/pay/commit/15770a669ed3538821ed376f78228269121dd870))
24
+ * add transaction support to MongooseStorageAdapter with session management ([51a4e8b](https://github.com/aevrHQ/pay/commit/51a4e8b3788cd24bb6927486c3d4dfbd646667ea))
25
+ * add transaction verification and currency conversion endpoints with error handling ([e219e3d](https://github.com/aevrHQ/pay/commit/e219e3d837026d20459ef5f6b1fb83bb35fcd420))
26
+ * add transfers domain with cross-user transfer and conversion capabilities ([b27f795](https://github.com/aevrHQ/pay/commit/b27f795804aa760564e9bd0ae914771c4bc517a3))
27
+ * add verify reference handling and improve error reporting in transaction verification ([6cdf814](https://github.com/aevrHQ/pay/commit/6cdf81422f405ecb050d47daf4632338e36f6ea8))
28
+ * add vitest configuration and tests for payment adapters ([f698dbd](https://github.com/aevrHQ/pay/commit/f698dbd97980925423641425e963436f265ee87e))
29
+ * add wallet management and cross-user transfer functionality with payment page support ([94866af](https://github.com/aevrHQ/pay/commit/94866af1de854074ee8146d36d9b5fffbaa52eaf))
30
+ * add wallet payment method to checkout sessions, enabling direct wallet debits for faster transactions ([2b157d1](https://github.com/aevrHQ/pay/commit/2b157d15c8cfb999fbff6f3ede3869a5b05d6641))
31
+ * add webhook secret configuration to payment providers ([376c327](https://github.com/aevrHQ/pay/commit/376c32791db93ec2118bf4823ccde202a5aaea8c))
32
+ * **demo:** add multi-provider demo app for @untools/pay adapters ([636bce7](https://github.com/aevrHQ/pay/commit/636bce747f9f4eac9e2736b369a58e7f6ddf3ff2))
33
+ * **docs:** add comprehensive documentation for payment processing and adapters ([b4b895f](https://github.com/aevrHQ/pay/commit/b4b895f3fa44888c7e87752483e1954702909c49))
34
+ * **docs:** add payment documentation and script for full LLM ingestion ([5b171b0](https://github.com/aevrHQ/pay/commit/5b171b05dca81ccc78b417ca818846e25e77c2d4))
35
+ * **docs:** enhance documentation with new fields and error handling details across multiple files ([0257158](https://github.com/aevrHQ/pay/commit/02571589f45507143cd29cee8be714f24fa2340c))
36
+ * enhance balance computation and introduce manual resolution for transfers ([6f731a5](https://github.com/aevrHQ/pay/commit/6f731a57c894a06caefaf29fe8a2de304cbeee6f))
37
+ * enhance balance management and authorization actions across domains ([0443fb0](https://github.com/aevrHQ/pay/commit/0443fb06fddd3a82bfaafbb0473aa0e9c9b3806d))
38
+ * enhance demo interface with sender wallet auto-population and hints ([de01318](https://github.com/aevrHQ/pay/commit/de01318ad418ed3e031e280768ab0ce541a57377))
39
+ * enhance Flutterwave integration with modal closure and server verification ([565c16b](https://github.com/aevrHQ/pay/commit/565c16ba06d90476f91fc681a1f818397dd34741))
40
+ * enhance manual resolution handling and improve FX snapshot management in transfers ([8962020](https://github.com/aevrHQ/pay/commit/8962020a52bb59dab26041179db7249d9272f90b))
41
+ * enhance MongooseStorageAdapter with consistent returnDocument option usage and improve session handling ([f99ef04](https://github.com/aevrHQ/pay/commit/f99ef04488a950e2d955a644356ccaeabe0bb828))
42
+ * enhance operation finality and wallet constraints ([3132d6b](https://github.com/aevrHQ/pay/commit/3132d6b6129e0e4cd54ab4cdb725f7a1ee29f6b6))
43
+ * enhance operations and wallet handling with reconciliation support and idempotency checks ([0483df4](https://github.com/aevrHQ/pay/commit/0483df4bac181b1ec4968016f354a9e7c6269777))
44
+ * enhance payment client to include authorizer and rateProvider in createPayClient function ([64a05f3](https://github.com/aevrHQ/pay/commit/64a05f3e0433d4a373c58868faf13eeb41f5b22f))
45
+ * enhance payment page and checkout session functionality with multi-provider support ([b03c648](https://github.com/aevrHQ/pay/commit/b03c648938fd5a2065c76475ef1d9032171446df))
46
+ * enhance payment pages and checkout session handling ([2931ce3](https://github.com/aevrHQ/pay/commit/2931ce33c4484e8029d90c707917389652a95804))
47
+ * enhance payment processing models and add checkout session, quote, and payment functionality ([daacc9d](https://github.com/aevrHQ/pay/commit/daacc9d9611afb4b0fa8e52739aec7abbc731daf))
48
+ * enhance payment provider integration with public key support and status updates ([8ed00e7](https://github.com/aevrHQ/pay/commit/8ed00e7a1cfa6999ef180aee1fbff847d98164bf))
49
+ * enhance PaymentPage model with additional fields and update data handling in storage adapters ([30f74a2](https://github.com/aevrHQ/pay/commit/30f74a2607685511d457b032b1f2307e9becd763))
50
+ * enhance transaction verification and update MongooseStorageAdapter to use returnDocument option ([e2b837c](https://github.com/aevrHQ/pay/commit/e2b837c3b3d4c5be5740abdf4348f647b685d8c8))
51
+ * enhance transaction verification to support raw charge payloads and map status to completed ([f38bfd6](https://github.com/aevrHQ/pay/commit/f38bfd66c24a2ae11ea99b4f97daafd6ab0aa140))
52
+ * enhance wallet management with constraints and multi-wallet lock ordering ([dcaf8ae](https://github.com/aevrHQ/pay/commit/dcaf8ae73351e244570ff6d233933360b7527076))
53
+ * enhance webhook payload handling and add tests for amount and currency parsing ([d1f1044](https://github.com/aevrHQ/pay/commit/d1f104422836d38b14c821affbf27b6e21ecb548))
54
+ * enhance webhook processing with additional transaction details and mock provider updates ([8e82fe0](https://github.com/aevrHQ/pay/commit/8e82fe0ea48e49570070743effc4f31ccb4e9cee))
55
+ * enhance webhook verification with HMAC support and update payload structure ([839f2ce](https://github.com/aevrHQ/pay/commit/839f2ce08cb0e36363da73a7a1276b36d7d7ef99))
56
+ * **errors:** add detailed error classes for wallet and operation management ([f70bdb2](https://github.com/aevrHQ/pay/commit/f70bdb2e17a6d7fd7a1dbddcff36574ae71670d5))
57
+ * implement charge ID handling and enhance operation metadata persistence ([9c68a6e](https://github.com/aevrHQ/pay/commit/9c68a6e013a143df1701c0088467c645ac2991cd))
58
+ * implement Flutterwave and Paystack adapters for payment processing ([f202d54](https://github.com/aevrHQ/pay/commit/f202d5467e14948609cf1474636328b43af0f79f))
59
+ * implement payment and cancellation operations with detailed API documentation ([d8e056f](https://github.com/aevrHQ/pay/commit/d8e056f0145ef06720dde00135d6265666a87b41))
60
+ * implement payment pages, wallets, and webhooks domains ([89931ec](https://github.com/aevrHQ/pay/commit/89931ec6fd5e1b21dd5a588a83808caa713858fa))
61
+ * implement sweep job for TTL-driven session and payment management ([5e32fd8](https://github.com/aevrHQ/pay/commit/5e32fd89bb9ca2caf2ab232f824cf89fd60ea33a))
62
+ * implement system wallet resolution and double-entry bookkeeping for deposits and withdrawals ([17d5445](https://github.com/aevrHQ/pay/commit/17d5445918c1e66496304ff5b086791ff8e87a6a))
63
+ * implement user manager and wallet management features in demo app ([65efc55](https://github.com/aevrHQ/pay/commit/65efc5544aa8e776446273695894b4c632122113))
64
+ * implement verification domain and enhance webhook processing with event handling ([06dcaac](https://github.com/aevrHQ/pay/commit/06dcaac70b7e233ecc7a35981969bd88889960dd))
65
+ * implement wallet payment method and enhance checkout session API to support wallet transactions ([ababf35](https://github.com/aevrHQ/pay/commit/ababf350427676c85d4b213699e7e6eeacdba5fe))
66
+ * integrate decimal.js for improved currency conversion precision and add effectiveAtPolicy to PayClientConfig ([dbb1388](https://github.com/aevrHQ/pay/commit/dbb1388f534a0c79ebc064c78b26beebf779c0b8))
67
+ * introduce ReversalNotAllowedError and update related operations; rename webhook methods for clarity ([c25cde3](https://github.com/aevrHQ/pay/commit/c25cde38c71a65884549998d2076b08a36d06305))
68
+ * make phone number optional in charge and checkout payloads ([c73da25](https://github.com/aevrHQ/pay/commit/c73da2585075c962d75273d612ff73cbab622885))
69
+ * optimize balance derivation and enhance entry metadata ([217e580](https://github.com/aevrHQ/pay/commit/217e5806a9546daabe447f09a13d2f7ef7e81255))
70
+ * update architecture specification with enhanced FX handling and operation status definitions ([494d83e](https://github.com/aevrHQ/pay/commit/494d83ec4a5b9194b710c637dbc5f05bc102a478))
71
+ * update demo app configuration and enhance checkout state management ([84c6788](https://github.com/aevrHQ/pay/commit/84c678809888a35b5dcf31ad0ff1273866612513))
72
+ * update QuoteExpiredError to use originalQuoteId and enhance session fulfillment status calculation ([8250826](https://github.com/aevrHQ/pay/commit/8250826674c64f3d69286f0ccd6cd14aea31131b))
73
+ * update unique constraint for transit wallet to align with checkout session ownership model ([caccab5](https://github.com/aevrHQ/pay/commit/caccab54b24f592c1d1ac9d5f3011f970eb3954d))
74
+
75
+ ### Bug Fixes
76
+
77
+ * **docs:** add missing line breaks for better readability in multiple documentation files ([7d3f0b6](https://github.com/aevrHQ/pay/commit/7d3f0b67f1e899271bdd420770fcb83bb9446c78))
78
+ * **docs:** pin vitepress outDir via explicit CLI flags for Vercel compatibility ([88ba383](https://github.com/aevrHQ/pay/commit/88ba3833fc14a5b661d986b5c94fd383407c9158))
79
+ * **docs:** set base to / for Netlify root domain deployment ([9143a3f](https://github.com/aevrHQ/pay/commit/9143a3f56d0bef387578e37441f60a9632304897))
80
+ * **docs:** simplify head configuration in VitePress config ([ab180b2](https://github.com/aevrHQ/pay/commit/ab180b296bc052eccff7d8bbb50abcc15ac72eef))
81
+ * update .gitignore to specify dist directory and add .gitkeep to docs/dist ([bb0ff25](https://github.com/aevrHQ/pay/commit/bb0ff25b81643df8d9f7662301d2ae5e9d3dd8d8))
82
+ * update output paths for documentation build and deployment ([72c2193](https://github.com/aevrHQ/pay/commit/72c21931ae7fde3fedb889f8862f8717119278c5))
83
+
84
+ ### Documentation
85
+
86
+ * add detailed specification document ([772fab8](https://github.com/aevrHQ/pay/commit/772fab829f7dea3be82b9d8179ec04f865605c56))
87
+ * add missing guides and adapter pages ([1aae778](https://github.com/aevrHQ/pay/commit/1aae778961fd38121302f418071a613708814635))
88
+ * add SPEC_FIXES.md to documentation directory ([9f14063](https://github.com/aevrHQ/pay/commit/9f14063bd9ca968f9bb20d0243feadd9f4023a90))
89
+ * update specification documents to include new payment pages multi-provider session feature and various minor fixes ([3c512f7](https://github.com/aevrHQ/pay/commit/3c512f7e03185cc986adbeaed17ad2f9d5527997))
90
+ * update specification for id generation contract and add adapter internal implementation details ([d939874](https://github.com/aevrHQ/pay/commit/d939874cc26c89dc0320c336825168acbd6a8cc2))
91
+
92
+ # Changelog
@@ -0,0 +1,11 @@
1
+ import type { PaymentProviderAdapter } from "@untools/pay";
2
+ export interface PaystackAdapterConfig {
3
+ secretKey: string;
4
+ publicKey?: string;
5
+ /** Base URL override — defaults to https://api.paystack.co */
6
+ baseUrl?: string;
7
+ /** HMAC-SHA512 webhook secret. Set to the value from your Paystack dashboard. */
8
+ webhookSecret?: string;
9
+ }
10
+ export declare function createPaystackAdapter(config: PaystackAdapterConfig): PaymentProviderAdapter;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EAMvB,MAAM,cAAc,CAAC;AAItB,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAgOD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,qBAAqB,GAC5B,sBAAsB,CAExB"}
package/dist/index.js ADDED
@@ -0,0 +1,163 @@
1
+ import { WebhookVerificationError } from "@untools/pay";
2
+ import { createHmac, timingSafeEqual } from "node:crypto";
3
+ /**
4
+ * Paystack PaymentProviderAdapter for @untools/pay.
5
+ *
6
+ * Amounts: Paystack works in kobo (NGN minor units). The adapter passes amounts
7
+ * through as-is since @untools/pay always stores in minor units.
8
+ */
9
+ class PaystackAdapter {
10
+ name = "paystack";
11
+ secretKey;
12
+ publicKey;
13
+ baseUrl;
14
+ webhookSecret;
15
+ constructor(config) {
16
+ this.secretKey = config.secretKey;
17
+ this.publicKey = config.publicKey;
18
+ this.baseUrl = config.baseUrl ?? "https://api.paystack.co";
19
+ this.webhookSecret = config.webhookSecret ?? "";
20
+ }
21
+ supportsCheckoutMode(mode) {
22
+ return mode === "hosted" || mode === "embedded";
23
+ }
24
+ async initCheckout(input) {
25
+ const body = JSON.stringify({
26
+ amount: input.amountMinor,
27
+ currency: input.currency.toUpperCase(),
28
+ email: input.customerEmail ?? "customer@example.com",
29
+ reference: input.operationId,
30
+ callback_url: input.callbackUrl,
31
+ metadata: {
32
+ ...input.metadata,
33
+ tenant_id: input.tenantId,
34
+ operation_id: input.operationId,
35
+ custom_fields: input.customerName
36
+ ? [
37
+ {
38
+ display_name: "Name",
39
+ variable_name: "name",
40
+ value: input.customerName,
41
+ },
42
+ ]
43
+ : [],
44
+ },
45
+ });
46
+ const response = await fetch(`${this.baseUrl}/transaction/initialize`, {
47
+ method: "POST",
48
+ headers: {
49
+ Authorization: `Bearer ${this.secretKey}`,
50
+ "Content-Type": "application/json",
51
+ },
52
+ body,
53
+ });
54
+ if (!response.ok) {
55
+ const text = await response.text();
56
+ throw new Error(`Paystack initCheckout failed (${response.status}): ${text}`);
57
+ }
58
+ const json = (await response.json());
59
+ if (!json.status) {
60
+ throw new Error(`Paystack initCheckout error: ${json.message}`);
61
+ }
62
+ return {
63
+ checkoutUrl: json.data.authorization_url,
64
+ providerReference: json.data.reference,
65
+ raw: {
66
+ ...json.data,
67
+ checkoutPayload: {
68
+ provider: "paystack",
69
+ accessCode: json.data.access_code,
70
+ reference: json.data.reference,
71
+ amountMinor: input.amountMinor,
72
+ currency: input.currency.toUpperCase(),
73
+ email: input.customerEmail ?? "customer@example.com",
74
+ ...(this.publicKey ? { publicKey: this.publicKey } : {}),
75
+ },
76
+ },
77
+ };
78
+ }
79
+ async verifyWebhook(input) {
80
+ // Paystack sends HMAC-SHA512 in x-paystack-signature header
81
+ const signature = input.headers["x-paystack-signature"];
82
+ if (!signature) {
83
+ throw new WebhookVerificationError("paystack", "Missing x-paystack-signature header");
84
+ }
85
+ const rawBody = typeof input.rawBody === "string"
86
+ ? input.rawBody
87
+ : input.rawBody.toString("utf8");
88
+ const expected = createHmac("sha512", this.webhookSecret)
89
+ .update(rawBody)
90
+ .digest("hex");
91
+ const sigBuffer = Buffer.from(signature, "hex");
92
+ const expBuffer = Buffer.from(expected, "hex");
93
+ if (sigBuffer.length !== expBuffer.length ||
94
+ !timingSafeEqual(sigBuffer, expBuffer)) {
95
+ throw new WebhookVerificationError("paystack", "Signature mismatch");
96
+ }
97
+ let payload;
98
+ try {
99
+ payload = JSON.parse(rawBody);
100
+ }
101
+ catch {
102
+ throw new WebhookVerificationError("paystack", "Invalid JSON payload");
103
+ }
104
+ const { data } = payload;
105
+ let status;
106
+ switch (data.status) {
107
+ case "success":
108
+ status = "completed";
109
+ break;
110
+ case "failed":
111
+ case "abandoned":
112
+ status = "failed";
113
+ break;
114
+ default:
115
+ status = "pending";
116
+ }
117
+ return {
118
+ externalId: data.reference,
119
+ status,
120
+ amountMinor: data.amount,
121
+ currency: data.currency,
122
+ fees: data.fees,
123
+ metadata: data.metadata,
124
+ raw: payload,
125
+ };
126
+ }
127
+ async verifyTransaction(reference) {
128
+ const response = await fetch(`${this.baseUrl}/transaction/verify/${encodeURIComponent(reference)}`, { headers: { Authorization: `Bearer ${this.secretKey}` } });
129
+ if (!response.ok) {
130
+ const text = await response.text();
131
+ throw new Error(`Paystack verifyTransaction failed (${response.status}): ${text}`);
132
+ }
133
+ const json = (await response.json());
134
+ if (!json.status) {
135
+ throw new Error(`Paystack verifyTransaction error: ${json.message}`);
136
+ }
137
+ const { data } = json;
138
+ let status;
139
+ switch (data.status) {
140
+ case "success":
141
+ status = "completed";
142
+ break;
143
+ case "failed":
144
+ case "abandoned":
145
+ status = "failed";
146
+ break;
147
+ default:
148
+ status = "pending";
149
+ }
150
+ return {
151
+ status,
152
+ amountMinor: data.amount,
153
+ currency: data.currency,
154
+ externalId: data.reference,
155
+ fees: data.fees,
156
+ raw: json,
157
+ };
158
+ }
159
+ }
160
+ export function createPaystackAdapter(config) {
161
+ return new PaystackAdapter(config);
162
+ }
163
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA8C1D;;;;;GAKG;AACH,MAAM,eAAe;IACV,IAAI,GAAG,UAAU,CAAC;IACV,SAAS,CAAS;IAClB,SAAS,CAAU;IACnB,OAAO,CAAS;IAChB,aAAa,CAAS;IAEvC,YAAY,MAA6B;QACvC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;QAClC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,yBAAyB,CAAC;QAC3D,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,IAAI,EAAE,CAAC;IAClD,CAAC;IAED,oBAAoB,CAAC,IAA2B;QAC9C,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,UAAU,CAAC;IAClD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,KAAwB;QACzC,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;YAC1B,MAAM,EAAE,KAAK,CAAC,WAAW;YACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE;YACtC,KAAK,EAAE,KAAK,CAAC,aAAa,IAAI,sBAAsB;YACpD,SAAS,EAAE,KAAK,CAAC,W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AAsC,QAAQ,CAAC,MAAM,MAAM,IAAI,EAAE,CAClE,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAA2B,CAAC;QAC/D,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,qCAAqC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QACvE,CAAC;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QACtB,IAAI,MAAyC,CAAC;QAC9C,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YACpB,KAAK,SAAS;gBACZ,MAAM,GAAG,WAAW,CAAC;gBACrB,MAAM;YACR,KAAK,QAAQ,CAAC;YACd,KAAK,WAAW;gBACd,MAAM,GAAG,QAAQ,CAAC;gBAClB,MAAM;YACR;gBACE,MAAM,GAAG,SAAS,CAAC;QACvB,CAAC;QACD,OAAO;YACL,MAAM;YACN,WAAW,EAAE,IAAI,CAAC,MAAM;YACxB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,SAAS;YAC1B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,GAAG,EAAE,IAAI;SACV,CAAC;IACJ,CAAC;CACF;AAED,MAAM,UAAU,qBAAqB,CACnC,MAA6B;IAE7B,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@untools/pay-paystack",
3
+ "version": "0.1.0",
4
+ "description": "Paystack provider adapter for @untools/pay",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "CHANGELOG.md"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "dev": "tsc --watch",
22
+ "clean": "rm -rf dist",
23
+ "test": "vitest run",
24
+ "prepublishOnly": "npm run build",
25
+ "release": "standard-version",
26
+ "release:patch": "standard-version --release-as patch",
27
+ "release:minor": "standard-version --release-as minor",
28
+ "release:major": "standard-version --release-as major"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "license": "MIT",
34
+ "peerDependencies": {
35
+ "@untools/pay": "^0.1.0"
36
+ },
37
+ "devDependencies": {
38
+ "standard-version": "^9.5.0",
39
+ "typescript": "^5.4.0",
40
+ "@types/node": "^20.0.0",
41
+ "vitest": "^1.5.0",
42
+ "@untools/pay": "*"
43
+ },
44
+ "engines": {
45
+ "node": ">=20.0.0"
46
+ }
47
+ }