|
1
|
--- |
|
2
|
sidebar_label: "Module Options" |
|
3
|
--- |
|
4
|
|
|
5
|
import { Table } from "docs-ui" |
|
6
|
|
|
7
|
export const metadata = { |
|
8
|
title: `Payment Module Options`, |
|
9
|
} |
|
10
|
|
|
11
|
# {metadata.title} |
|
12
|
|
|
13
|
In this document, you'll learn about the options you can pass to the Payment Module. |
|
14
|
|
|
15
|
## All Module Options |
|
16
|
|
|
17
|
<Table> |
|
18
|
<Table.Header> |
|
19
|
<Table.Row> |
|
20
|
<Table.HeaderCell className="w-1/4"> |
|
21
|
Option |
|
22
|
</Table.HeaderCell> |
|
23
|
<Table.HeaderCell className="w-2/4"> |
|
24
|
Description |
|
25
|
</Table.HeaderCell> |
|
26
|
<Table.HeaderCell> |
|
27
|
Required |
|
28
|
</Table.HeaderCell> |
|
29
|
<Table.HeaderCell> |
|
30
|
Default |
|
31
|
</Table.HeaderCell> |
|
32
|
</Table.Row> |
|
33
|
</Table.Header> |
|
34
|
<Table.Body> |
|
35
|
<Table.Row> |
|
36
|
<Table.Cell> |
|
37
|
|
|
38
|
`webhook_delay` |
|
39
|
|
|
40
|
</Table.Cell> |
|
41
|
<Table.Cell> |
|
42
|
|
|
43
|
A number indicating the delay in milliseconds before processing a webhook event. |
|
44
|
|
|
45
|
</Table.Cell> |
|
46
|
<Table.Cell> |
|
47
|
|
|
48
|
No |
|
49
|
|
|
50
|
</Table.Cell> |
|
51
|
<Table.Cell> |
|
52
|
|
|
53
|
`5000` |
|
54
|
|
|
55
|
</Table.Cell> |
|
56
|
</Table.Row> |
|
57
|
<Table.Row> |
|
58
|
<Table.Cell> |
|
59
|
|
|
60
|
`webhook_retries` |
|
61
|
|
|
62
|
</Table.Cell> |
|
63
|
<Table.Cell> |
|
64
|
|
|
65
|
The number of times to retry the webhook event processing in case of an error. |
|
66
|
|
|
67
|
</Table.Cell> |
|
68
|
<Table.Cell> |
|
69
|
|
|
70
|
No |
|
71
|
|
|
72
|
</Table.Cell> |
|
73
|
<Table.Cell> |
|
74
|
|
|
75
|
`3` |
|
76
|
|
|
77
|
</Table.Cell> |
|
78
|
</Table.Row> |
|
79
|
<Table.Row> |
|
80
|
<Table.Cell> |
|
81
|
|
|
82
|
`providers` |
|
83
|
|
|
84
|
</Table.Cell> |
|
85
|
<Table.Cell> |
|
86
|
|
|
87
|
An array of payment providers to install and register. Learn more [in this section](#providers). |
|
88
|
|
|
89
|
</Table.Cell> |
|
90
|
<Table.Cell> |
|
91
|
|
|
92
|
No |
|
93
|
|
|
94
|
</Table.Cell> |
|
95
|
<Table.Cell> |
|
96
|
|
|
97
|
\- |
|
98
|
|
|
99
|
</Table.Cell> |
|
100
|
</Table.Row> |
|
101
|
</Table.Body> |
|
102
|
</Table> |
|
103
|
|
|
104
|
--- |
|
105
|
|
|
106
|
## providers Option |
|
107
|
|
|
108
|
The `providers` option is an array of payment module providers to be registered in your Medusa application. |
|
109
|
|
|
110
|
When the Medusa application starts, these providers are registered and can be used to process payments. |
|
111
|
|
|
112
|
For example: |
|
113
|
|
|
114
|
```ts title="medusa-config.ts" |
|
115
|
import { Modules } from "@medusajs/framework/utils" |
|
116
|
|
|
117
|
// ... |
|
118
|
|
|
119
|
module.exports = defineConfig({ |
|
120
|
// ... |
|
121
|
modules: [ |
|
122
|
{ |
|
123
|
resolve: "@medusajs/medusa/payment", |
|
124
|
options: { |
|
125
|
providers: [ |
|
126
|
{ |
|
127
|
resolve: "@medusajs/medusa/payment-stripe", |
|
128
|
id: "stripe", |
|
129
|
options: { |
|
130
|
// ... |
|
131
|
}, |
|
132
|
}, |
|
133
|
], |
|
134
|
}, |
|
135
|
}, |
|
136
|
], |
|
137
|
}) |
|
138
|
``` |
|
139
|
|
|
140
|
The `providers` option is an array of objects that accept the following properties: |
|
141
|
|
|
142
|
- `resolve`: A string indicating the package name of the module provider or the path to it. |
|
143
|
- `id`: A string indicating the provider's unique name or ID. |
|
144
|
- `options`: An optional object of the module provider's options. |
|
145
|
|
|
146
|
Refer to the [Payment Module Providers](../payment-provider/page.mdx) documentation to learn more. |