├── .dockerignore ├── .env.dist ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── README.md ├── docs ├── screencast.gif ├── screencast.mp4 └── screenshot.png ├── release.toml ├── src └── main.rs └── static └── templates ├── error.html └── index.html /.dockerignore: -------------------------------------------------------------------------------- 1 | target 2 | **/*.rs.bk 3 | rustup 4 | cargo 5 | .env -------------------------------------------------------------------------------- /.env.dist: -------------------------------------------------------------------------------- 1 | # mandatory 2 | STRIPE_PUBLISHABLE_KEY=pk_test_xxxxxxxx 3 | STRIPE_SECRET_KEY=sk_test_xxxx 4 | SUCCESS_REDIRECT_URL=https://url.to.redirect/on/success 5 | 6 | # optional 7 | PAGE_TITLE="Update Card" 8 | FORM_DATA_IMAGE=/path/to/your/logo.png 9 | FORM_DATA_NAME="The name of your company or website" 10 | FORM_DATA_DESCRIPTION="A description of the product or service being purchased" 11 | FORM_DATA_PANEL_LABEL="Update Card Details" 12 | FORM_DATA_COLLECT_BILLING_ADDRESS=false 13 | FORM_DATA_LABEL="Update Card Details" 14 | FORM_DATA_ALLOW_REMEMBER_ME=false 15 | FORM_DATA_LOCALE=auto -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | **/*.rs.bk 3 | rustup 4 | cargo 5 | .env 6 | .envrc 7 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "actix-codec" 7 | version = "0.5.1" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "617a8268e3537fe1d8c9ead925fca49ef6400927ee7bc26750e90ecee14ce4b8" 10 | dependencies = [ 11 | "bitflags 1.3.2", 12 | "bytes", 13 | "futures-core", 14 | "futures-sink", 15 | "memchr", 16 | "pin-project-lite", 17 | "tokio", 18 | "tokio-util", 19 | "tracing", 20 | ] 21 | 22 | [[package]] 23 | name = "actix-http" 24 | version = "3.3.1" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "c2079246596c18b4a33e274ae10c0e50613f4d32a4198e09c7b93771013fed74" 27 | dependencies = [ 28 | "actix-codec", 29 | "actix-rt", 30 | "actix-service", 31 | "actix-utils", 32 | "ahash 0.8.3", 33 | "base64 0.21.2", 34 | "bitflags 1.3.2", 35 | "brotli", 36 | "bytes", 37 | "bytestring", 38 | "derive_more", 39 | "encoding_rs", 40 | "flate2", 41 | "futures-core", 42 | "h2", 43 | "http", 44 | "httparse", 45 | "httpdate", 46 | "itoa", 47 | "language-tags", 48 | "local-channel", 49 | "mime", 50 | "percent-encoding", 51 | "pin-project-lite", 52 | "rand 0.8.5", 53 | "sha1", 54 | "smallvec", 55 | "tokio", 56 | "tokio-util", 57 | "tracing", 58 | "zstd", 59 | ] 60 | 61 | [[package]] 62 | name = "actix-macros" 63 | version = "0.2.3" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "465a6172cf69b960917811022d8f29bc0b7fa1398bc4f78b3c466673db1213b6" 66 | dependencies = [ 67 | "quote", 68 | "syn 1.0.109", 69 | ] 70 | 71 | [[package]] 72 | name = "actix-router" 73 | version = "0.5.1" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "d66ff4d247d2b160861fa2866457e85706833527840e4133f8f49aa423a38799" 76 | dependencies = [ 77 | "bytestring", 78 | "http", 79 | "regex", 80 | "serde", 81 | "tracing", 82 | ] 83 | 84 | [[package]] 85 | name = "actix-rt" 86 | version = "2.8.0" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" 89 | dependencies = [ 90 | "futures-core", 91 | "tokio", 92 | ] 93 | 94 | [[package]] 95 | name = "actix-server" 96 | version = "2.2.0" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "3e8613a75dd50cc45f473cee3c34d59ed677c0f7b44480ce3b8247d7dc519327" 99 | dependencies = [ 100 | "actix-rt", 101 | "actix-service", 102 | "actix-utils", 103 | "futures-core", 104 | "futures-util", 105 | "mio", 106 | "num_cpus", 107 | "socket2", 108 | "tokio", 109 | "tracing", 110 | ] 111 | 112 | [[package]] 113 | name = "actix-service" 114 | version = "2.0.2" 115 | source = "registry+https://github.com/rust-lang/crates.io-index" 116 | checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" 117 | dependencies = [ 118 | "futures-core", 119 | "paste", 120 | "pin-project-lite", 121 | ] 122 | 123 | [[package]] 124 | name = "actix-utils" 125 | version = "3.0.1" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "88a1dcdff1466e3c2488e1cb5c36a71822750ad43839937f85d2f4d9f8b705d8" 128 | dependencies = [ 129 | "local-waker", 130 | "pin-project-lite", 131 | ] 132 | 133 | [[package]] 134 | name = "actix-web" 135 | version = "4.3.1" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "cd3cb42f9566ab176e1ef0b8b3a896529062b4efc6be0123046095914c4c1c96" 138 | dependencies = [ 139 | "actix-codec", 140 | "actix-http", 141 | "actix-macros", 142 | "actix-router", 143 | "actix-rt", 144 | "actix-server", 145 | "actix-service", 146 | "actix-utils", 147 | "actix-web-codegen", 148 | "ahash 0.7.6", 149 | "bytes", 150 | "bytestring", 151 | "cfg-if", 152 | "cookie", 153 | "derive_more", 154 | "encoding_rs", 155 | "futures-core", 156 | "futures-util", 157 | "http", 158 | "itoa", 159 | "language-tags", 160 | "log", 161 | "mime", 162 | "once_cell", 163 | "pin-project-lite", 164 | "regex", 165 | "serde", 166 | "serde_json", 167 | "serde_urlencoded", 168 | "smallvec", 169 | "socket2", 170 | "time", 171 | "url", 172 | ] 173 | 174 | [[package]] 175 | name = "actix-web-codegen" 176 | version = "4.2.0" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "2262160a7ae29e3415554a3f1fc04c764b1540c116aa524683208078b7a75bc9" 179 | dependencies = [ 180 | "actix-router", 181 | "proc-macro2", 182 | "quote", 183 | "syn 1.0.109", 184 | ] 185 | 186 | [[package]] 187 | name = "addr2line" 188 | version = "0.20.0" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" 191 | dependencies = [ 192 | "gimli", 193 | ] 194 | 195 | [[package]] 196 | name = "adler" 197 | version = "1.0.2" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 200 | 201 | [[package]] 202 | name = "ahash" 203 | version = "0.7.6" 204 | source = "registry+https://github.com/rust-lang/crates.io-index" 205 | checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" 206 | dependencies = [ 207 | "getrandom 0.2.10", 208 | "once_cell", 209 | "version_check", 210 | ] 211 | 212 | [[package]] 213 | name = "ahash" 214 | version = "0.8.3" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" 217 | dependencies = [ 218 | "cfg-if", 219 | "getrandom 0.2.10", 220 | "once_cell", 221 | "version_check", 222 | ] 223 | 224 | [[package]] 225 | name = "aho-corasick" 226 | version = "1.0.2" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" 229 | dependencies = [ 230 | "memchr", 231 | ] 232 | 233 | [[package]] 234 | name = "alloc-no-stdlib" 235 | version = "2.0.4" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" 238 | 239 | [[package]] 240 | name = "alloc-stdlib" 241 | version = "0.2.2" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" 244 | dependencies = [ 245 | "alloc-no-stdlib", 246 | ] 247 | 248 | [[package]] 249 | name = "android-tzdata" 250 | version = "0.1.1" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 253 | 254 | [[package]] 255 | name = "android_system_properties" 256 | version = "0.1.5" 257 | source = "registry+https://github.com/rust-lang/crates.io-index" 258 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 259 | dependencies = [ 260 | "libc", 261 | ] 262 | 263 | [[package]] 264 | name = "anyhow" 265 | version = "1.0.72" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" 268 | 269 | [[package]] 270 | name = "async-channel" 271 | version = "1.9.0" 272 | source = "registry+https://github.com/rust-lang/crates.io-index" 273 | checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" 274 | dependencies = [ 275 | "concurrent-queue", 276 | "event-listener", 277 | "futures-core", 278 | ] 279 | 280 | [[package]] 281 | name = "async-stripe" 282 | version = "0.22.2" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "b313de0d654c4c4c46faa737b2257ce9ed79e69926aa4c734b9816be20102b2c" 285 | dependencies = [ 286 | "chrono", 287 | "futures-util", 288 | "hex", 289 | "hmac", 290 | "http-types", 291 | "hyper", 292 | "hyper-tls", 293 | "serde", 294 | "serde_json", 295 | "serde_path_to_error", 296 | "serde_qs 0.10.1", 297 | "sha2", 298 | "smart-default", 299 | "smol_str", 300 | "thiserror", 301 | "time-core", 302 | "tokio", 303 | "uuid", 304 | ] 305 | 306 | [[package]] 307 | name = "autocfg" 308 | version = "1.1.0" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 311 | 312 | [[package]] 313 | name = "backtrace" 314 | version = "0.3.68" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" 317 | dependencies = [ 318 | "addr2line", 319 | "cc", 320 | "cfg-if", 321 | "libc", 322 | "miniz_oxide", 323 | "object", 324 | "rustc-demangle", 325 | ] 326 | 327 | [[package]] 328 | name = "base64" 329 | version = "0.13.1" 330 | source = "registry+https://github.com/rust-lang/crates.io-index" 331 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 332 | 333 | [[package]] 334 | name = "base64" 335 | version = "0.21.2" 336 | source = "registry+https://github.com/rust-lang/crates.io-index" 337 | checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" 338 | 339 | [[package]] 340 | name = "bitflags" 341 | version = "1.3.2" 342 | source = "registry+https://github.com/rust-lang/crates.io-index" 343 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 344 | 345 | [[package]] 346 | name = "bitflags" 347 | version = "2.3.3" 348 | source = "registry+https://github.com/rust-lang/crates.io-index" 349 | checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" 350 | 351 | [[package]] 352 | name = "block-buffer" 353 | version = "0.10.4" 354 | source = "registry+https://github.com/rust-lang/crates.io-index" 355 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 356 | dependencies = [ 357 | "generic-array", 358 | ] 359 | 360 | [[package]] 361 | name = "brotli" 362 | version = "3.3.4" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" 365 | dependencies = [ 366 | "alloc-no-stdlib", 367 | "alloc-stdlib", 368 | "brotli-decompressor", 369 | ] 370 | 371 | [[package]] 372 | name = "brotli-decompressor" 373 | version = "2.3.4" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" 376 | dependencies = [ 377 | "alloc-no-stdlib", 378 | "alloc-stdlib", 379 | ] 380 | 381 | [[package]] 382 | name = "bumpalo" 383 | version = "3.13.0" 384 | source = "registry+https://github.com/rust-lang/crates.io-index" 385 | checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" 386 | 387 | [[package]] 388 | name = "bytes" 389 | version = "1.4.0" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 392 | 393 | [[package]] 394 | name = "bytestring" 395 | version = "1.3.0" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "238e4886760d98c4f899360c834fa93e62cf7f721ac3c2da375cbdf4b8679aae" 398 | dependencies = [ 399 | "bytes", 400 | ] 401 | 402 | [[package]] 403 | name = "cc" 404 | version = "1.0.79" 405 | source = "registry+https://github.com/rust-lang/crates.io-index" 406 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 407 | dependencies = [ 408 | "jobserver", 409 | ] 410 | 411 | [[package]] 412 | name = "cfg-if" 413 | version = "1.0.0" 414 | source = "registry+https://github.com/rust-lang/crates.io-index" 415 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 416 | 417 | [[package]] 418 | name = "chrono" 419 | version = "0.4.26" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" 422 | dependencies = [ 423 | "android-tzdata", 424 | "iana-time-zone", 425 | "num-traits", 426 | "serde", 427 | "winapi", 428 | ] 429 | 430 | [[package]] 431 | name = "concurrent-queue" 432 | version = "2.2.0" 433 | source = "registry+https://github.com/rust-lang/crates.io-index" 434 | checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" 435 | dependencies = [ 436 | "crossbeam-utils", 437 | ] 438 | 439 | [[package]] 440 | name = "convert_case" 441 | version = "0.4.0" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" 444 | 445 | [[package]] 446 | name = "cookie" 447 | version = "0.16.2" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb" 450 | dependencies = [ 451 | "percent-encoding", 452 | "time", 453 | "version_check", 454 | ] 455 | 456 | [[package]] 457 | name = "core-foundation" 458 | version = "0.9.3" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" 461 | dependencies = [ 462 | "core-foundation-sys", 463 | "libc", 464 | ] 465 | 466 | [[package]] 467 | name = "core-foundation-sys" 468 | version = "0.8.4" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" 471 | 472 | [[package]] 473 | name = "cpufeatures" 474 | version = "0.2.9" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" 477 | dependencies = [ 478 | "libc", 479 | ] 480 | 481 | [[package]] 482 | name = "crc32fast" 483 | version = "1.3.2" 484 | source = "registry+https://github.com/rust-lang/crates.io-index" 485 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 486 | dependencies = [ 487 | "cfg-if", 488 | ] 489 | 490 | [[package]] 491 | name = "crossbeam-utils" 492 | version = "0.8.16" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" 495 | dependencies = [ 496 | "cfg-if", 497 | ] 498 | 499 | [[package]] 500 | name = "crypto-common" 501 | version = "0.1.6" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 504 | dependencies = [ 505 | "generic-array", 506 | "typenum", 507 | ] 508 | 509 | [[package]] 510 | name = "derive_more" 511 | version = "0.99.17" 512 | source = "registry+https://github.com/rust-lang/crates.io-index" 513 | checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" 514 | dependencies = [ 515 | "convert_case", 516 | "proc-macro2", 517 | "quote", 518 | "rustc_version", 519 | "syn 1.0.109", 520 | ] 521 | 522 | [[package]] 523 | name = "digest" 524 | version = "0.10.7" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 527 | dependencies = [ 528 | "block-buffer", 529 | "crypto-common", 530 | "subtle", 531 | ] 532 | 533 | [[package]] 534 | name = "encoding_rs" 535 | version = "0.8.32" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 538 | dependencies = [ 539 | "cfg-if", 540 | ] 541 | 542 | [[package]] 543 | name = "env_logger" 544 | version = "0.10.0" 545 | source = "registry+https://github.com/rust-lang/crates.io-index" 546 | checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" 547 | dependencies = [ 548 | "humantime", 549 | "is-terminal", 550 | "log", 551 | "regex", 552 | "termcolor", 553 | ] 554 | 555 | [[package]] 556 | name = "errno" 557 | version = "0.3.1" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" 560 | dependencies = [ 561 | "errno-dragonfly", 562 | "libc", 563 | "windows-sys", 564 | ] 565 | 566 | [[package]] 567 | name = "errno-dragonfly" 568 | version = "0.1.2" 569 | source = "registry+https://github.com/rust-lang/crates.io-index" 570 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 571 | dependencies = [ 572 | "cc", 573 | "libc", 574 | ] 575 | 576 | [[package]] 577 | name = "event-listener" 578 | version = "2.5.3" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" 581 | 582 | [[package]] 583 | name = "fastrand" 584 | version = "1.9.0" 585 | source = "registry+https://github.com/rust-lang/crates.io-index" 586 | checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" 587 | dependencies = [ 588 | "instant", 589 | ] 590 | 591 | [[package]] 592 | name = "flate2" 593 | version = "1.0.26" 594 | source = "registry+https://github.com/rust-lang/crates.io-index" 595 | checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" 596 | dependencies = [ 597 | "crc32fast", 598 | "miniz_oxide", 599 | ] 600 | 601 | [[package]] 602 | name = "fnv" 603 | version = "1.0.7" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 606 | 607 | [[package]] 608 | name = "foreign-types" 609 | version = "0.3.2" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 612 | dependencies = [ 613 | "foreign-types-shared", 614 | ] 615 | 616 | [[package]] 617 | name = "foreign-types-shared" 618 | version = "0.1.1" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 621 | 622 | [[package]] 623 | name = "form_urlencoded" 624 | version = "1.2.0" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" 627 | dependencies = [ 628 | "percent-encoding", 629 | ] 630 | 631 | [[package]] 632 | name = "futures-channel" 633 | version = "0.3.28" 634 | source = "registry+https://github.com/rust-lang/crates.io-index" 635 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 636 | dependencies = [ 637 | "futures-core", 638 | ] 639 | 640 | [[package]] 641 | name = "futures-core" 642 | version = "0.3.28" 643 | source = "registry+https://github.com/rust-lang/crates.io-index" 644 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 645 | 646 | [[package]] 647 | name = "futures-io" 648 | version = "0.3.28" 649 | source = "registry+https://github.com/rust-lang/crates.io-index" 650 | checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" 651 | 652 | [[package]] 653 | name = "futures-lite" 654 | version = "1.13.0" 655 | source = "registry+https://github.com/rust-lang/crates.io-index" 656 | checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" 657 | dependencies = [ 658 | "fastrand", 659 | "futures-core", 660 | "futures-io", 661 | "memchr", 662 | "parking", 663 | "pin-project-lite", 664 | "waker-fn", 665 | ] 666 | 667 | [[package]] 668 | name = "futures-macro" 669 | version = "0.3.28" 670 | source = "registry+https://github.com/rust-lang/crates.io-index" 671 | checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" 672 | dependencies = [ 673 | "proc-macro2", 674 | "quote", 675 | "syn 2.0.26", 676 | ] 677 | 678 | [[package]] 679 | name = "futures-sink" 680 | version = "0.3.28" 681 | source = "registry+https://github.com/rust-lang/crates.io-index" 682 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 683 | 684 | [[package]] 685 | name = "futures-task" 686 | version = "0.3.28" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 689 | 690 | [[package]] 691 | name = "futures-util" 692 | version = "0.3.28" 693 | source = "registry+https://github.com/rust-lang/crates.io-index" 694 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 695 | dependencies = [ 696 | "futures-core", 697 | "futures-macro", 698 | "futures-task", 699 | "pin-project-lite", 700 | "pin-utils", 701 | "slab", 702 | ] 703 | 704 | [[package]] 705 | name = "generic-array" 706 | version = "0.14.7" 707 | source = "registry+https://github.com/rust-lang/crates.io-index" 708 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 709 | dependencies = [ 710 | "typenum", 711 | "version_check", 712 | ] 713 | 714 | [[package]] 715 | name = "getrandom" 716 | version = "0.1.16" 717 | source = "registry+https://github.com/rust-lang/crates.io-index" 718 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 719 | dependencies = [ 720 | "cfg-if", 721 | "libc", 722 | "wasi 0.9.0+wasi-snapshot-preview1", 723 | ] 724 | 725 | [[package]] 726 | name = "getrandom" 727 | version = "0.2.10" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" 730 | dependencies = [ 731 | "cfg-if", 732 | "libc", 733 | "wasi 0.11.0+wasi-snapshot-preview1", 734 | ] 735 | 736 | [[package]] 737 | name = "gimli" 738 | version = "0.27.3" 739 | source = "registry+https://github.com/rust-lang/crates.io-index" 740 | checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" 741 | 742 | [[package]] 743 | name = "h2" 744 | version = "0.3.20" 745 | source = "registry+https://github.com/rust-lang/crates.io-index" 746 | checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" 747 | dependencies = [ 748 | "bytes", 749 | "fnv", 750 | "futures-core", 751 | "futures-sink", 752 | "futures-util", 753 | "http", 754 | "indexmap", 755 | "slab", 756 | "tokio", 757 | "tokio-util", 758 | "tracing", 759 | ] 760 | 761 | [[package]] 762 | name = "handlebars" 763 | version = "4.3.7" 764 | source = "registry+https://github.com/rust-lang/crates.io-index" 765 | checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" 766 | dependencies = [ 767 | "log", 768 | "pest", 769 | "pest_derive", 770 | "serde", 771 | "serde_json", 772 | "thiserror", 773 | "walkdir", 774 | ] 775 | 776 | [[package]] 777 | name = "hashbrown" 778 | version = "0.12.3" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 781 | 782 | [[package]] 783 | name = "hermit-abi" 784 | version = "0.3.2" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" 787 | 788 | [[package]] 789 | name = "hex" 790 | version = "0.4.3" 791 | source = "registry+https://github.com/rust-lang/crates.io-index" 792 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 793 | 794 | [[package]] 795 | name = "hmac" 796 | version = "0.12.1" 797 | source = "registry+https://github.com/rust-lang/crates.io-index" 798 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 799 | dependencies = [ 800 | "digest", 801 | ] 802 | 803 | [[package]] 804 | name = "http" 805 | version = "0.2.9" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 808 | dependencies = [ 809 | "bytes", 810 | "fnv", 811 | "itoa", 812 | ] 813 | 814 | [[package]] 815 | name = "http-body" 816 | version = "0.4.5" 817 | source = "registry+https://github.com/rust-lang/crates.io-index" 818 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 819 | dependencies = [ 820 | "bytes", 821 | "http", 822 | "pin-project-lite", 823 | ] 824 | 825 | [[package]] 826 | name = "http-types" 827 | version = "2.12.0" 828 | source = "registry+https://github.com/rust-lang/crates.io-index" 829 | checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" 830 | dependencies = [ 831 | "anyhow", 832 | "async-channel", 833 | "base64 0.13.1", 834 | "futures-lite", 835 | "http", 836 | "infer", 837 | "pin-project-lite", 838 | "rand 0.7.3", 839 | "serde", 840 | "serde_json", 841 | "serde_qs 0.8.5", 842 | "serde_urlencoded", 843 | "url", 844 | ] 845 | 846 | [[package]] 847 | name = "httparse" 848 | version = "1.8.0" 849 | source = "registry+https://github.com/rust-lang/crates.io-index" 850 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 851 | 852 | [[package]] 853 | name = "httpdate" 854 | version = "1.0.2" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 857 | 858 | [[package]] 859 | name = "humantime" 860 | version = "2.1.0" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 863 | 864 | [[package]] 865 | name = "hyper" 866 | version = "0.14.27" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" 869 | dependencies = [ 870 | "bytes", 871 | "futures-channel", 872 | "futures-core", 873 | "futures-util", 874 | "h2", 875 | "http", 876 | "http-body", 877 | "httparse", 878 | "httpdate", 879 | "itoa", 880 | "pin-project-lite", 881 | "socket2", 882 | "tokio", 883 | "tower-service", 884 | "tracing", 885 | "want", 886 | ] 887 | 888 | [[package]] 889 | name = "hyper-tls" 890 | version = "0.5.0" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 893 | dependencies = [ 894 | "bytes", 895 | "hyper", 896 | "native-tls", 897 | "tokio", 898 | "tokio-native-tls", 899 | ] 900 | 901 | [[package]] 902 | name = "iana-time-zone" 903 | version = "0.1.57" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" 906 | dependencies = [ 907 | "android_system_properties", 908 | "core-foundation-sys", 909 | "iana-time-zone-haiku", 910 | "js-sys", 911 | "wasm-bindgen", 912 | "windows", 913 | ] 914 | 915 | [[package]] 916 | name = "iana-time-zone-haiku" 917 | version = "0.1.2" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 920 | dependencies = [ 921 | "cc", 922 | ] 923 | 924 | [[package]] 925 | name = "idna" 926 | version = "0.4.0" 927 | source = "registry+https://github.com/rust-lang/crates.io-index" 928 | checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" 929 | dependencies = [ 930 | "unicode-bidi", 931 | "unicode-normalization", 932 | ] 933 | 934 | [[package]] 935 | name = "indexmap" 936 | version = "1.9.3" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 939 | dependencies = [ 940 | "autocfg", 941 | "hashbrown", 942 | ] 943 | 944 | [[package]] 945 | name = "infer" 946 | version = "0.2.3" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" 949 | 950 | [[package]] 951 | name = "instant" 952 | version = "0.1.12" 953 | source = "registry+https://github.com/rust-lang/crates.io-index" 954 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 955 | dependencies = [ 956 | "cfg-if", 957 | ] 958 | 959 | [[package]] 960 | name = "io-lifetimes" 961 | version = "1.0.11" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" 964 | dependencies = [ 965 | "hermit-abi", 966 | "libc", 967 | "windows-sys", 968 | ] 969 | 970 | [[package]] 971 | name = "is-terminal" 972 | version = "0.4.9" 973 | source = "registry+https://github.com/rust-lang/crates.io-index" 974 | checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" 975 | dependencies = [ 976 | "hermit-abi", 977 | "rustix 0.38.4", 978 | "windows-sys", 979 | ] 980 | 981 | [[package]] 982 | name = "itoa" 983 | version = "1.0.9" 984 | source = "registry+https://github.com/rust-lang/crates.io-index" 985 | checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" 986 | 987 | [[package]] 988 | name = "jobserver" 989 | version = "0.1.26" 990 | source = "registry+https://github.com/rust-lang/crates.io-index" 991 | checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" 992 | dependencies = [ 993 | "libc", 994 | ] 995 | 996 | [[package]] 997 | name = "js-sys" 998 | version = "0.3.64" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" 1001 | dependencies = [ 1002 | "wasm-bindgen", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "language-tags" 1007 | version = "0.3.2" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" 1010 | 1011 | [[package]] 1012 | name = "lazy_static" 1013 | version = "1.4.0" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 1016 | 1017 | [[package]] 1018 | name = "libc" 1019 | version = "0.2.147" 1020 | source = "registry+https://github.com/rust-lang/crates.io-index" 1021 | checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" 1022 | 1023 | [[package]] 1024 | name = "linux-raw-sys" 1025 | version = "0.3.8" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" 1028 | 1029 | [[package]] 1030 | name = "linux-raw-sys" 1031 | version = "0.4.3" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" 1034 | 1035 | [[package]] 1036 | name = "local-channel" 1037 | version = "0.1.3" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | checksum = "7f303ec0e94c6c54447f84f3b0ef7af769858a9c4ef56ef2a986d3dcd4c3fc9c" 1040 | dependencies = [ 1041 | "futures-core", 1042 | "futures-sink", 1043 | "futures-util", 1044 | "local-waker", 1045 | ] 1046 | 1047 | [[package]] 1048 | name = "local-waker" 1049 | version = "0.1.3" 1050 | source = "registry+https://github.com/rust-lang/crates.io-index" 1051 | checksum = "e34f76eb3611940e0e7d53a9aaa4e6a3151f69541a282fd0dad5571420c53ff1" 1052 | 1053 | [[package]] 1054 | name = "lock_api" 1055 | version = "0.4.10" 1056 | source = "registry+https://github.com/rust-lang/crates.io-index" 1057 | checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" 1058 | dependencies = [ 1059 | "autocfg", 1060 | "scopeguard", 1061 | ] 1062 | 1063 | [[package]] 1064 | name = "log" 1065 | version = "0.4.19" 1066 | source = "registry+https://github.com/rust-lang/crates.io-index" 1067 | checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" 1068 | 1069 | [[package]] 1070 | name = "memchr" 1071 | version = "2.5.0" 1072 | source = "registry+https://github.com/rust-lang/crates.io-index" 1073 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 1074 | 1075 | [[package]] 1076 | name = "mime" 1077 | version = "0.3.17" 1078 | source = "registry+https://github.com/rust-lang/crates.io-index" 1079 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 1080 | 1081 | [[package]] 1082 | name = "miniz_oxide" 1083 | version = "0.7.1" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 1086 | dependencies = [ 1087 | "adler", 1088 | ] 1089 | 1090 | [[package]] 1091 | name = "mio" 1092 | version = "0.8.8" 1093 | source = "registry+https://github.com/rust-lang/crates.io-index" 1094 | checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" 1095 | dependencies = [ 1096 | "libc", 1097 | "log", 1098 | "wasi 0.11.0+wasi-snapshot-preview1", 1099 | "windows-sys", 1100 | ] 1101 | 1102 | [[package]] 1103 | name = "native-tls" 1104 | version = "0.2.11" 1105 | source = "registry+https://github.com/rust-lang/crates.io-index" 1106 | checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" 1107 | dependencies = [ 1108 | "lazy_static", 1109 | "libc", 1110 | "log", 1111 | "openssl", 1112 | "openssl-probe", 1113 | "openssl-sys", 1114 | "schannel", 1115 | "security-framework", 1116 | "security-framework-sys", 1117 | "tempfile", 1118 | ] 1119 | 1120 | [[package]] 1121 | name = "num-traits" 1122 | version = "0.2.15" 1123 | source = "registry+https://github.com/rust-lang/crates.io-index" 1124 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 1125 | dependencies = [ 1126 | "autocfg", 1127 | ] 1128 | 1129 | [[package]] 1130 | name = "num_cpus" 1131 | version = "1.16.0" 1132 | source = "registry+https://github.com/rust-lang/crates.io-index" 1133 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 1134 | dependencies = [ 1135 | "hermit-abi", 1136 | "libc", 1137 | ] 1138 | 1139 | [[package]] 1140 | name = "object" 1141 | version = "0.31.1" 1142 | source = "registry+https://github.com/rust-lang/crates.io-index" 1143 | checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" 1144 | dependencies = [ 1145 | "memchr", 1146 | ] 1147 | 1148 | [[package]] 1149 | name = "once_cell" 1150 | version = "1.18.0" 1151 | source = "registry+https://github.com/rust-lang/crates.io-index" 1152 | checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" 1153 | 1154 | [[package]] 1155 | name = "openssl" 1156 | version = "0.10.55" 1157 | source = "registry+https://github.com/rust-lang/crates.io-index" 1158 | checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" 1159 | dependencies = [ 1160 | "bitflags 1.3.2", 1161 | "cfg-if", 1162 | "foreign-types", 1163 | "libc", 1164 | "once_cell", 1165 | "openssl-macros", 1166 | "openssl-sys", 1167 | ] 1168 | 1169 | [[package]] 1170 | name = "openssl-macros" 1171 | version = "0.1.1" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 1174 | dependencies = [ 1175 | "proc-macro2", 1176 | "quote", 1177 | "syn 2.0.26", 1178 | ] 1179 | 1180 | [[package]] 1181 | name = "openssl-probe" 1182 | version = "0.1.5" 1183 | source = "registry+https://github.com/rust-lang/crates.io-index" 1184 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 1185 | 1186 | [[package]] 1187 | name = "openssl-sys" 1188 | version = "0.9.90" 1189 | source = "registry+https://github.com/rust-lang/crates.io-index" 1190 | checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" 1191 | dependencies = [ 1192 | "cc", 1193 | "libc", 1194 | "pkg-config", 1195 | "vcpkg", 1196 | ] 1197 | 1198 | [[package]] 1199 | name = "parking" 1200 | version = "2.1.0" 1201 | source = "registry+https://github.com/rust-lang/crates.io-index" 1202 | checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" 1203 | 1204 | [[package]] 1205 | name = "parking_lot" 1206 | version = "0.12.1" 1207 | source = "registry+https://github.com/rust-lang/crates.io-index" 1208 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 1209 | dependencies = [ 1210 | "lock_api", 1211 | "parking_lot_core", 1212 | ] 1213 | 1214 | [[package]] 1215 | name = "parking_lot_core" 1216 | version = "0.9.8" 1217 | source = "registry+https://github.com/rust-lang/crates.io-index" 1218 | checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" 1219 | dependencies = [ 1220 | "cfg-if", 1221 | "libc", 1222 | "redox_syscall", 1223 | "smallvec", 1224 | "windows-targets", 1225 | ] 1226 | 1227 | [[package]] 1228 | name = "paste" 1229 | version = "1.0.14" 1230 | source = "registry+https://github.com/rust-lang/crates.io-index" 1231 | checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" 1232 | 1233 | [[package]] 1234 | name = "percent-encoding" 1235 | version = "2.3.0" 1236 | source = "registry+https://github.com/rust-lang/crates.io-index" 1237 | checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" 1238 | 1239 | [[package]] 1240 | name = "pest" 1241 | version = "2.7.1" 1242 | source = "registry+https://github.com/rust-lang/crates.io-index" 1243 | checksum = "0d2d1d55045829d65aad9d389139882ad623b33b904e7c9f1b10c5b8927298e5" 1244 | dependencies = [ 1245 | "thiserror", 1246 | "ucd-trie", 1247 | ] 1248 | 1249 | [[package]] 1250 | name = "pest_derive" 1251 | version = "2.7.1" 1252 | source = "registry+https://github.com/rust-lang/crates.io-index" 1253 | checksum = "5f94bca7e7a599d89dea5dfa309e217e7906c3c007fb9c3299c40b10d6a315d3" 1254 | dependencies = [ 1255 | "pest", 1256 | "pest_generator", 1257 | ] 1258 | 1259 | [[package]] 1260 | name = "pest_generator" 1261 | version = "2.7.1" 1262 | source = "registry+https://github.com/rust-lang/crates.io-index" 1263 | checksum = "99d490fe7e8556575ff6911e45567ab95e71617f43781e5c05490dc8d75c965c" 1264 | dependencies = [ 1265 | "pest", 1266 | "pest_meta", 1267 | "proc-macro2", 1268 | "quote", 1269 | "syn 2.0.26", 1270 | ] 1271 | 1272 | [[package]] 1273 | name = "pest_meta" 1274 | version = "2.7.1" 1275 | source = "registry+https://github.com/rust-lang/crates.io-index" 1276 | checksum = "2674c66ebb4b4d9036012091b537aae5878970d6999f81a265034d85b136b341" 1277 | dependencies = [ 1278 | "once_cell", 1279 | "pest", 1280 | "sha2", 1281 | ] 1282 | 1283 | [[package]] 1284 | name = "pin-project-lite" 1285 | version = "0.2.10" 1286 | source = "registry+https://github.com/rust-lang/crates.io-index" 1287 | checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" 1288 | 1289 | [[package]] 1290 | name = "pin-utils" 1291 | version = "0.1.0" 1292 | source = "registry+https://github.com/rust-lang/crates.io-index" 1293 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1294 | 1295 | [[package]] 1296 | name = "pkg-config" 1297 | version = "0.3.27" 1298 | source = "registry+https://github.com/rust-lang/crates.io-index" 1299 | checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" 1300 | 1301 | [[package]] 1302 | name = "ppv-lite86" 1303 | version = "0.2.17" 1304 | source = "registry+https://github.com/rust-lang/crates.io-index" 1305 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1306 | 1307 | [[package]] 1308 | name = "proc-macro2" 1309 | version = "1.0.66" 1310 | source = "registry+https://github.com/rust-lang/crates.io-index" 1311 | checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" 1312 | dependencies = [ 1313 | "unicode-ident", 1314 | ] 1315 | 1316 | [[package]] 1317 | name = "quote" 1318 | version = "1.0.31" 1319 | source = "registry+https://github.com/rust-lang/crates.io-index" 1320 | checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" 1321 | dependencies = [ 1322 | "proc-macro2", 1323 | ] 1324 | 1325 | [[package]] 1326 | name = "rand" 1327 | version = "0.7.3" 1328 | source = "registry+https://github.com/rust-lang/crates.io-index" 1329 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1330 | dependencies = [ 1331 | "getrandom 0.1.16", 1332 | "libc", 1333 | "rand_chacha 0.2.2", 1334 | "rand_core 0.5.1", 1335 | "rand_hc", 1336 | ] 1337 | 1338 | [[package]] 1339 | name = "rand" 1340 | version = "0.8.5" 1341 | source = "registry+https://github.com/rust-lang/crates.io-index" 1342 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1343 | dependencies = [ 1344 | "libc", 1345 | "rand_chacha 0.3.1", 1346 | "rand_core 0.6.4", 1347 | ] 1348 | 1349 | [[package]] 1350 | name = "rand_chacha" 1351 | version = "0.2.2" 1352 | source = "registry+https://github.com/rust-lang/crates.io-index" 1353 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1354 | dependencies = [ 1355 | "ppv-lite86", 1356 | "rand_core 0.5.1", 1357 | ] 1358 | 1359 | [[package]] 1360 | name = "rand_chacha" 1361 | version = "0.3.1" 1362 | source = "registry+https://github.com/rust-lang/crates.io-index" 1363 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1364 | dependencies = [ 1365 | "ppv-lite86", 1366 | "rand_core 0.6.4", 1367 | ] 1368 | 1369 | [[package]] 1370 | name = "rand_core" 1371 | version = "0.5.1" 1372 | source = "registry+https://github.com/rust-lang/crates.io-index" 1373 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1374 | dependencies = [ 1375 | "getrandom 0.1.16", 1376 | ] 1377 | 1378 | [[package]] 1379 | name = "rand_core" 1380 | version = "0.6.4" 1381 | source = "registry+https://github.com/rust-lang/crates.io-index" 1382 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1383 | dependencies = [ 1384 | "getrandom 0.2.10", 1385 | ] 1386 | 1387 | [[package]] 1388 | name = "rand_hc" 1389 | version = "0.2.0" 1390 | source = "registry+https://github.com/rust-lang/crates.io-index" 1391 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1392 | dependencies = [ 1393 | "rand_core 0.5.1", 1394 | ] 1395 | 1396 | [[package]] 1397 | name = "redox_syscall" 1398 | version = "0.3.5" 1399 | source = "registry+https://github.com/rust-lang/crates.io-index" 1400 | checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 1401 | dependencies = [ 1402 | "bitflags 1.3.2", 1403 | ] 1404 | 1405 | [[package]] 1406 | name = "regex" 1407 | version = "1.9.1" 1408 | source = "registry+https://github.com/rust-lang/crates.io-index" 1409 | checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" 1410 | dependencies = [ 1411 | "aho-corasick", 1412 | "memchr", 1413 | "regex-automata", 1414 | "regex-syntax", 1415 | ] 1416 | 1417 | [[package]] 1418 | name = "regex-automata" 1419 | version = "0.3.3" 1420 | source = "registry+https://github.com/rust-lang/crates.io-index" 1421 | checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" 1422 | dependencies = [ 1423 | "aho-corasick", 1424 | "memchr", 1425 | "regex-syntax", 1426 | ] 1427 | 1428 | [[package]] 1429 | name = "regex-syntax" 1430 | version = "0.7.4" 1431 | source = "registry+https://github.com/rust-lang/crates.io-index" 1432 | checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" 1433 | 1434 | [[package]] 1435 | name = "rustc-demangle" 1436 | version = "0.1.23" 1437 | source = "registry+https://github.com/rust-lang/crates.io-index" 1438 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 1439 | 1440 | [[package]] 1441 | name = "rustc_version" 1442 | version = "0.4.0" 1443 | source = "registry+https://github.com/rust-lang/crates.io-index" 1444 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 1445 | dependencies = [ 1446 | "semver", 1447 | ] 1448 | 1449 | [[package]] 1450 | name = "rustix" 1451 | version = "0.37.23" 1452 | source = "registry+https://github.com/rust-lang/crates.io-index" 1453 | checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" 1454 | dependencies = [ 1455 | "bitflags 1.3.2", 1456 | "errno", 1457 | "io-lifetimes", 1458 | "libc", 1459 | "linux-raw-sys 0.3.8", 1460 | "windows-sys", 1461 | ] 1462 | 1463 | [[package]] 1464 | name = "rustix" 1465 | version = "0.38.4" 1466 | source = "registry+https://github.com/rust-lang/crates.io-index" 1467 | checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" 1468 | dependencies = [ 1469 | "bitflags 2.3.3", 1470 | "errno", 1471 | "libc", 1472 | "linux-raw-sys 0.4.3", 1473 | "windows-sys", 1474 | ] 1475 | 1476 | [[package]] 1477 | name = "ryu" 1478 | version = "1.0.0" 1479 | source = "registry+https://github.com/rust-lang/crates.io-index" 1480 | checksum = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" 1481 | 1482 | [[package]] 1483 | name = "same-file" 1484 | version = "1.0.6" 1485 | source = "registry+https://github.com/rust-lang/crates.io-index" 1486 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1487 | dependencies = [ 1488 | "winapi-util", 1489 | ] 1490 | 1491 | [[package]] 1492 | name = "schannel" 1493 | version = "0.1.22" 1494 | source = "registry+https://github.com/rust-lang/crates.io-index" 1495 | checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" 1496 | dependencies = [ 1497 | "windows-sys", 1498 | ] 1499 | 1500 | [[package]] 1501 | name = "scopeguard" 1502 | version = "1.2.0" 1503 | source = "registry+https://github.com/rust-lang/crates.io-index" 1504 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1505 | 1506 | [[package]] 1507 | name = "security-framework" 1508 | version = "2.9.1" 1509 | source = "registry+https://github.com/rust-lang/crates.io-index" 1510 | checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" 1511 | dependencies = [ 1512 | "bitflags 1.3.2", 1513 | "core-foundation", 1514 | "core-foundation-sys", 1515 | "libc", 1516 | "security-framework-sys", 1517 | ] 1518 | 1519 | [[package]] 1520 | name = "security-framework-sys" 1521 | version = "2.9.0" 1522 | source = "registry+https://github.com/rust-lang/crates.io-index" 1523 | checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" 1524 | dependencies = [ 1525 | "core-foundation-sys", 1526 | "libc", 1527 | ] 1528 | 1529 | [[package]] 1530 | name = "semver" 1531 | version = "1.0.18" 1532 | source = "registry+https://github.com/rust-lang/crates.io-index" 1533 | checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" 1534 | 1535 | [[package]] 1536 | name = "serde" 1537 | version = "1.0.171" 1538 | source = "registry+https://github.com/rust-lang/crates.io-index" 1539 | checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" 1540 | dependencies = [ 1541 | "serde_derive", 1542 | ] 1543 | 1544 | [[package]] 1545 | name = "serde_derive" 1546 | version = "1.0.171" 1547 | source = "registry+https://github.com/rust-lang/crates.io-index" 1548 | checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" 1549 | dependencies = [ 1550 | "proc-macro2", 1551 | "quote", 1552 | "syn 2.0.26", 1553 | ] 1554 | 1555 | [[package]] 1556 | name = "serde_json" 1557 | version = "1.0.103" 1558 | source = "registry+https://github.com/rust-lang/crates.io-index" 1559 | checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" 1560 | dependencies = [ 1561 | "itoa", 1562 | "ryu", 1563 | "serde", 1564 | ] 1565 | 1566 | [[package]] 1567 | name = "serde_path_to_error" 1568 | version = "0.1.14" 1569 | source = "registry+https://github.com/rust-lang/crates.io-index" 1570 | checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" 1571 | dependencies = [ 1572 | "itoa", 1573 | "serde", 1574 | ] 1575 | 1576 | [[package]] 1577 | name = "serde_qs" 1578 | version = "0.8.5" 1579 | source = "registry+https://github.com/rust-lang/crates.io-index" 1580 | checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" 1581 | dependencies = [ 1582 | "percent-encoding", 1583 | "serde", 1584 | "thiserror", 1585 | ] 1586 | 1587 | [[package]] 1588 | name = "serde_qs" 1589 | version = "0.10.1" 1590 | source = "registry+https://github.com/rust-lang/crates.io-index" 1591 | checksum = "8cac3f1e2ca2fe333923a1ae72caca910b98ed0630bb35ef6f8c8517d6e81afa" 1592 | dependencies = [ 1593 | "percent-encoding", 1594 | "serde", 1595 | "thiserror", 1596 | ] 1597 | 1598 | [[package]] 1599 | name = "serde_urlencoded" 1600 | version = "0.7.1" 1601 | source = "registry+https://github.com/rust-lang/crates.io-index" 1602 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1603 | dependencies = [ 1604 | "form_urlencoded", 1605 | "itoa", 1606 | "ryu", 1607 | "serde", 1608 | ] 1609 | 1610 | [[package]] 1611 | name = "sha1" 1612 | version = "0.10.5" 1613 | source = "registry+https://github.com/rust-lang/crates.io-index" 1614 | checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" 1615 | dependencies = [ 1616 | "cfg-if", 1617 | "cpufeatures", 1618 | "digest", 1619 | ] 1620 | 1621 | [[package]] 1622 | name = "sha2" 1623 | version = "0.10.7" 1624 | source = "registry+https://github.com/rust-lang/crates.io-index" 1625 | checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" 1626 | dependencies = [ 1627 | "cfg-if", 1628 | "cpufeatures", 1629 | "digest", 1630 | ] 1631 | 1632 | [[package]] 1633 | name = "signal-hook-registry" 1634 | version = "1.4.1" 1635 | source = "registry+https://github.com/rust-lang/crates.io-index" 1636 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 1637 | dependencies = [ 1638 | "libc", 1639 | ] 1640 | 1641 | [[package]] 1642 | name = "slab" 1643 | version = "0.4.8" 1644 | source = "registry+https://github.com/rust-lang/crates.io-index" 1645 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 1646 | dependencies = [ 1647 | "autocfg", 1648 | ] 1649 | 1650 | [[package]] 1651 | name = "smallvec" 1652 | version = "1.11.0" 1653 | source = "registry+https://github.com/rust-lang/crates.io-index" 1654 | checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" 1655 | 1656 | [[package]] 1657 | name = "smart-default" 1658 | version = "0.6.0" 1659 | source = "registry+https://github.com/rust-lang/crates.io-index" 1660 | checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" 1661 | dependencies = [ 1662 | "proc-macro2", 1663 | "quote", 1664 | "syn 1.0.109", 1665 | ] 1666 | 1667 | [[package]] 1668 | name = "smol_str" 1669 | version = "0.1.24" 1670 | source = "registry+https://github.com/rust-lang/crates.io-index" 1671 | checksum = "fad6c857cbab2627dcf01ec85a623ca4e7dcb5691cbaa3d7fb7653671f0d09c9" 1672 | dependencies = [ 1673 | "serde", 1674 | ] 1675 | 1676 | [[package]] 1677 | name = "socket2" 1678 | version = "0.4.9" 1679 | source = "registry+https://github.com/rust-lang/crates.io-index" 1680 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 1681 | dependencies = [ 1682 | "libc", 1683 | "winapi", 1684 | ] 1685 | 1686 | [[package]] 1687 | name = "stripe-update-card" 1688 | version = "2.0.0" 1689 | dependencies = [ 1690 | "actix-web", 1691 | "async-stripe", 1692 | "env_logger", 1693 | "handlebars", 1694 | "lazy_static", 1695 | "log", 1696 | "serde", 1697 | "serde_derive", 1698 | "serde_json", 1699 | ] 1700 | 1701 | [[package]] 1702 | name = "subtle" 1703 | version = "2.4.1" 1704 | source = "registry+https://github.com/rust-lang/crates.io-index" 1705 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 1706 | 1707 | [[package]] 1708 | name = "syn" 1709 | version = "1.0.109" 1710 | source = "registry+https://github.com/rust-lang/crates.io-index" 1711 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1712 | dependencies = [ 1713 | "proc-macro2", 1714 | "quote", 1715 | "unicode-ident", 1716 | ] 1717 | 1718 | [[package]] 1719 | name = "syn" 1720 | version = "2.0.26" 1721 | source = "registry+https://github.com/rust-lang/crates.io-index" 1722 | checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" 1723 | dependencies = [ 1724 | "proc-macro2", 1725 | "quote", 1726 | "unicode-ident", 1727 | ] 1728 | 1729 | [[package]] 1730 | name = "tempfile" 1731 | version = "3.6.0" 1732 | source = "registry+https://github.com/rust-lang/crates.io-index" 1733 | checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" 1734 | dependencies = [ 1735 | "autocfg", 1736 | "cfg-if", 1737 | "fastrand", 1738 | "redox_syscall", 1739 | "rustix 0.37.23", 1740 | "windows-sys", 1741 | ] 1742 | 1743 | [[package]] 1744 | name = "termcolor" 1745 | version = "1.2.0" 1746 | source = "registry+https://github.com/rust-lang/crates.io-index" 1747 | checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" 1748 | dependencies = [ 1749 | "winapi-util", 1750 | ] 1751 | 1752 | [[package]] 1753 | name = "thiserror" 1754 | version = "1.0.43" 1755 | source = "registry+https://github.com/rust-lang/crates.io-index" 1756 | checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" 1757 | dependencies = [ 1758 | "thiserror-impl", 1759 | ] 1760 | 1761 | [[package]] 1762 | name = "thiserror-impl" 1763 | version = "1.0.43" 1764 | source = "registry+https://github.com/rust-lang/crates.io-index" 1765 | checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" 1766 | dependencies = [ 1767 | "proc-macro2", 1768 | "quote", 1769 | "syn 2.0.26", 1770 | ] 1771 | 1772 | [[package]] 1773 | name = "time" 1774 | version = "0.3.20" 1775 | source = "registry+https://github.com/rust-lang/crates.io-index" 1776 | checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" 1777 | dependencies = [ 1778 | "itoa", 1779 | "serde", 1780 | "time-core", 1781 | "time-macros", 1782 | ] 1783 | 1784 | [[package]] 1785 | name = "time-core" 1786 | version = "0.1.0" 1787 | source = "registry+https://github.com/rust-lang/crates.io-index" 1788 | checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" 1789 | 1790 | [[package]] 1791 | name = "time-macros" 1792 | version = "0.2.8" 1793 | source = "registry+https://github.com/rust-lang/crates.io-index" 1794 | checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" 1795 | dependencies = [ 1796 | "time-core", 1797 | ] 1798 | 1799 | [[package]] 1800 | name = "tinyvec" 1801 | version = "1.6.0" 1802 | source = "registry+https://github.com/rust-lang/crates.io-index" 1803 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1804 | dependencies = [ 1805 | "tinyvec_macros", 1806 | ] 1807 | 1808 | [[package]] 1809 | name = "tinyvec_macros" 1810 | version = "0.1.1" 1811 | source = "registry+https://github.com/rust-lang/crates.io-index" 1812 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1813 | 1814 | [[package]] 1815 | name = "tokio" 1816 | version = "1.29.1" 1817 | source = "registry+https://github.com/rust-lang/crates.io-index" 1818 | checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" 1819 | dependencies = [ 1820 | "autocfg", 1821 | "backtrace", 1822 | "bytes", 1823 | "libc", 1824 | "mio", 1825 | "parking_lot", 1826 | "pin-project-lite", 1827 | "signal-hook-registry", 1828 | "socket2", 1829 | "windows-sys", 1830 | ] 1831 | 1832 | [[package]] 1833 | name = "tokio-native-tls" 1834 | version = "0.3.1" 1835 | source = "registry+https://github.com/rust-lang/crates.io-index" 1836 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1837 | dependencies = [ 1838 | "native-tls", 1839 | "tokio", 1840 | ] 1841 | 1842 | [[package]] 1843 | name = "tokio-util" 1844 | version = "0.7.8" 1845 | source = "registry+https://github.com/rust-lang/crates.io-index" 1846 | checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" 1847 | dependencies = [ 1848 | "bytes", 1849 | "futures-core", 1850 | "futures-sink", 1851 | "pin-project-lite", 1852 | "tokio", 1853 | "tracing", 1854 | ] 1855 | 1856 | [[package]] 1857 | name = "tower-service" 1858 | version = "0.3.2" 1859 | source = "registry+https://github.com/rust-lang/crates.io-index" 1860 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1861 | 1862 | [[package]] 1863 | name = "tracing" 1864 | version = "0.1.37" 1865 | source = "registry+https://github.com/rust-lang/crates.io-index" 1866 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1867 | dependencies = [ 1868 | "cfg-if", 1869 | "log", 1870 | "pin-project-lite", 1871 | "tracing-core", 1872 | ] 1873 | 1874 | [[package]] 1875 | name = "tracing-core" 1876 | version = "0.1.31" 1877 | source = "registry+https://github.com/rust-lang/crates.io-index" 1878 | checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" 1879 | dependencies = [ 1880 | "once_cell", 1881 | ] 1882 | 1883 | [[package]] 1884 | name = "try-lock" 1885 | version = "0.2.4" 1886 | source = "registry+https://github.com/rust-lang/crates.io-index" 1887 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 1888 | 1889 | [[package]] 1890 | name = "typenum" 1891 | version = "1.16.0" 1892 | source = "registry+https://github.com/rust-lang/crates.io-index" 1893 | checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" 1894 | 1895 | [[package]] 1896 | name = "ucd-trie" 1897 | version = "0.1.6" 1898 | source = "registry+https://github.com/rust-lang/crates.io-index" 1899 | checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" 1900 | 1901 | [[package]] 1902 | name = "unicode-bidi" 1903 | version = "0.3.13" 1904 | source = "registry+https://github.com/rust-lang/crates.io-index" 1905 | checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" 1906 | 1907 | [[package]] 1908 | name = "unicode-ident" 1909 | version = "1.0.11" 1910 | source = "registry+https://github.com/rust-lang/crates.io-index" 1911 | checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" 1912 | 1913 | [[package]] 1914 | name = "unicode-normalization" 1915 | version = "0.1.22" 1916 | source = "registry+https://github.com/rust-lang/crates.io-index" 1917 | checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" 1918 | dependencies = [ 1919 | "tinyvec", 1920 | ] 1921 | 1922 | [[package]] 1923 | name = "url" 1924 | version = "2.4.0" 1925 | source = "registry+https://github.com/rust-lang/crates.io-index" 1926 | checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" 1927 | dependencies = [ 1928 | "form_urlencoded", 1929 | "idna", 1930 | "percent-encoding", 1931 | "serde", 1932 | ] 1933 | 1934 | [[package]] 1935 | name = "uuid" 1936 | version = "0.8.2" 1937 | source = "registry+https://github.com/rust-lang/crates.io-index" 1938 | checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" 1939 | dependencies = [ 1940 | "getrandom 0.2.10", 1941 | ] 1942 | 1943 | [[package]] 1944 | name = "vcpkg" 1945 | version = "0.2.15" 1946 | source = "registry+https://github.com/rust-lang/crates.io-index" 1947 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1948 | 1949 | [[package]] 1950 | name = "version_check" 1951 | version = "0.9.4" 1952 | source = "registry+https://github.com/rust-lang/crates.io-index" 1953 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1954 | 1955 | [[package]] 1956 | name = "waker-fn" 1957 | version = "1.1.0" 1958 | source = "registry+https://github.com/rust-lang/crates.io-index" 1959 | checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" 1960 | 1961 | [[package]] 1962 | name = "walkdir" 1963 | version = "2.3.3" 1964 | source = "registry+https://github.com/rust-lang/crates.io-index" 1965 | checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" 1966 | dependencies = [ 1967 | "same-file", 1968 | "winapi-util", 1969 | ] 1970 | 1971 | [[package]] 1972 | name = "want" 1973 | version = "0.3.1" 1974 | source = "registry+https://github.com/rust-lang/crates.io-index" 1975 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1976 | dependencies = [ 1977 | "try-lock", 1978 | ] 1979 | 1980 | [[package]] 1981 | name = "wasi" 1982 | version = "0.9.0+wasi-snapshot-preview1" 1983 | source = "registry+https://github.com/rust-lang/crates.io-index" 1984 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1985 | 1986 | [[package]] 1987 | name = "wasi" 1988 | version = "0.11.0+wasi-snapshot-preview1" 1989 | source = "registry+https://github.com/rust-lang/crates.io-index" 1990 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1991 | 1992 | [[package]] 1993 | name = "wasm-bindgen" 1994 | version = "0.2.87" 1995 | source = "registry+https://github.com/rust-lang/crates.io-index" 1996 | checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" 1997 | dependencies = [ 1998 | "cfg-if", 1999 | "wasm-bindgen-macro", 2000 | ] 2001 | 2002 | [[package]] 2003 | name = "wasm-bindgen-backend" 2004 | version = "0.2.87" 2005 | source = "registry+https://github.com/rust-lang/crates.io-index" 2006 | checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" 2007 | dependencies = [ 2008 | "bumpalo", 2009 | "log", 2010 | "once_cell", 2011 | "proc-macro2", 2012 | "quote", 2013 | "syn 2.0.26", 2014 | "wasm-bindgen-shared", 2015 | ] 2016 | 2017 | [[package]] 2018 | name = "wasm-bindgen-macro" 2019 | version = "0.2.87" 2020 | source = "registry+https://github.com/rust-lang/crates.io-index" 2021 | checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" 2022 | dependencies = [ 2023 | "quote", 2024 | "wasm-bindgen-macro-support", 2025 | ] 2026 | 2027 | [[package]] 2028 | name = "wasm-bindgen-macro-support" 2029 | version = "0.2.87" 2030 | source = "registry+https://github.com/rust-lang/crates.io-index" 2031 | checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" 2032 | dependencies = [ 2033 | "proc-macro2", 2034 | "quote", 2035 | "syn 2.0.26", 2036 | "wasm-bindgen-backend", 2037 | "wasm-bindgen-shared", 2038 | ] 2039 | 2040 | [[package]] 2041 | name = "wasm-bindgen-shared" 2042 | version = "0.2.87" 2043 | source = "registry+https://github.com/rust-lang/crates.io-index" 2044 | checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" 2045 | 2046 | [[package]] 2047 | name = "winapi" 2048 | version = "0.3.9" 2049 | source = "registry+https://github.com/rust-lang/crates.io-index" 2050 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2051 | dependencies = [ 2052 | "winapi-i686-pc-windows-gnu", 2053 | "winapi-x86_64-pc-windows-gnu", 2054 | ] 2055 | 2056 | [[package]] 2057 | name = "winapi-i686-pc-windows-gnu" 2058 | version = "0.4.0" 2059 | source = "registry+https://github.com/rust-lang/crates.io-index" 2060 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2061 | 2062 | [[package]] 2063 | name = "winapi-util" 2064 | version = "0.1.5" 2065 | source = "registry+https://github.com/rust-lang/crates.io-index" 2066 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2067 | dependencies = [ 2068 | "winapi", 2069 | ] 2070 | 2071 | [[package]] 2072 | name = "winapi-x86_64-pc-windows-gnu" 2073 | version = "0.4.0" 2074 | source = "registry+https://github.com/rust-lang/crates.io-index" 2075 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2076 | 2077 | [[package]] 2078 | name = "windows" 2079 | version = "0.48.0" 2080 | source = "registry+https://github.com/rust-lang/crates.io-index" 2081 | checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" 2082 | dependencies = [ 2083 | "windows-targets", 2084 | ] 2085 | 2086 | [[package]] 2087 | name = "windows-sys" 2088 | version = "0.48.0" 2089 | source = "registry+https://github.com/rust-lang/crates.io-index" 2090 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 2091 | dependencies = [ 2092 | "windows-targets", 2093 | ] 2094 | 2095 | [[package]] 2096 | name = "windows-targets" 2097 | version = "0.48.1" 2098 | source = "registry+https://github.com/rust-lang/crates.io-index" 2099 | checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" 2100 | dependencies = [ 2101 | "windows_aarch64_gnullvm", 2102 | "windows_aarch64_msvc", 2103 | "windows_i686_gnu", 2104 | "windows_i686_msvc", 2105 | "windows_x86_64_gnu", 2106 | "windows_x86_64_gnullvm", 2107 | "windows_x86_64_msvc", 2108 | ] 2109 | 2110 | [[package]] 2111 | name = "windows_aarch64_gnullvm" 2112 | version = "0.48.0" 2113 | source = "registry+https://github.com/rust-lang/crates.io-index" 2114 | checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 2115 | 2116 | [[package]] 2117 | name = "windows_aarch64_msvc" 2118 | version = "0.48.0" 2119 | source = "registry+https://github.com/rust-lang/crates.io-index" 2120 | checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 2121 | 2122 | [[package]] 2123 | name = "windows_i686_gnu" 2124 | version = "0.48.0" 2125 | source = "registry+https://github.com/rust-lang/crates.io-index" 2126 | checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 2127 | 2128 | [[package]] 2129 | name = "windows_i686_msvc" 2130 | version = "0.48.0" 2131 | source = "registry+https://github.com/rust-lang/crates.io-index" 2132 | checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 2133 | 2134 | [[package]] 2135 | name = "windows_x86_64_gnu" 2136 | version = "0.48.0" 2137 | source = "registry+https://github.com/rust-lang/crates.io-index" 2138 | checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 2139 | 2140 | [[package]] 2141 | name = "windows_x86_64_gnullvm" 2142 | version = "0.48.0" 2143 | source = "registry+https://github.com/rust-lang/crates.io-index" 2144 | checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 2145 | 2146 | [[package]] 2147 | name = "windows_x86_64_msvc" 2148 | version = "0.48.0" 2149 | source = "registry+https://github.com/rust-lang/crates.io-index" 2150 | checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 2151 | 2152 | [[package]] 2153 | name = "zstd" 2154 | version = "0.12.3+zstd.1.5.2" 2155 | source = "registry+https://github.com/rust-lang/crates.io-index" 2156 | checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" 2157 | dependencies = [ 2158 | "zstd-safe", 2159 | ] 2160 | 2161 | [[package]] 2162 | name = "zstd-safe" 2163 | version = "6.0.5+zstd.1.5.4" 2164 | source = "registry+https://github.com/rust-lang/crates.io-index" 2165 | checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" 2166 | dependencies = [ 2167 | "libc", 2168 | "zstd-sys", 2169 | ] 2170 | 2171 | [[package]] 2172 | name = "zstd-sys" 2173 | version = "2.0.8+zstd.1.5.5" 2174 | source = "registry+https://github.com/rust-lang/crates.io-index" 2175 | checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" 2176 | dependencies = [ 2177 | "cc", 2178 | "libc", 2179 | "pkg-config", 2180 | ] 2181 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "stripe-update-card" 3 | version = "2.0.0" 4 | authors = ["François-Guillaume RIBREAU "] 5 | homepage = "https://github.com/FGRibreau/stripe-update-card" 6 | repository = "https://github.com/FGRibreau/stripe-update-card" 7 | readme = "README.md" 8 | documentation = "https://docs.rs/stripe-update-card" 9 | description = "💳 Stripe update card page" 10 | keywords = ["stripe", "card", "payment"] 11 | categories = ["web-programming"] 12 | license = "MIT" 13 | edition = "2021" 14 | include = ["src/**/*", "Cargo.toml","README.md", "templates/**/*"] 15 | 16 | 17 | [dependencies] 18 | actix-web = { version = "4.3.1"} 19 | serde = "1.0.171" 20 | serde_json = "1.0.103" 21 | serde_derive = "1.0.171" 22 | lazy_static = "1.4.0" 23 | log = "0.4.19" 24 | async-stripe = { version = "0.22.2", features = ["runtime-tokio-hyper"] } 25 | handlebars = { version = "4.2.1", features = ["dir_source"] } 26 | env_logger = "0.10.0" 27 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rust:1.71-slim-bullseye as builder 2 | MAINTAINER Francois-Guillaume Ribreau 3 | ADD . /app 4 | WORKDIR /app 5 | 6 | RUN apt-get update && apt-get install -y pkg-config libssl-dev && \ 7 | cargo --version && \ 8 | rustc --version && \ 9 | mkdir -m 755 bin && \ 10 | cargo build --release && \ 11 | cp /app/target/release/stripe-update-card /app/bin && \ 12 | cp -R -v /app/static /app/bin 13 | 14 | # mandatory settings 15 | ENV STRIPE_PUBLISHABLE_KEY pk_test_xxxxxxxx 16 | ENV STRIPE_SECRET_KEY sk_test_xxxx 17 | ENV SUCCESS_REDIRECT_URL https://url.to.redirect/on/success 18 | 19 | EXPOSE 8080 20 | 21 | CMD ["./target/release/stripe-update-card"] 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Stripe Update Card microservice 2 | 3 | Expose a page that let your customers update their payment information on Stripe. 4 | 5 | [![Travis](https://img.shields.io/travis/FGRibreau/stripe-update-card.svg)](https://travis-ci.org/FGRibreau/stripe-update-card) 6 | [![Cargo version](https://img.shields.io/crates/v/stripe-update-card.svg)](https://crates.io/crates/stripe-update-card) [![Crates.io](https://img.shields.io/crates/l/stripe-update-card.svg)](https://crates.io/crates/stripe-update-card) [![Crates.io](https://img.shields.io/crates/d/stripe-update-card.svg)](https://crates.io/crates/stripe-update-card) [![Docker Build Status](https://img.shields.io/docker/build/fgribreau/stripe-update-card.svg)](https://hub.docker.com/r/fgribreau/stripe-update-card/) [![MicroBadger Size](https://img.shields.io/microbadger/image-size/fgribreau/stripe-update-card.svg)](https://hub.docker.com/r/fgribreau/stripe-update-card/) [![Slack](https://img.shields.io/badge/Slack-Join%20our%20tech%20community-17202A?logo=slack)](https://join.slack.com/t/fgribreau/shared_invite/zt-edpjwt2t-Zh39mDUMNQ0QOr9qOj~jrg) 7 | 8 | 9 | 10 |

11 | 12 |

13 | 14 | 15 | ### 🐳 Getting started 16 | 17 | ```bash 18 | docker run -it \ 19 | -e STRIPE_PUBLISHABLE_KEY=pk_test_xxx \ 20 | -e STRIPE_SECRET_KEY=sk_test_xxx \ 21 | -e SUCCESS_REDIRECT_URL=https://url.to.redirect/on/success \ 22 | -p 8080:8080 \ 23 | fgribreau/stripe-update-card 24 | 25 | # open payment update page for customer id: cus_D1Cj3rjHrjPQg5 26 | open http://localhost:8080/cus_XXXXXXXXXXXX 27 | ``` 28 | 29 | Don't forget to change `cus_XXXXXXXXXXXX` with the Stripe customer id and then expose the URL `http://sub.domain.tld/cus_XXXXXXXXXXXX` from your app. 30 | 31 | ## Configuration 32 | 33 | Configuration is managed through environment variables, see [.env.dist](./.env.dist) for the full-list. 34 | 35 | 36 | ```bash 37 | # mandatory config 38 | STRIPE_PUBLISHABLE_KEY=pk_test_xxxxxxxx 39 | STRIPE_SECRET_KEY=sk_test_xxxx 40 | SUCCESS_REDIRECT_URL=https://url.to.redirect/on/success 41 | 42 | # optional config 43 | PAGE_TITLE="Update Card" 44 | FORM_DATA_IMAGE=/path/to/your/logo.png 45 | FORM_DATA_NAME="The name of your company or website" 46 | FORM_DATA_DESCRIPTION="A description of the product or service being purchased" 47 | FORM_DATA_PANEL_LABEL="Update Card Details" 48 | FORM_DATA_COLLECT_BILLING_ADDRESS=false 49 | FORM_DATA_LABEL="Update Card Details" 50 | FORM_DATA_ALLOW_REMEMBER_ME=false 51 | FORM_DATA_LOCALE=auto 52 | ``` 53 | 54 | See [stripe-update-card](https://hub.docker.com/r/fgribreau/stripe-update-card/) on docker hub. 55 | 56 | ## Running in production at 57 | 58 | - [Image-Charts](https://payment.image-charts.com/cus_XXXXXX) 59 | - [Redsmin](https://payment.redsmin.com/cus_XXXXXX) 60 | 61 | ## 🦄 Do you use it in production? Please support my work :) 62 | 63 | Patreon donate button 64 | Gratipay donate button 65 | Flattr donate button 66 | PayPal donate button 67 | Bitcoin donate button 68 | 69 | 70 | ## ⛴ Cargo install 71 | 72 | ```bash 73 | cargo install stripe-update-card 74 | ``` 75 | 76 | 77 | ## ⚙️ Deployment 78 | 79 | - Deploy it (the fastest way is to use [Clever-cloud](https://www.clever-cloud.com/doc/rust/rust/) thanks to their awesome native Rust support) 80 | - Set environment variables 81 | - Don't forget to add "RUSTUP_CHANNEL=nightly" env. variable for Rocket 82 | - Done! 83 | 84 | 85 | ## ❤️ Shameless plug 86 | 87 | - [**Charts, simple as a URL**. No more server-side rendering pain, 1 url = 1 chart](https://image-charts.com) 88 | - [Looking for a free **Redis GUI**?](https://www.redsmin.com) [Or for **real-time alerting** & monitoring for Redis?](http://redsmin.com) 89 | - [**Mailpopin**](https://mailpop.in/) - **Stripe** payment emails you can actually use 90 | 91 | ## Development 92 | 93 | 94 | ``` 95 | cargo install cargo-watch 96 | cargo install cargo-release 97 | 98 | source .env 99 | 100 | # watch for changes and restart everytime 101 | RUST_LOG=debug cargo watch -x run 102 | ``` 103 | 104 | - Use Stripe test tokens 105 | - Use credit card number `4242 4242 4242 4242` and any date & CVV 106 | 107 | 108 | ## CI 109 | 110 | This project use Travis-CI to run tests & do builds. 111 | 112 | Required environment variables are: 113 | 114 | - CODECOV_TOKEN (get one at https://codecov.io/gh/FGRibreau/ ) 115 | -------------------------------------------------------------------------------- /docs/screencast.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FGRibreau/stripe-update-card/8cae18af61f4c41f40febf6d1765ccc731fd028b/docs/screencast.gif -------------------------------------------------------------------------------- /docs/screencast.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FGRibreau/stripe-update-card/8cae18af61f4c41f40febf6d1765ccc731fd028b/docs/screencast.mp4 -------------------------------------------------------------------------------- /docs/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FGRibreau/stripe-update-card/8cae18af61f4c41f40febf6d1765ccc731fd028b/docs/screenshot.png -------------------------------------------------------------------------------- /release.toml: -------------------------------------------------------------------------------- 1 | # cargo install cargo-release 2 | # cargo release --dry-run 3 | upload-doc = true 4 | pre-release-commit-message = "Release {{version}} 🎉🎉" 5 | pre-release-replacements = [ {file="README.md", search="Current release: [a-z0-9\\.-]+", replace="Current release: {{version}}"} , {file ="Cargo.toml", search="branch=\"[a-z0-9\\.-]+\"", replace="branch=\"{{version}}\""} ] 6 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] 2 | extern crate log; 3 | 4 | #[macro_use] 5 | extern crate serde_derive; 6 | extern crate serde; 7 | extern crate serde_json; 8 | extern crate stripe; 9 | 10 | use std::env; 11 | 12 | use actix_web::{get, post, App, HttpResponse, HttpServer, web}; 13 | use actix_web::body::BoxBody; 14 | use actix_web::dev::ServiceResponse; 15 | use actix_web::http::header::{ContentType, LOCATION}; 16 | use actix_web::http::{StatusCode}; 17 | use actix_web::middleware::{ErrorHandlerResponse, ErrorHandlers}; 18 | 19 | use actix_web::Result; 20 | 21 | use log::{error, info}; 22 | use serde_json::json; 23 | use stripe::{TokenId}; 24 | use handlebars::Handlebars; 25 | 26 | fn env(key: &str) -> String { 27 | env::var(key).unwrap_or(String::new()) 28 | } 29 | 30 | #[get("/{customer_id}")] 31 | async fn index(hb: web::Data>, path: web::Path) -> HttpResponse { 32 | 33 | let customer_id = path.into_inner(); 34 | 35 | let data = json!({ 36 | "page_title": env("PAGE_TITLE"), 37 | "stripe_publishable_key": env("STRIPE_PUBLISHABLE_KEY"), 38 | "form_data_name": env("FORM_DATA_NAME"), 39 | "form_data_description": env("FORM_DATA_DESCRIPTION"), 40 | "form_data_image": env("FORM_DATA_IMAGE"), 41 | "form_data_panel_label": env("FORM_DATA_PANEL_LABEL"), 42 | "form_data_label": env("FORM_DATA_LABEL"), 43 | "form_data_collect_billing_address": env("FORM_DATA_COLLECT_BILLING_ADDRESS"), 44 | "form_data_allow_remember_me": env("FORM_DATA_ALLOW_REMEMBER_ME"), 45 | "form_data_locale": env("FORM_DATA_LOCALE"), 46 | "customer_id": customer_id 47 | }); 48 | 49 | let body = hb.render("index", &data).unwrap(); 50 | 51 | HttpResponse::Ok().body(body) 52 | } 53 | 54 | 55 | #[derive(Debug, Serialize, Deserialize)] 56 | struct CardUpdate { 57 | #[serde(rename = "stripeToken")] 58 | stripe_token: String, 59 | #[serde(rename = "stripeEmail")] 60 | stripe_email: String, 61 | } 62 | 63 | 64 | #[post("/{customer_id}")] 65 | async fn update_card(path: web::Path, card_update_form: web::Form ) -> HttpResponse { 66 | let customer_id = path.into_inner(); 67 | 68 | let client = stripe::Client::new(env("STRIPE_SECRET_KEY")); 69 | 70 | let mut params = stripe::UpdateCustomer::default(); 71 | params.email = Some(&card_update_form.stripe_email); 72 | 73 | let card_token = card_update_form.stripe_token.parse::(); 74 | 75 | if let Err(err) = card_token { 76 | error!("Could not parse card_token from customer_id={} err={:?}", customer_id, err); 77 | return HttpResponse::BadRequest().json(json!({ 78 | "error" : "Invalid card token" 79 | })); 80 | } 81 | 82 | params.source = Some(stripe::PaymentSourceParams::Token(card_token.unwrap())); 83 | 84 | let res = stripe::Customer::update(&client, &customer_id.parse::().unwrap_or_default(), params) 85 | .await; 86 | 87 | 88 | match res { 89 | Ok(customer) => { 90 | info!("Updated credit card for customer_id={} email={:?}", customer_id, customer.email); 91 | HttpResponse::Found() 92 | .insert_header((LOCATION, env("SUCCESS_REDIRECT_URL"))) 93 | .finish() 94 | } 95 | Err(error) => { 96 | error!("Could not update customer customer_id={} response={:?}", customer_id, error); 97 | HttpResponse::InternalServerError().finish() 98 | } 99 | } 100 | } 101 | 102 | // Custom error handlers, to return HTML responses when an error occurs. 103 | fn error_handlers() -> ErrorHandlers { 104 | ErrorHandlers::new().handler(StatusCode::NOT_FOUND, not_found) 105 | } 106 | 107 | // Error handler for a 404 Page not found error. 108 | fn not_found(res: ServiceResponse) -> Result> { 109 | let response = get_error_response(&res, "Page not found"); 110 | Ok(ErrorHandlerResponse::Response(ServiceResponse::new( 111 | res.into_parts().0, 112 | response.map_into_left_body(), 113 | ))) 114 | } 115 | 116 | // Generic error handler. 117 | fn get_error_response(res: &ServiceResponse, error: &str) -> HttpResponse { 118 | let request = res.request(); 119 | 120 | // Provide a fallback to a simple plain text response in case an error occurs during the 121 | // rendering of the error page. 122 | let fallback = |err: &str| { 123 | HttpResponse::build(res.status()) 124 | .content_type(ContentType::plaintext()) 125 | .body(err.to_string()) 126 | }; 127 | 128 | let hb = request 129 | .app_data::>() 130 | .map(|t| t.get_ref()); 131 | match hb { 132 | Some(hb) => { 133 | let data = json!({ 134 | "error": error, 135 | "status_code": res.status().as_str() 136 | }); 137 | let body = hb.render("error", &data); 138 | 139 | match body { 140 | Ok(body) => HttpResponse::build(res.status()) 141 | .content_type(ContentType::html()) 142 | .body(body), 143 | Err(_) => fallback(error), 144 | } 145 | } 146 | None => fallback(error), 147 | } 148 | } 149 | 150 | #[actix_web::main] 151 | async fn main() -> std::io::Result<()> { 152 | env_logger::init(); 153 | 154 | // Handlebars uses a repository for the compiled templates. This object must be 155 | // shared between the application threads, and is therefore passed to the 156 | // Application Builder as an atomic reference-counted pointer. 157 | let mut handlebars = Handlebars::new(); 158 | handlebars 159 | .register_templates_directory(".html", "./static/templates") 160 | .unwrap(); 161 | let handlebars_ref = web::Data::new(handlebars); 162 | 163 | info!("Starting server on 0.0.0.0:8080"); 164 | HttpServer::new(move || { 165 | App::new().wrap(error_handlers()).app_data(handlebars_ref.clone()) 166 | .service(index) 167 | .service(update_card) 168 | }) 169 | .bind(("0.0.0.0", 8080))? 170 | .run() 171 | .await 172 | } 173 | -------------------------------------------------------------------------------- /static/templates/error.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{error}} 6 | 7 | 8 |

{{status_code}} {{error}}

9 | 10 | 11 | -------------------------------------------------------------------------------- /static/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ page_title }} 6 | 7 | 8 | 35 | 36 | 37 |
38 | 39 | 40 |
41 | 42 | 43 | 44 | --------------------------------------------------------------------------------