@abdssamie/adyen-payments 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/LICENSE +201 -0
- package/README.md +258 -0
- package/dist/client/_generated/_ignore.d.ts +1 -0
- package/dist/client/_generated/_ignore.d.ts.map +1 -0
- package/dist/client/_generated/_ignore.js +3 -0
- package/dist/client/_generated/_ignore.js.map +1 -0
- package/dist/client/index.d.ts +206 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +566 -0
- package/dist/client/index.js.map +1 -0
- package/dist/component/_generated/api.d.ts +36 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +215 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +3 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/private.d.ts +71 -0
- package/dist/component/private.d.ts.map +1 -0
- package/dist/component/private.js +250 -0
- package/dist/component/private.js.map +1 -0
- package/dist/component/public.d.ts +170 -0
- package/dist/component/public.d.ts.map +1 -0
- package/dist/component/public.js +210 -0
- package/dist/component/public.js.map +1 -0
- package/dist/component/schema.d.ts +101 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +63 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/react/hooks.d.ts +182 -0
- package/dist/react/hooks.d.ts.map +1 -0
- package/dist/react/hooks.js +215 -0
- package/dist/react/hooks.js.map +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +104 -0
- package/src/client/_generated/_ignore.ts +1 -0
- package/src/client/index.test.ts +196 -0
- package/src/client/index.ts +823 -0
- package/src/client/setup.test.ts +26 -0
- package/src/client/webhooks.test.ts +182 -0
- package/src/component/_generated/api.ts +52 -0
- package/src/component/_generated/component.ts +293 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/component/convex.config.ts +3 -0
- package/src/component/private.ts +277 -0
- package/src/component/public.test.ts +92 -0
- package/src/component/public.ts +229 -0
- package/src/component/schema.ts +67 -0
- package/src/component/setup.test.ts +11 -0
- package/src/react/hooks.ts +488 -0
- package/src/react/index.ts +18 -0
- package/src/test.ts +18 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
declare const _default: import("convex/server").SchemaDefinition<{
|
|
2
|
+
shoppers: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
3
|
+
metadata?: any;
|
|
4
|
+
userId?: string | undefined;
|
|
5
|
+
email?: string | undefined;
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
shopperReference: string;
|
|
8
|
+
}, {
|
|
9
|
+
shopperReference: import("convex/values").VString<string, "required">;
|
|
10
|
+
email: import("convex/values").VString<string | undefined, "optional">;
|
|
11
|
+
name: import("convex/values").VString<string | undefined, "optional">;
|
|
12
|
+
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
13
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
14
|
+
}, "required", "shopperReference" | "metadata" | "userId" | "email" | "name" | `metadata.${string}`>, {
|
|
15
|
+
by_shopper_reference: ["shopperReference", "_creationTime"];
|
|
16
|
+
by_email: ["email", "_creationTime"];
|
|
17
|
+
by_user_id: ["userId", "_creationTime"];
|
|
18
|
+
}, {}, {}>;
|
|
19
|
+
payment_methods: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
20
|
+
cardExpiryMonth?: string | undefined;
|
|
21
|
+
cardExpiryYear?: string | undefined;
|
|
22
|
+
cardLast4?: string | undefined;
|
|
23
|
+
metadata?: any;
|
|
24
|
+
shopperReference: string;
|
|
25
|
+
recurringDetailReference: string;
|
|
26
|
+
variant: string;
|
|
27
|
+
status: string;
|
|
28
|
+
}, {
|
|
29
|
+
shopperReference: import("convex/values").VString<string, "required">;
|
|
30
|
+
recurringDetailReference: import("convex/values").VString<string, "required">;
|
|
31
|
+
variant: import("convex/values").VString<string, "required">;
|
|
32
|
+
cardLast4: import("convex/values").VString<string | undefined, "optional">;
|
|
33
|
+
cardExpiryMonth: import("convex/values").VString<string | undefined, "optional">;
|
|
34
|
+
cardExpiryYear: import("convex/values").VString<string | undefined, "optional">;
|
|
35
|
+
status: import("convex/values").VString<string, "required">;
|
|
36
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
37
|
+
}, "required", "shopperReference" | "cardExpiryMonth" | "cardExpiryYear" | "cardLast4" | "metadata" | "recurringDetailReference" | "variant" | "status" | `metadata.${string}`>, {
|
|
38
|
+
by_recurring_detail_reference: ["recurringDetailReference", "_creationTime"];
|
|
39
|
+
by_shopper_reference: ["shopperReference", "_creationTime"];
|
|
40
|
+
}, {}, {}>;
|
|
41
|
+
payments: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
42
|
+
shopperReference?: string | undefined;
|
|
43
|
+
metadata?: any;
|
|
44
|
+
orgId?: string | undefined;
|
|
45
|
+
originalReference?: string | undefined;
|
|
46
|
+
paymentMethod?: string | undefined;
|
|
47
|
+
userId?: string | undefined;
|
|
48
|
+
amount: number;
|
|
49
|
+
currency: string;
|
|
50
|
+
merchantReference: string;
|
|
51
|
+
pspReference: string;
|
|
52
|
+
status: string;
|
|
53
|
+
created: number;
|
|
54
|
+
}, {
|
|
55
|
+
pspReference: import("convex/values").VString<string, "required">;
|
|
56
|
+
originalReference: import("convex/values").VString<string | undefined, "optional">;
|
|
57
|
+
shopperReference: import("convex/values").VString<string | undefined, "optional">;
|
|
58
|
+
merchantReference: import("convex/values").VString<string, "required">;
|
|
59
|
+
amount: import("convex/values").VFloat64<number, "required">;
|
|
60
|
+
currency: import("convex/values").VString<string, "required">;
|
|
61
|
+
status: import("convex/values").VString<string, "required">;
|
|
62
|
+
paymentMethod: import("convex/values").VString<string | undefined, "optional">;
|
|
63
|
+
created: import("convex/values").VFloat64<number, "required">;
|
|
64
|
+
userId: import("convex/values").VString<string | undefined, "optional">;
|
|
65
|
+
orgId: import("convex/values").VString<string | undefined, "optional">;
|
|
66
|
+
metadata: import("convex/values").VAny<any, "optional", string>;
|
|
67
|
+
}, "required", "amount" | "currency" | "merchantReference" | "shopperReference" | "metadata" | "orgId" | "originalReference" | "paymentMethod" | "pspReference" | "status" | "userId" | `metadata.${string}` | "created">, {
|
|
68
|
+
by_psp_reference: ["pspReference", "_creationTime"];
|
|
69
|
+
by_shopper_reference: ["shopperReference", "_creationTime"];
|
|
70
|
+
by_merchant_reference: ["merchantReference", "_creationTime"];
|
|
71
|
+
by_user_id: ["userId", "_creationTime"];
|
|
72
|
+
by_org_id: ["orgId", "_creationTime"];
|
|
73
|
+
}, {}, {}>;
|
|
74
|
+
checkout_sessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
75
|
+
autoCapture?: boolean | undefined;
|
|
76
|
+
shopperReference?: string | undefined;
|
|
77
|
+
url?: string | undefined;
|
|
78
|
+
amount: number;
|
|
79
|
+
currency: string;
|
|
80
|
+
merchantReference: string;
|
|
81
|
+
sessionData: string;
|
|
82
|
+
sessionId: string;
|
|
83
|
+
status: string;
|
|
84
|
+
}, {
|
|
85
|
+
sessionId: import("convex/values").VString<string, "required">;
|
|
86
|
+
sessionData: import("convex/values").VString<string, "required">;
|
|
87
|
+
shopperReference: import("convex/values").VString<string | undefined, "optional">;
|
|
88
|
+
merchantReference: import("convex/values").VString<string, "required">;
|
|
89
|
+
status: import("convex/values").VString<string, "required">;
|
|
90
|
+
amount: import("convex/values").VFloat64<number, "required">;
|
|
91
|
+
currency: import("convex/values").VString<string, "required">;
|
|
92
|
+
url: import("convex/values").VString<string | undefined, "optional">;
|
|
93
|
+
autoCapture: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
94
|
+
}, "required", "amount" | "autoCapture" | "currency" | "merchantReference" | "sessionData" | "sessionId" | "shopperReference" | "url" | "status">, {
|
|
95
|
+
by_session_id: ["sessionId", "_creationTime"];
|
|
96
|
+
by_shopper_reference: ["shopperReference", "_creationTime"];
|
|
97
|
+
by_merchant_reference: ["merchantReference", "_creationTime"];
|
|
98
|
+
}, {}, {}>;
|
|
99
|
+
}, true>;
|
|
100
|
+
export default _default;
|
|
101
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBA8DG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineSchema, defineTable } from "convex/server";
|
|
2
|
+
import { v } from "convex/values";
|
|
3
|
+
export default defineSchema({
|
|
4
|
+
shoppers: defineTable({
|
|
5
|
+
shopperReference: v.string(), // Unique key defined by the merchant (e.g. userId)
|
|
6
|
+
email: v.optional(v.string()),
|
|
7
|
+
name: v.optional(v.string()),
|
|
8
|
+
userId: v.optional(v.string()),
|
|
9
|
+
metadata: v.optional(v.any()),
|
|
10
|
+
})
|
|
11
|
+
.index("by_shopper_reference", ["shopperReference"])
|
|
12
|
+
.index("by_email", ["email"])
|
|
13
|
+
.index("by_user_id", ["userId"]),
|
|
14
|
+
// Tokenized payment instruments (stored details)
|
|
15
|
+
payment_methods: defineTable({
|
|
16
|
+
shopperReference: v.string(),
|
|
17
|
+
recurringDetailReference: v.string(), // Token used for recurring charges
|
|
18
|
+
variant: v.string(), // e.g. "visa", "mc", "ideal"
|
|
19
|
+
cardLast4: v.optional(v.string()),
|
|
20
|
+
cardExpiryMonth: v.optional(v.string()),
|
|
21
|
+
cardExpiryYear: v.optional(v.string()),
|
|
22
|
+
status: v.string(), // "active" or "disabled"
|
|
23
|
+
metadata: v.optional(v.any()),
|
|
24
|
+
})
|
|
25
|
+
.index("by_recurring_detail_reference", ["recurringDetailReference"])
|
|
26
|
+
.index("by_shopper_reference", ["shopperReference"]),
|
|
27
|
+
// Transaction history synced from webhooks
|
|
28
|
+
payments: defineTable({
|
|
29
|
+
pspReference: v.string(), // Adyen transaction ID
|
|
30
|
+
originalReference: v.optional(v.string()), // For refunds/captures referencing the auth
|
|
31
|
+
shopperReference: v.optional(v.string()),
|
|
32
|
+
merchantReference: v.string(), // App's order reference
|
|
33
|
+
amount: v.number(), // Value in minor units (e.g. cents)
|
|
34
|
+
currency: v.string(),
|
|
35
|
+
status: v.string(), // "authorised", "captured", "refused", "cancelled", "refunded"
|
|
36
|
+
paymentMethod: v.optional(v.string()),
|
|
37
|
+
created: v.number(),
|
|
38
|
+
userId: v.optional(v.string()),
|
|
39
|
+
orgId: v.optional(v.string()),
|
|
40
|
+
metadata: v.optional(v.any()),
|
|
41
|
+
})
|
|
42
|
+
.index("by_psp_reference", ["pspReference"])
|
|
43
|
+
.index("by_shopper_reference", ["shopperReference"])
|
|
44
|
+
.index("by_merchant_reference", ["merchantReference"])
|
|
45
|
+
.index("by_user_id", ["userId"])
|
|
46
|
+
.index("by_org_id", ["orgId"]),
|
|
47
|
+
// Checkout sessions for payment initialization
|
|
48
|
+
checkout_sessions: defineTable({
|
|
49
|
+
sessionId: v.string(),
|
|
50
|
+
sessionData: v.string(), // Frontend config string
|
|
51
|
+
shopperReference: v.optional(v.string()),
|
|
52
|
+
merchantReference: v.string(),
|
|
53
|
+
status: v.string(), // "active" or "completed"
|
|
54
|
+
amount: v.number(),
|
|
55
|
+
currency: v.string(),
|
|
56
|
+
url: v.optional(v.string()), // Hosted Checkout URL (if applicable)
|
|
57
|
+
autoCapture: v.optional(v.boolean()),
|
|
58
|
+
})
|
|
59
|
+
.index("by_session_id", ["sessionId"])
|
|
60
|
+
.index("by_shopper_reference", ["shopperReference"])
|
|
61
|
+
.index("by_merchant_reference", ["merchantReference"]),
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,eAAe,YAAY,CAAC;IAC1B,QAAQ,EAAE,WAAW,CAAC;QACpB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,mDAAmD;QACjF,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC7B,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC5B,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;QAC9B,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;KAC9B,CAAC;SACC,KAAK,CAAC,sBAAsB,EAAE,CAAC,kBAAkB,CAAC,CAAC;SACnD,KAAK,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC;SAC5B,KAAK,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,CAAC;IAElC,iDAAiD;IACjD,eAAe,EAAE,WAAW,CAAC;QAC3B,gBAAgB,E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AAC,uBAAuB,EAAE,CAAC,mBAAmB,CAAC,CAAC;CACzD,CAAC,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import type { FunctionReference } from "convex/server";
|
|
2
|
+
export interface StoredCard {
|
|
3
|
+
shopperReference: string;
|
|
4
|
+
recurringDetailReference: string;
|
|
5
|
+
variant: string;
|
|
6
|
+
cardLast4?: string;
|
|
7
|
+
cardExpiryMonth?: string;
|
|
8
|
+
cardExpiryYear?: string;
|
|
9
|
+
status: string;
|
|
10
|
+
metadata?: Record<string, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export interface PaymentTransaction {
|
|
13
|
+
pspReference: string;
|
|
14
|
+
originalReference?: string;
|
|
15
|
+
shopperReference?: string;
|
|
16
|
+
merchantReference: string;
|
|
17
|
+
amount: number;
|
|
18
|
+
currency: string;
|
|
19
|
+
status: string;
|
|
20
|
+
paymentMethod?: string;
|
|
21
|
+
created: number;
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The Convex API references the hooks need.
|
|
26
|
+
* Pass in the `api` object generated for your example app.
|
|
27
|
+
*
|
|
28
|
+
* Example:
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { api } from "../convex/_generated/api";
|
|
31
|
+
* const config: AdyenHooksConfig = { api };
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export interface AdyenHooksConfig {
|
|
35
|
+
queries: {
|
|
36
|
+
getShopper: FunctionReference<"query">;
|
|
37
|
+
listPaymentMethods: FunctionReference<"query">;
|
|
38
|
+
listPayments: FunctionReference<"query">;
|
|
39
|
+
getPayment: FunctionReference<"query">;
|
|
40
|
+
};
|
|
41
|
+
actions: {
|
|
42
|
+
getOrCreateShopper: FunctionReference<"action">;
|
|
43
|
+
createCheckout: FunctionReference<"action">;
|
|
44
|
+
syncPaymentMethods: FunctionReference<"action">;
|
|
45
|
+
deletePaymentMethod: FunctionReference<"action">;
|
|
46
|
+
chargeCard: FunctionReference<"action">;
|
|
47
|
+
capture: FunctionReference<"action">;
|
|
48
|
+
refund: FunctionReference<"action">;
|
|
49
|
+
cancel: FunctionReference<"action">;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
interface UseAdyenShopperOptions {
|
|
53
|
+
shopperReference: string;
|
|
54
|
+
config: AdyenHooksConfig;
|
|
55
|
+
}
|
|
56
|
+
interface UseAdyenShopperResult {
|
|
57
|
+
shopper: Record<string, unknown> | null | undefined;
|
|
58
|
+
isLoading: boolean;
|
|
59
|
+
error: string | null;
|
|
60
|
+
register: (args: {
|
|
61
|
+
userId: string;
|
|
62
|
+
email?: string;
|
|
63
|
+
name?: string;
|
|
64
|
+
}) => Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Manages a shopper identity: reads their record from Convex and provides
|
|
68
|
+
* a `register` function to upsert them via the Adyen component.
|
|
69
|
+
*/
|
|
70
|
+
export declare function useAdyenShopper({ shopperReference, config, }: UseAdyenShopperOptions): UseAdyenShopperResult;
|
|
71
|
+
interface UseStoredPaymentMethodsOptions {
|
|
72
|
+
shopperReference: string;
|
|
73
|
+
config: AdyenHooksConfig;
|
|
74
|
+
}
|
|
75
|
+
interface UseStoredPaymentMethodsResult {
|
|
76
|
+
paymentMethods: StoredCard[];
|
|
77
|
+
isLoading: boolean;
|
|
78
|
+
isSyncing: boolean;
|
|
79
|
+
error: string | null;
|
|
80
|
+
sync: () => Promise<void>;
|
|
81
|
+
remove: (recurringDetailReference: string) => Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Reads stored (tokenised) payment methods for a shopper from Convex,
|
|
85
|
+
* and provides helpers to sync from Adyen or delete a token.
|
|
86
|
+
*/
|
|
87
|
+
export declare function useStoredPaymentMethods({ shopperReference, config, }: UseStoredPaymentMethodsOptions): UseStoredPaymentMethodsResult;
|
|
88
|
+
interface UsePaymentsOptions {
|
|
89
|
+
shopperReference: string;
|
|
90
|
+
config: AdyenHooksConfig;
|
|
91
|
+
}
|
|
92
|
+
interface UsePaymentsResult {
|
|
93
|
+
payments: PaymentTransaction[];
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Reactive list of payment transactions for a shopper, automatically kept
|
|
97
|
+
* up to date by Convex's live query subscription.
|
|
98
|
+
*/
|
|
99
|
+
export declare function usePayments({ shopperReference, config, }: UsePaymentsOptions): UsePaymentsResult;
|
|
100
|
+
export interface PaymentOperations {
|
|
101
|
+
chargeCard: (args: {
|
|
102
|
+
shopperReference: string;
|
|
103
|
+
recurringDetailReference: string;
|
|
104
|
+
amount: number;
|
|
105
|
+
currency: string;
|
|
106
|
+
}) => Promise<{
|
|
107
|
+
pspReference: string | null;
|
|
108
|
+
status: string;
|
|
109
|
+
resultCode: string;
|
|
110
|
+
}>;
|
|
111
|
+
capture: (args: {
|
|
112
|
+
pspReference: string;
|
|
113
|
+
amount: number;
|
|
114
|
+
currency: string;
|
|
115
|
+
}) => Promise<void>;
|
|
116
|
+
refund: (args: {
|
|
117
|
+
pspReference: string;
|
|
118
|
+
amount: number;
|
|
119
|
+
currency: string;
|
|
120
|
+
}) => Promise<void>;
|
|
121
|
+
cancel: (args: {
|
|
122
|
+
pspReference: string;
|
|
123
|
+
}) => Promise<void>;
|
|
124
|
+
createCheckoutSession: (args: {
|
|
125
|
+
amount: number;
|
|
126
|
+
currency: string;
|
|
127
|
+
shopperReference?: string;
|
|
128
|
+
}) => Promise<{
|
|
129
|
+
sessionId: string;
|
|
130
|
+
sessionData: string;
|
|
131
|
+
url: string | null;
|
|
132
|
+
}>;
|
|
133
|
+
isLoading: (key: string) => boolean;
|
|
134
|
+
error: string | null;
|
|
135
|
+
clearError: () => void;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Provides callable async helpers for all payment lifecycle operations —
|
|
139
|
+
* checkout session creation, MIT charges, captures, refunds, and cancellations.
|
|
140
|
+
* Tracks per-operation loading state via a string key.
|
|
141
|
+
*/
|
|
142
|
+
export declare function usePaymentOperations(config: AdyenHooksConfig): PaymentOperations;
|
|
143
|
+
export interface UseAdyenDropinOptions {
|
|
144
|
+
/** Adyen client key (ADYEN_CLIENT_KEY) — safe to expose on the frontend */
|
|
145
|
+
clientKey: string;
|
|
146
|
+
/** Session ID returned by createCheckoutSession */
|
|
147
|
+
sessionId: string | null;
|
|
148
|
+
/** Session data blob returned by createCheckoutSession */
|
|
149
|
+
sessionData: string | null;
|
|
150
|
+
/** Environment: "TEST" or "LIVE" */
|
|
151
|
+
environment?: "test" | "live";
|
|
152
|
+
/** Shopper country code (e.g. "US", "NL") — required by some payment methods */
|
|
153
|
+
countryCode?: string;
|
|
154
|
+
/** Callback when Adyen reports payment completion */
|
|
155
|
+
onPaymentCompleted?: (result: {
|
|
156
|
+
resultCode: string;
|
|
157
|
+
}) => void;
|
|
158
|
+
/** Callback when Adyen reports an error */
|
|
159
|
+
onError?: (error: {
|
|
160
|
+
name: string;
|
|
161
|
+
message: string;
|
|
162
|
+
}) => void;
|
|
163
|
+
}
|
|
164
|
+
export interface UseAdyenDropinResult {
|
|
165
|
+
/** Ref to attach to a container div — Adyen mounts the Drop-in here */
|
|
166
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
167
|
+
isReady: boolean;
|
|
168
|
+
mountError: string | null;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Mounts the Adyen Drop-in UI component into a provided container div.
|
|
172
|
+
* Automatically initialises or re-initialises when sessionId/sessionData changes.
|
|
173
|
+
*
|
|
174
|
+
* Usage:
|
|
175
|
+
* ```tsx
|
|
176
|
+
* const { containerRef } = useAdyenDropin({ clientKey, sessionId, sessionData });
|
|
177
|
+
* return <div ref={containerRef} />;
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
export declare function useAdyenDropin({ clientKey, sessionId, sessionData, environment, countryCode, onPaymentCompleted, onError, }: UseAdyenDropinOptions): UseAdyenDropinResult;
|
|
181
|
+
export {};
|
|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,cAAc,GAAG,IAAI,CAAC,CAAC;IACrD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,EAC7B,SAAS,EACT,SAAS,EACT,WAAW,EACX,WAAoB,EACpB,WAAW,EACX,kBAAkB,EAClB,OAAO,GACR,EAAE,qBAAqB,GAAG,oBAAoB,CA2E9C"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useAction, useQuery } from "convex/react";
|
|
4
|
+
/**
|
|
5
|
+
* Manages a shopper identity: reads their record from Convex and provides
|
|
6
|
+
* a `register` function to upsert them via the Adyen component.
|
|
7
|
+
*/
|
|
8
|
+
export function useAdyenShopper({ shopperReference, config, }) {
|
|
9
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
10
|
+
const [error, setError] = useState(null);
|
|
11
|
+
const shopper = useQuery(config.queries.getShopper, { shopperReference });
|
|
12
|
+
const getOrCreateShopperAction = useAction(config.actions.getOrCreateShopper);
|
|
13
|
+
const register = useCallback(async (args) => {
|
|
14
|
+
setIsLoading(true);
|
|
15
|
+
setError(null);
|
|
16
|
+
try {
|
|
17
|
+
await getOrCreateShopperAction(args);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
const message = err instanceof Error ? err.message : "Failed to register shopper";
|
|
21
|
+
setError(message);
|
|
22
|
+
throw err;
|
|
23
|
+
}
|
|
24
|
+
finally {
|
|
25
|
+
setIsLoading(false);
|
|
26
|
+
}
|
|
27
|
+
}, [getOrCreateShopperAction]);
|
|
28
|
+
return { shopper, isLoading, error, register };
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Reads stored (tokenised) payment methods for a shopper from Convex,
|
|
32
|
+
* and provides helpers to sync from Adyen or delete a token.
|
|
33
|
+
*/
|
|
34
|
+
export function useStoredPaymentMethods({ shopperReference, config, }) {
|
|
35
|
+
const [isSyncing, setIsSyncing] = useState(false);
|
|
36
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
37
|
+
const [error, setError] = useState(null);
|
|
38
|
+
const paymentMethods = (useQuery(config.queries.listPaymentMethods, {
|
|
39
|
+
shopperReference,
|
|
40
|
+
}) ?? []);
|
|
41
|
+
const syncAction = useAction(config.actions.syncPaymentMethods);
|
|
42
|
+
const deleteAction = useAction(config.actions.deletePaymentMethod);
|
|
43
|
+
const sync = useCallback(async () => {
|
|
44
|
+
setIsSyncing(true);
|
|
45
|
+
setError(null);
|
|
46
|
+
try {
|
|
47
|
+
await syncAction({ shopperReference });
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
const message = err instanceof Error ? err.message : "Failed to sync payment methods";
|
|
51
|
+
setError(message);
|
|
52
|
+
throw err;
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
setIsSyncing(false);
|
|
56
|
+
}
|
|
57
|
+
}, [syncAction, shopperReference]);
|
|
58
|
+
const remove = useCallback(async (recurringDetailReference) => {
|
|
59
|
+
setIsLoading(true);
|
|
60
|
+
setError(null);
|
|
61
|
+
try {
|
|
62
|
+
await deleteAction({ shopperReference, recurringDetailReference });
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
const message = err instanceof Error ? err.message : "Failed to remove payment method";
|
|
66
|
+
setError(message);
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
setIsLoading(false);
|
|
71
|
+
}
|
|
72
|
+
}, [deleteAction, shopperReference]);
|
|
73
|
+
return { paymentMethods, isLoading, isSyncing, error, sync, remove };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Reactive list of payment transactions for a shopper, automatically kept
|
|
77
|
+
* up to date by Convex's live query subscription.
|
|
78
|
+
*/
|
|
79
|
+
export function usePayments({ shopperReference, config, }) {
|
|
80
|
+
const payments = (useQuery(config.queries.listPayments, {
|
|
81
|
+
shopperReference,
|
|
82
|
+
}) ?? []);
|
|
83
|
+
return { payments };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Provides callable async helpers for all payment lifecycle operations —
|
|
87
|
+
* checkout session creation, MIT charges, captures, refunds, and cancellations.
|
|
88
|
+
* Tracks per-operation loading state via a string key.
|
|
89
|
+
*/
|
|
90
|
+
export function usePaymentOperations(config) {
|
|
91
|
+
const [loadingKeys, setLoadingKeys] = useState(new Set());
|
|
92
|
+
const [error, setError] = useState(null);
|
|
93
|
+
const chargeCardAction = useAction(config.actions.chargeCard);
|
|
94
|
+
const captureAction = useAction(config.actions.capture);
|
|
95
|
+
const refundAction = useAction(config.actions.refund);
|
|
96
|
+
const cancelAction = useAction(config.actions.cancel);
|
|
97
|
+
const createCheckoutAction = useAction(config.actions.createCheckout);
|
|
98
|
+
const withLoading = useCallback(async (key, fn) => {
|
|
99
|
+
setLoadingKeys((prev) => new Set(prev).add(key));
|
|
100
|
+
setError(null);
|
|
101
|
+
try {
|
|
102
|
+
return await fn();
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
const message = err instanceof Error ? err.message : "An error occurred";
|
|
106
|
+
setError(message);
|
|
107
|
+
throw err;
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
setLoadingKeys((prev) => {
|
|
111
|
+
const next = new Set(prev);
|
|
112
|
+
next.delete(key);
|
|
113
|
+
return next;
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}, []);
|
|
117
|
+
const chargeCard = useCallback((args) => withLoading(`charge:${args.recurringDetailReference}`, () => chargeCardAction(args)), [chargeCardAction, withLoading]);
|
|
118
|
+
const capture = useCallback((args) => withLoading(`capture:${args.pspReference}`, () => captureAction(args).then(() => undefined)), [captureAction, withLoading]);
|
|
119
|
+
const refund = useCallback((args) => withLoading(`refund:${args.pspReference}`, () => refundAction(args).then(() => undefined)), [refundAction, withLoading]);
|
|
120
|
+
const cancel = useCallback((args) => withLoading(`cancel:${args.pspReference}`, () => cancelAction(args).then(() => undefined)), [cancelAction, withLoading]);
|
|
121
|
+
const createCheckoutSession = useCallback((args) => withLoading("checkout", () => createCheckoutAction(args)), [createCheckoutAction, withLoading]);
|
|
122
|
+
const isLoading = useCallback((key) => loadingKeys.has(key), [loadingKeys]);
|
|
123
|
+
const clearError = useCallback(() => setError(null), []);
|
|
124
|
+
return {
|
|
125
|
+
chargeCard,
|
|
126
|
+
capture,
|
|
127
|
+
refund,
|
|
128
|
+
cancel,
|
|
129
|
+
createCheckoutSession,
|
|
130
|
+
isLoading,
|
|
131
|
+
error,
|
|
132
|
+
clearError,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Mounts the Adyen Drop-in UI component into a provided container div.
|
|
137
|
+
* Automatically initialises or re-initialises when sessionId/sessionData changes.
|
|
138
|
+
*
|
|
139
|
+
* Usage:
|
|
140
|
+
* ```tsx
|
|
141
|
+
* const { containerRef } = useAdyenDropin({ clientKey, sessionId, sessionData });
|
|
142
|
+
* return <div ref={containerRef} />;
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
export function useAdyenDropin({ clientKey, sessionId, sessionData, environment = "test", countryCode, onPaymentCompleted, onError, }) {
|
|
146
|
+
const containerRef = useRef(null);
|
|
147
|
+
const dropinRef = useRef(null);
|
|
148
|
+
const [isReady, setIsReady] = useState(false);
|
|
149
|
+
const [mountError, setMountError] = useState(null);
|
|
150
|
+
const onPaymentCompletedRef = useRef(onPaymentCompleted);
|
|
151
|
+
const onErrorRef = useRef(onError);
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
onPaymentCompletedRef.current = onPaymentCompleted;
|
|
154
|
+
onErrorRef.current = onError;
|
|
155
|
+
});
|
|
156
|
+
useEffect(() => {
|
|
157
|
+
if (!sessionId || !sessionData || !containerRef.current || !clientKey) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
let cancelled = false;
|
|
161
|
+
const mountDropin = async () => {
|
|
162
|
+
try {
|
|
163
|
+
// Dynamically import to avoid SSR issues and keep bundle lean
|
|
164
|
+
const { AdyenCheckout, Dropin, Card } = await import("@adyen/adyen-web");
|
|
165
|
+
if (cancelled || !containerRef.current)
|
|
166
|
+
return;
|
|
167
|
+
// Unmount previous instance if any
|
|
168
|
+
if (dropinRef.current?.unmount) {
|
|
169
|
+
dropinRef.current.unmount();
|
|
170
|
+
}
|
|
171
|
+
const checkout = await AdyenCheckout({
|
|
172
|
+
environment,
|
|
173
|
+
clientKey,
|
|
174
|
+
countryCode,
|
|
175
|
+
session: { id: sessionId, sessionData },
|
|
176
|
+
onPaymentCompleted: (result) => {
|
|
177
|
+
if (!cancelled)
|
|
178
|
+
onPaymentCompletedRef.current?.(result);
|
|
179
|
+
},
|
|
180
|
+
onError: (err) => {
|
|
181
|
+
if (!cancelled)
|
|
182
|
+
onErrorRef.current?.(err);
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
if (cancelled || !containerRef.current)
|
|
186
|
+
return;
|
|
187
|
+
// v6 API: instantiate Dropin with the Core instance, then mount
|
|
188
|
+
const dropin = new Dropin(checkout, {
|
|
189
|
+
paymentMethodComponents: [Card],
|
|
190
|
+
}).mount(containerRef.current);
|
|
191
|
+
dropinRef.current = dropin;
|
|
192
|
+
if (!cancelled)
|
|
193
|
+
setIsReady(true);
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
if (!cancelled) {
|
|
197
|
+
const message = err instanceof Error ? err.message : "Failed to mount Adyen Drop-in";
|
|
198
|
+
setMountError(message);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
setIsReady(false);
|
|
203
|
+
setMountError(null);
|
|
204
|
+
void mountDropin();
|
|
205
|
+
return () => {
|
|
206
|
+
cancelled = true;
|
|
207
|
+
if (dropinRef.current?.unmount) {
|
|
208
|
+
dropinRef.current.unmount();
|
|
209
|
+
dropinRef.current = null;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
}, [clientKey, sessionId, sessionData, environment, countryCode]);
|
|
213
|
+
return { containerRef, isReady, mountError };
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/react/hooks.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAsFnD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,gBAAgB,EAChB,MAAM,GACiB;IACvB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,gBAAgB,EAAE,CAG3D,CAAC;IAEd,MAAM,wBAAwB,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE9E,MAAM,QAAQ,GAAG,WAAW,CAC1B,KAAK,EAAE,IAAuD,EAAE,EAAE;QAChE,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;QACf,IAAI,CAAC;YACH,MAAM,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACvC,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,4BAA4B,CAAC;YAClF,QAAQ,CAAC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E,CAAC;gBACtB,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC;oBACrF,aAAa,CAAC,OAAO,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,aAAa,CAAC,IAAI,CAAC,CAAC;QACpB,KAAK,WAAW,EAAE,CAAC;QAEnB,OAAO,GAAG,EAAE;YACV,SAAS,GAAG,IAAI,CAAC;YACjB,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC;gBAC/B,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC5B,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;YAC3B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IAElE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { useAdyenShopper, useStoredPaymentMethods, usePayments, usePaymentOperations, useAdyenDropin, } from "./hooks.js";
|
|
2
|
+
export type { AdyenHooksConfig, StoredCard, PaymentTransaction, PaymentOperations, UseAdyenDropinOptions, UseAdyenDropinResult, } from "./hooks.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAC"}
|