Commit 6256c7c
committed
Add Stripe recurring payments support
Implement wallet interface for Stripe recurring payments:
- autocomplete_with_wallet() for server-initiated charges
- Store PaymentMethod and Customer ID during first payment
- Use PaymentIntent API with off_session flag for recurring charges
- Support 3D Secure authentication when required
Changes:
- Add recurring_payments and store_payment_method parameters to init
- Implement autocomplete_with_wallet() using stored payment method
- Add customer_creation='always' to ensure customer is created
- Extract and store PaymentMethod + Customer ID from Checkout Session
- Handle payment_intent status responses (succeeded, requires_action, failed)
Tests:
- Webhook token storage test (test_webhook_stores_token.py)
- Recurring payment flow tests (test_recurring.py):
* Success case with stored payment method
* Missing customer_id error handling
* 3D Secure redirect handling
* Card declined handling
* Stripe API error handling
* Missing token error handling
Documentation:
- Comprehensive webhook setup guide (docs/webhooks.rst)
- Provider configuration examples (docs/backends.rst)
- Note on use_token parameter (optional, defaults to True)1 parent d6beb42 commit 6256c7c
File tree
5 files changed
+557
-39
lines changed- docs
- payments/stripe
5 files changed
+557
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
226 | | - | |
| 225 | + | |
227 | 226 | | |
228 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
232 | | - | |
| 233 | + | |
| 234 | + | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
237 | 239 | | |
238 | | - | |
239 | | - | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
240 | 254 | | |
241 | 255 | | |
242 | 256 | | |
243 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
244 | 262 | | |
245 | 263 | | |
246 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
67 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
68 | 87 | | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 88 | + | |
74 | 89 | | |
75 | | - | |
| 90 | + | |
76 | 91 | | |
77 | | - | |
78 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
79 | 117 | | |
80 | | - | |
81 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
82 | 139 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 140 | + | |
87 | 141 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
93 | 145 | | |
94 | 146 | | |
95 | 147 | | |
| |||
0 commit comments