@easypayment/medusa-payment-paypal 1.2.3 → 1.2.5

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.
Files changed (274) hide show
  1. package/.medusa/server/src/admin/index.js +392 -138
  2. package/.medusa/server/src/admin/index.mjs +392 -138
  3. package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.d.ts +1 -0
  4. package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.d.ts.map +1 -1
  5. package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.js +5 -1
  6. package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.js.map +1 -1
  7. package/.medusa/server/src/api/admin/paypal/disconnect/route.d.ts +1 -0
  8. package/.medusa/server/src/api/admin/paypal/disconnect/route.d.ts.map +1 -1
  9. package/.medusa/server/src/api/admin/paypal/disconnect/route.js +1 -0
  10. package/.medusa/server/src/api/admin/paypal/disconnect/route.js.map +1 -1
  11. package/.medusa/server/src/api/admin/paypal/environment/route.d.ts +2 -0
  12. package/.medusa/server/src/api/admin/paypal/environment/route.d.ts.map +1 -1
  13. package/.medusa/server/src/api/admin/paypal/environment/route.js +2 -0
  14. package/.medusa/server/src/api/admin/paypal/environment/route.js.map +1 -1
  15. package/.medusa/server/src/api/admin/paypal/onboard-complete/route.d.ts +9 -0
  16. package/.medusa/server/src/api/admin/paypal/onboard-complete/route.d.ts.map +1 -1
  17. package/.medusa/server/src/api/admin/paypal/onboard-complete/route.js +9 -4
  18. package/.medusa/server/src/api/admin/paypal/onboard-complete/route.js.map +1 -1
  19. package/.medusa/server/src/api/admin/paypal/onboarding-link/route.d.ts +7 -1
  20. package/.medusa/server/src/api/admin/paypal/onboarding-link/route.d.ts.map +1 -1
  21. package/.medusa/server/src/api/admin/paypal/onboarding-link/route.js +9 -2
  22. package/.medusa/server/src/api/admin/paypal/onboarding-link/route.js.map +1 -1
  23. package/.medusa/server/src/api/admin/paypal/onboarding-status/route.d.ts +1 -0
  24. package/.medusa/server/src/api/admin/paypal/onboarding-status/route.d.ts.map +1 -1
  25. package/.medusa/server/src/api/admin/paypal/onboarding-status/route.js +1 -0
  26. package/.medusa/server/src/api/admin/paypal/onboarding-status/route.js.map +1 -1
  27. package/.medusa/server/src/api/admin/paypal/save-credentials/route.d.ts +1 -0
  28. package/.medusa/server/src/api/admin/paypal/save-credentials/route.d.ts.map +1 -1
  29. package/.medusa/server/src/api/admin/paypal/save-credentials/route.js +10 -3
  30. package/.medusa/server/src/api/admin/paypal/save-credentials/route.js.map +1 -1
  31. package/.medusa/server/src/api/admin/paypal/settings/route.d.ts +2 -0
  32. package/.medusa/server/src/api/admin/paypal/settings/route.d.ts.map +1 -1
  33. package/.medusa/server/src/api/admin/paypal/settings/route.js +9 -2
  34. package/.medusa/server/src/api/admin/paypal/settings/route.js.map +1 -1
  35. package/.medusa/server/src/api/admin/paypal/status/route.d.ts +4 -0
  36. package/.medusa/server/src/api/admin/paypal/status/route.d.ts.map +1 -1
  37. package/.medusa/server/src/api/admin/paypal/status/route.js +9 -1
  38. package/.medusa/server/src/api/admin/paypal/status/route.js.map +1 -1
  39. package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.d.ts +4 -0
  40. package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.d.ts.map +1 -1
  41. package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.js +11 -1
  42. package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.js.map +1 -1
  43. package/.medusa/server/src/api/store/paypal/capture-order/route.d.ts +8 -0
  44. package/.medusa/server/src/api/store/paypal/capture-order/route.d.ts.map +1 -1
  45. package/.medusa/server/src/api/store/paypal/capture-order/route.js +23 -3
  46. package/.medusa/server/src/api/store/paypal/capture-order/route.js.map +1 -1
  47. package/.medusa/server/src/api/store/paypal/config/route.d.ts +5 -0
  48. package/.medusa/server/src/api/store/paypal/config/route.d.ts.map +1 -1
  49. package/.medusa/server/src/api/store/paypal/config/route.js +12 -5
  50. package/.medusa/server/src/api/store/paypal/config/route.js.map +1 -1
  51. package/.medusa/server/src/api/store/paypal/create-order/route.d.ts +8 -0
  52. package/.medusa/server/src/api/store/paypal/create-order/route.d.ts.map +1 -1
  53. package/.medusa/server/src/api/store/paypal/create-order/route.js +80 -26
  54. package/.medusa/server/src/api/store/paypal/create-order/route.js.map +1 -1
  55. package/.medusa/server/src/api/store/paypal/onboard-return/route.d.ts.map +1 -1
  56. package/.medusa/server/src/api/store/paypal/onboard-return/route.js +19 -19
  57. package/.medusa/server/src/api/store/paypal/onboard-return/route.js.map +1 -1
  58. package/.medusa/server/src/api/store/paypal/settings/route.d.ts +1 -0
  59. package/.medusa/server/src/api/store/paypal/settings/route.d.ts.map +1 -1
  60. package/.medusa/server/src/api/store/paypal/settings/route.js +4 -1
  61. package/.medusa/server/src/api/store/paypal/settings/route.js.map +1 -1
  62. package/.medusa/server/src/api/store/paypal/webhook/route.d.ts +7 -0
  63. package/.medusa/server/src/api/store/paypal/webhook/route.d.ts.map +1 -1
  64. package/.medusa/server/src/api/store/paypal/webhook/route.js +34 -3
  65. package/.medusa/server/src/api/store/paypal/webhook/route.js.map +1 -1
  66. package/.medusa/server/src/api/store/paypal-complete/route.d.ts +8 -0
  67. package/.medusa/server/src/api/store/paypal-complete/route.d.ts.map +1 -1
  68. package/.medusa/server/src/api/store/paypal-complete/route.js +55 -8
  69. package/.medusa/server/src/api/store/paypal-complete/route.js.map +1 -1
  70. package/.medusa/server/src/api/utils/rate-limit.d.ts +4 -0
  71. package/.medusa/server/src/api/utils/rate-limit.d.ts.map +1 -1
  72. package/.medusa/server/src/api/utils/rate-limit.js +9 -4
  73. package/.medusa/server/src/api/utils/rate-limit.js.map +1 -1
  74. package/.medusa/server/src/jobs/paypal-webhook-retry.d.ts +5 -0
  75. package/.medusa/server/src/jobs/paypal-webhook-retry.d.ts.map +1 -1
  76. package/.medusa/server/src/jobs/paypal-webhook-retry.js +13 -2
  77. package/.medusa/server/src/jobs/paypal-webhook-retry.js.map +1 -1
  78. package/.medusa/server/src/modules/paypal/index.d.ts +1 -0
  79. package/.medusa/server/src/modules/paypal/index.d.ts.map +1 -1
  80. package/.medusa/server/src/modules/paypal/index.js +1 -0
  81. package/.medusa/server/src/modules/paypal/index.js.map +1 -1
  82. package/.medusa/server/src/modules/paypal/migrations/20260115120000_create_paypal_connection.js +22 -22
  83. package/.medusa/server/src/modules/paypal/migrations/20260123090000_create_paypal_settings.js +11 -11
  84. package/.medusa/server/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.js +18 -18
  85. package/.medusa/server/src/modules/paypal/migrations/20260401090000_create_paypal_metric.js +16 -16
  86. package/.medusa/server/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.js +20 -20
  87. package/.medusa/server/src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.js +14 -14
  88. package/.medusa/server/src/modules/paypal/migrations/20261201090000_remove_paypal_audit_log.js +15 -15
  89. package/.medusa/server/src/modules/paypal/migrations/20270101090000_set_paypal_environment_default_live.d.ts.map +1 -1
  90. package/.medusa/server/src/modules/paypal/migrations/20270101090000_set_paypal_environment_default_live.js.map +1 -1
  91. package/.medusa/server/src/modules/paypal/migrations/20270102090000_add_paypal_seller_email.d.ts.map +1 -1
  92. package/.medusa/server/src/modules/paypal/migrations/20270102090000_add_paypal_seller_email.js.map +1 -1
  93. package/.medusa/server/src/modules/paypal/migrations/20270103090000_add_paypal_seller_merchant_id.d.ts.map +1 -1
  94. package/.medusa/server/src/modules/paypal/migrations/20270103090000_add_paypal_seller_merchant_id.js.map +1 -1
  95. package/.medusa/server/src/modules/paypal/migrations/20270201000000_add_webhook_dead_letter.js +6 -6
  96. package/.medusa/server/src/modules/paypal/models/paypal_connection.d.ts +5 -0
  97. package/.medusa/server/src/modules/paypal/models/paypal_connection.d.ts.map +1 -1
  98. package/.medusa/server/src/modules/paypal/models/paypal_connection.js +5 -0
  99. package/.medusa/server/src/modules/paypal/models/paypal_connection.js.map +1 -1
  100. package/.medusa/server/src/modules/paypal/models/paypal_metric.d.ts +4 -0
  101. package/.medusa/server/src/modules/paypal/models/paypal_metric.d.ts.map +1 -1
  102. package/.medusa/server/src/modules/paypal/models/paypal_metric.js +4 -0
  103. package/.medusa/server/src/modules/paypal/models/paypal_metric.js.map +1 -1
  104. package/.medusa/server/src/modules/paypal/models/paypal_settings.d.ts +5 -0
  105. package/.medusa/server/src/modules/paypal/models/paypal_settings.d.ts.map +1 -1
  106. package/.medusa/server/src/modules/paypal/models/paypal_settings.js +5 -0
  107. package/.medusa/server/src/modules/paypal/models/paypal_settings.js.map +1 -1
  108. package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.d.ts +7 -0
  109. package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.d.ts.map +1 -1
  110. package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.js +7 -0
  111. package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.js.map +1 -1
  112. package/.medusa/server/src/modules/paypal/payment-provider/base-provider.d.ts +24 -1
  113. package/.medusa/server/src/modules/paypal/payment-provider/base-provider.d.ts.map +1 -1
  114. package/.medusa/server/src/modules/paypal/payment-provider/base-provider.js +296 -0
  115. package/.medusa/server/src/modules/paypal/payment-provider/base-provider.js.map +1 -1
  116. package/.medusa/server/src/modules/paypal/payment-provider/card-service.d.ts +14 -7
  117. package/.medusa/server/src/modules/paypal/payment-provider/card-service.d.ts.map +1 -1
  118. package/.medusa/server/src/modules/paypal/payment-provider/card-service.js +40 -198
  119. package/.medusa/server/src/modules/paypal/payment-provider/card-service.js.map +1 -1
  120. package/.medusa/server/src/modules/paypal/payment-provider/index.d.ts +6 -1
  121. package/.medusa/server/src/modules/paypal/payment-provider/index.d.ts.map +1 -1
  122. package/.medusa/server/src/modules/paypal/payment-provider/index.js +6 -4
  123. package/.medusa/server/src/modules/paypal/payment-provider/index.js.map +1 -1
  124. package/.medusa/server/src/modules/paypal/payment-provider/service.d.ts +9 -2
  125. package/.medusa/server/src/modules/paypal/payment-provider/service.d.ts.map +1 -1
  126. package/.medusa/server/src/modules/paypal/payment-provider/service.js +29 -181
  127. package/.medusa/server/src/modules/paypal/payment-provider/service.js.map +1 -1
  128. package/.medusa/server/src/modules/paypal/payment-provider/status-utils.d.ts +21 -0
  129. package/.medusa/server/src/modules/paypal/payment-provider/status-utils.d.ts.map +1 -1
  130. package/.medusa/server/src/modules/paypal/payment-provider/status-utils.js +54 -0
  131. package/.medusa/server/src/modules/paypal/payment-provider/status-utils.js.map +1 -1
  132. package/.medusa/server/src/modules/paypal/service.d.ts +72 -2
  133. package/.medusa/server/src/modules/paypal/service.d.ts.map +1 -1
  134. package/.medusa/server/src/modules/paypal/service.js +159 -33
  135. package/.medusa/server/src/modules/paypal/service.js.map +1 -1
  136. package/.medusa/server/src/modules/paypal/types/config.d.ts +2 -0
  137. package/.medusa/server/src/modules/paypal/types/config.d.ts.map +1 -1
  138. package/.medusa/server/src/modules/paypal/types/config.js +5 -2
  139. package/.medusa/server/src/modules/paypal/types/config.js.map +1 -1
  140. package/.medusa/server/src/modules/paypal/utils/amounts.d.ts +1 -0
  141. package/.medusa/server/src/modules/paypal/utils/amounts.d.ts.map +1 -1
  142. package/.medusa/server/src/modules/paypal/utils/amounts.js +15 -5
  143. package/.medusa/server/src/modules/paypal/utils/amounts.js.map +1 -1
  144. package/.medusa/server/src/modules/paypal/utils/credential-resolver.d.ts +10 -0
  145. package/.medusa/server/src/modules/paypal/utils/credential-resolver.d.ts.map +1 -1
  146. package/.medusa/server/src/modules/paypal/utils/credential-resolver.js +45 -1
  147. package/.medusa/server/src/modules/paypal/utils/credential-resolver.js.map +1 -1
  148. package/.medusa/server/src/modules/paypal/utils/currencies.d.ts +9 -0
  149. package/.medusa/server/src/modules/paypal/utils/currencies.d.ts.map +1 -1
  150. package/.medusa/server/src/modules/paypal/utils/currencies.js +13 -0
  151. package/.medusa/server/src/modules/paypal/utils/currencies.js.map +1 -1
  152. package/.medusa/server/src/modules/paypal/utils/payment-session.d.ts +12 -0
  153. package/.medusa/server/src/modules/paypal/utils/payment-session.d.ts.map +1 -1
  154. package/.medusa/server/src/modules/paypal/utils/payment-session.js +4 -3
  155. package/.medusa/server/src/modules/paypal/utils/payment-session.js.map +1 -1
  156. package/.medusa/server/src/modules/paypal/utils/paypal-auth.d.ts +1 -0
  157. package/.medusa/server/src/modules/paypal/utils/paypal-auth.d.ts.map +1 -1
  158. package/.medusa/server/src/modules/paypal/utils/paypal-auth.js +1 -0
  159. package/.medusa/server/src/modules/paypal/utils/paypal-auth.js.map +1 -1
  160. package/.medusa/server/src/modules/paypal/utils/paypal-fetch.d.ts +11 -0
  161. package/.medusa/server/src/modules/paypal/utils/paypal-fetch.d.ts.map +1 -1
  162. package/.medusa/server/src/modules/paypal/utils/paypal-fetch.js +17 -1
  163. package/.medusa/server/src/modules/paypal/utils/paypal-fetch.js.map +1 -1
  164. package/.medusa/server/src/modules/paypal/utils/provider-ids.d.ts +6 -0
  165. package/.medusa/server/src/modules/paypal/utils/provider-ids.d.ts.map +1 -1
  166. package/.medusa/server/src/modules/paypal/utils/provider-ids.js +6 -0
  167. package/.medusa/server/src/modules/paypal/utils/provider-ids.js.map +1 -1
  168. package/.medusa/server/src/modules/paypal/utils/secret-crypto.d.ts +2 -0
  169. package/.medusa/server/src/modules/paypal/utils/secret-crypto.d.ts.map +1 -1
  170. package/.medusa/server/src/modules/paypal/utils/secret-crypto.js +6 -1
  171. package/.medusa/server/src/modules/paypal/utils/secret-crypto.js.map +1 -1
  172. package/.medusa/server/src/modules/paypal/webhook-processor.d.ts +43 -0
  173. package/.medusa/server/src/modules/paypal/webhook-processor.d.ts.map +1 -1
  174. package/.medusa/server/src/modules/paypal/webhook-processor.js +57 -5
  175. package/.medusa/server/src/modules/paypal/webhook-processor.js.map +1 -1
  176. package/.medusa/server/src/providers/paypal/index.d.ts +1 -0
  177. package/.medusa/server/src/providers/paypal/index.d.ts.map +1 -1
  178. package/.medusa/server/src/providers/paypal/index.js +1 -0
  179. package/.medusa/server/src/providers/paypal/index.js.map +1 -1
  180. package/.medusa/server/src/providers/paypal_card/index.d.ts +1 -0
  181. package/.medusa/server/src/providers/paypal_card/index.d.ts.map +1 -1
  182. package/.medusa/server/src/providers/paypal_card/index.js +1 -0
  183. package/.medusa/server/src/providers/paypal_card/index.js.map +1 -1
  184. package/.medusa/server/src/subscribers/paypal-order-invoice.d.ts +6 -0
  185. package/.medusa/server/src/subscribers/paypal-order-invoice.d.ts.map +1 -1
  186. package/.medusa/server/src/subscribers/paypal-order-invoice.js +9 -1
  187. package/.medusa/server/src/subscribers/paypal-order-invoice.js.map +1 -1
  188. package/.medusa/server/src/subscribers/paypal-webhook-process.d.ts +1 -0
  189. package/.medusa/server/src/subscribers/paypal-webhook-process.d.ts.map +1 -1
  190. package/.medusa/server/src/subscribers/paypal-webhook-process.js +17 -4
  191. package/.medusa/server/src/subscribers/paypal-webhook-process.js.map +1 -1
  192. package/CHANGELOG.md +65 -0
  193. package/README.md +184 -184
  194. package/package.json +7 -4
  195. package/src/admin/index.ts +1 -1
  196. package/src/admin/routes/settings/paypal/_components/FieldRow.tsx +38 -29
  197. package/src/admin/routes/settings/paypal/_components/SectionCard.tsx +29 -26
  198. package/src/admin/routes/settings/paypal/_components/Tabs.tsx +49 -48
  199. package/src/admin/routes/settings/paypal/_components/Toast.tsx +63 -52
  200. package/src/admin/routes/settings/paypal/_utils/adminFetch.ts +52 -32
  201. package/src/admin/routes/settings/paypal/additional-settings/page.tsx +246 -139
  202. package/src/admin/routes/settings/paypal/advanced-card-payments/page.tsx +208 -123
  203. package/src/admin/routes/settings/paypal/apple-pay/page.tsx +9 -5
  204. package/src/admin/routes/settings/paypal/connection/page.tsx +974 -908
  205. package/src/admin/routes/settings/paypal/google-pay/page.tsx +9 -5
  206. package/src/admin/routes/settings/paypal/page.tsx +14 -13
  207. package/src/admin/routes/settings/paypal/pay-later-messaging/page.tsx +9 -5
  208. package/src/admin/routes/settings/paypal/paypal-settings/page.tsx +304 -273
  209. package/src/api/admin/payment-collections/[id]/payment-sessions/route.ts +48 -39
  210. package/src/api/admin/paypal/disconnect/route.ts +15 -14
  211. package/src/api/admin/paypal/environment/route.ts +34 -32
  212. package/src/api/admin/paypal/onboard-complete/route.ts +61 -50
  213. package/src/api/admin/paypal/onboarding-link/route.ts +91 -76
  214. package/src/api/admin/paypal/onboarding-status/route.ts +21 -20
  215. package/src/api/admin/paypal/save-credentials/route.ts +48 -37
  216. package/src/api/admin/paypal/settings/route.ts +63 -45
  217. package/src/api/admin/paypal/status/route.ts +29 -17
  218. package/src/api/hooks/paypal/onboard-return/route.ts +15 -15
  219. package/src/api/hooks/paypal/webhook/route.ts +17 -17
  220. package/src/api/middlewares.ts +61 -61
  221. package/src/api/store/payment-collections/[id]/payment-sessions/route.ts +69 -54
  222. package/src/api/store/paypal/capture-order/route.ts +416 -370
  223. package/src/api/store/paypal/config/route.ts +121 -115
  224. package/src/api/store/paypal/create-order/route.ts +611 -539
  225. package/src/api/store/paypal/onboard-return/route.ts +116 -113
  226. package/src/api/store/paypal/settings/route.ts +29 -19
  227. package/src/api/store/paypal/webhook/route.ts +380 -314
  228. package/src/api/store/paypal-complete/route.ts +184 -128
  229. package/src/api/utils/rate-limit.ts +143 -129
  230. package/src/index.ts +1 -1
  231. package/src/jobs/paypal-webhook-retry.ts +257 -241
  232. package/src/modules/paypal/index.ts +9 -8
  233. package/src/modules/paypal/migrations/20260115120000_create_paypal_connection.ts +33 -33
  234. package/src/modules/paypal/migrations/20260123090000_create_paypal_settings.ts +22 -22
  235. package/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.ts +29 -29
  236. package/src/modules/paypal/migrations/20260401090000_create_paypal_metric.ts +27 -27
  237. package/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.ts +31 -31
  238. package/src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.ts +25 -25
  239. package/src/modules/paypal/migrations/20261201090000_remove_paypal_audit_log.ts +26 -26
  240. package/src/modules/paypal/migrations/20270101090000_set_paypal_environment_default_live.ts +15 -11
  241. package/src/modules/paypal/migrations/20270102090000_add_paypal_seller_email.ts +15 -11
  242. package/src/modules/paypal/migrations/20270103090000_add_paypal_seller_merchant_id.ts +15 -11
  243. package/src/modules/paypal/migrations/20270201000000_add_webhook_dead_letter.ts +17 -17
  244. package/src/modules/paypal/migrations/20270202000000_align_nullable_defaults.ts +44 -44
  245. package/src/modules/paypal/migrations/20270301000000_add_webhook_transmission_id_index.ts +15 -15
  246. package/src/modules/paypal/models/paypal_connection.ts +28 -23
  247. package/src/modules/paypal/models/paypal_metric.ts +13 -9
  248. package/src/modules/paypal/models/paypal_settings.ts +13 -8
  249. package/src/modules/paypal/models/paypal_webhook_event.ts +26 -19
  250. package/src/modules/paypal/payment-provider/base-provider.ts +700 -275
  251. package/src/modules/paypal/payment-provider/card-service.ts +693 -855
  252. package/src/modules/paypal/payment-provider/index.ts +14 -15
  253. package/src/modules/paypal/payment-provider/service.ts +673 -836
  254. package/src/modules/paypal/payment-provider/status-utils.ts +116 -59
  255. package/src/modules/paypal/payment-provider/webhook-utils.ts +109 -109
  256. package/src/modules/paypal/service.ts +362 -115
  257. package/src/modules/paypal/types/config.ts +70 -65
  258. package/src/modules/paypal/utils/amounts.ts +123 -107
  259. package/src/modules/paypal/utils/core-workflow.ts +46 -46
  260. package/src/modules/paypal/utils/credential-resolver.ts +315 -271
  261. package/src/modules/paypal/utils/currencies.ts +97 -84
  262. package/src/modules/paypal/utils/partner.ts +8 -8
  263. package/src/modules/paypal/utils/payment-session.ts +144 -138
  264. package/src/modules/paypal/utils/paypal-auth.ts +6 -5
  265. package/src/modules/paypal/utils/paypal-fetch.ts +197 -181
  266. package/src/modules/paypal/utils/provider-ids.ts +21 -15
  267. package/src/modules/paypal/utils/secret-crypto.ts +226 -197
  268. package/src/modules/paypal/utils/webhook-verify.ts +61 -61
  269. package/src/modules/paypal/webhook-processor.ts +641 -573
  270. package/src/providers/paypal/index.ts +9 -8
  271. package/src/providers/paypal_card/index.ts +9 -8
  272. package/src/subscribers/paypal-order-invoice.ts +180 -173
  273. package/src/subscribers/paypal-webhook-process.ts +147 -131
  274. package/tsconfig.json +21 -31
@@ -59,7 +59,14 @@ function FieldRow({
59
59
  }) {
60
60
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-12 items-start gap-4 py-3", children: [
61
61
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-12 md:col-span-4", children: [
62
- htmlFor ? /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor, className: "text-sm font-medium text-ui-fg-base", children: label }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-ui-fg-base", children: label }),
62
+ htmlFor ? /* @__PURE__ */ jsxRuntime.jsx(
63
+ "label",
64
+ {
65
+ htmlFor,
66
+ className: "text-sm font-medium text-ui-fg-base",
67
+ children: label
68
+ }
69
+ ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm font-medium text-ui-fg-base", children: label }),
63
70
  hint ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 text-xs text-ui-fg-subtle", children: hint }) : null
64
71
  ] }),
65
72
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-12 md:col-span-8", children })
@@ -84,7 +91,15 @@ function Toast({ toast, onClose }) {
84
91
  role: isSuccess ? "status" : "alert",
85
92
  "aria-live": isSuccess ? "polite" : "assertive",
86
93
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
87
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: ["mt-0.5 h-2.5 w-2.5 rounded-full", isSuccess ? "bg-emerald-500" : "bg-rose-500"].join(" ") }),
94
+ /* @__PURE__ */ jsxRuntime.jsx(
95
+ "div",
96
+ {
97
+ className: [
98
+ "mt-0.5 h-2.5 w-2.5 rounded-full",
99
+ isSuccess ? "bg-emerald-500" : "bg-rose-500"
100
+ ].join(" ")
101
+ }
102
+ ),
88
103
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 text-sm text-ui-fg-base", children: toast.message }),
89
104
  /* @__PURE__ */ jsxRuntime.jsx(
90
105
  "button",
@@ -122,8 +137,14 @@ async function adminFetch(path, opts = {}) {
122
137
  });
123
138
  const text = await res.text().catch(() => "");
124
139
  if (!res.ok) {
125
- if (res.status === 401) throw new Error("Unauthorized (401) - session may have expired. Please reload and log in again.");
126
- if (res.status === 403) throw new Error("Forbidden (403) - you do not have permission to perform this action.");
140
+ if (res.status === 401)
141
+ throw new Error(
142
+ "Unauthorized (401) - session may have expired. Please reload and log in again."
143
+ );
144
+ if (res.status === 403)
145
+ throw new Error(
146
+ "Forbidden (403) - you do not have permission to perform this action."
147
+ );
127
148
  throw new Error(text || `Request failed with status ${res.status}`);
128
149
  }
129
150
  if (!text) return {};
@@ -144,11 +165,18 @@ const DEFAULT_FORM$1 = {
144
165
  };
145
166
  function mergeWithDefaults$1(saved) {
146
167
  if (!saved) return { ...DEFAULT_FORM$1 };
147
- const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
148
- return { ...DEFAULT_FORM$1, ...Object.fromEntries(entries) };
168
+ const entries = Object.entries(saved).filter(
169
+ ([, value]) => value !== void 0
170
+ );
171
+ return {
172
+ ...DEFAULT_FORM$1,
173
+ ...Object.fromEntries(entries)
174
+ };
149
175
  }
150
176
  function AdditionalSettingsTab() {
151
- const [form, setForm] = react.useState(() => ({ ...DEFAULT_FORM$1 }));
177
+ const [form, setForm] = react.useState(() => ({
178
+ ...DEFAULT_FORM$1
179
+ }));
152
180
  const [loading, setLoading] = react.useState(false);
153
181
  const [saving, setSaving] = react.useState(false);
154
182
  const [toast, setToast] = react.useState(null);
@@ -163,7 +191,8 @@ function AdditionalSettingsTab() {
163
191
  const json = await adminFetch("/admin/paypal/settings");
164
192
  const payload = (json == null ? void 0 : json.data) ?? json;
165
193
  const saved = payload == null ? void 0 : payload.additional_settings;
166
- if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
194
+ if (saved && typeof saved === "object")
195
+ setForm(mergeWithDefaults$1(saved));
167
196
  } catch {
168
197
  } finally {
169
198
  setLoading(false);
@@ -174,13 +203,21 @@ function AdditionalSettingsTab() {
174
203
  try {
175
204
  setSaving(true);
176
205
  setToast(null);
177
- const json = await adminFetch("/admin/paypal/settings", { method: "POST", body: { additional_settings: form } });
206
+ const json = await adminFetch("/admin/paypal/settings", {
207
+ method: "POST",
208
+ body: {
209
+ additional_settings: form
210
+ }
211
+ });
178
212
  const payload = (json == null ? void 0 : json.data) ?? json;
179
213
  const saved = payload == null ? void 0 : payload.additional_settings;
180
214
  if (saved && typeof saved === "object") setForm(mergeWithDefaults$1(saved));
181
215
  setToast({ kind: "success", message: "Settings saved" });
182
216
  } catch (e) {
183
- setToast({ kind: "error", message: e instanceof Error ? e.message : "Failed to save settings" });
217
+ setToast({
218
+ kind: "error",
219
+ message: e instanceof Error ? e.message : "Failed to save settings"
220
+ });
184
221
  } finally {
185
222
  setSaving(false);
186
223
  }
@@ -195,35 +232,137 @@ function AdditionalSettingsTab() {
195
232
  title: "Additional Settings",
196
233
  description: "These settings control checkout behavior and PayPal experience.",
197
234
  right: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
198
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onSave, disabled: saving || loading, className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5", children: saving ? "Saving..." : "Save settings" }),
235
+ /* @__PURE__ */ jsxRuntime.jsx(
236
+ "button",
237
+ {
238
+ type: "button",
239
+ onClick: onSave,
240
+ disabled: saving || loading,
241
+ className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5",
242
+ children: saving ? "Saving..." : "Save settings"
243
+ }
244
+ ),
199
245
  loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading…" }) : null
200
246
  ] }),
201
247
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-ui-border-base", children: [
202
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Payment action", htmlFor: "as-payment-action", children: /* @__PURE__ */ jsxRuntime.jsxs("select", { id: "as-payment-action", value: form.paymentAction, onChange: (e) => setForm((p) => ({ ...p, paymentAction: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", children: [
203
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "capture", children: "Capture" }),
204
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "authorize", children: "Authorize" })
205
- ] }) }),
206
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Brand Name", htmlFor: "as-brand-name", children: /* @__PURE__ */ jsxRuntime.jsx("input", { id: "as-brand-name", value: form.brandName, onChange: (e) => setForm((p) => ({ ...p, brandName: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", placeholder: "PayPal" }) }),
207
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Landing Page", htmlFor: "as-landing-page", children: /* @__PURE__ */ jsxRuntime.jsxs("select", { id: "as-landing-page", value: form.landingPage, onChange: (e) => setForm((p) => ({ ...p, landingPage: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", children: [
208
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "no_preference", children: "No Preference" }),
209
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "login", children: "Login" }),
210
- /* @__PURE__ */ jsxRuntime.jsx("option", { value: "billing", children: "Billing" })
211
- ] }) }),
248
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Payment action", htmlFor: "as-payment-action", children: /* @__PURE__ */ jsxRuntime.jsxs(
249
+ "select",
250
+ {
251
+ id: "as-payment-action",
252
+ value: form.paymentAction,
253
+ onChange: (e) => setForm((p) => ({
254
+ ...p,
255
+ paymentAction: e.target.value
256
+ })),
257
+ className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
258
+ children: [
259
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "capture", children: "Capture" }),
260
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "authorize", children: "Authorize" })
261
+ ]
262
+ }
263
+ ) }),
264
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Brand Name", htmlFor: "as-brand-name", children: /* @__PURE__ */ jsxRuntime.jsx(
265
+ "input",
266
+ {
267
+ id: "as-brand-name",
268
+ value: form.brandName,
269
+ onChange: (e) => setForm((p) => ({ ...p, brandName: e.target.value })),
270
+ className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
271
+ placeholder: "PayPal"
272
+ }
273
+ ) }),
274
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Landing Page", htmlFor: "as-landing-page", children: /* @__PURE__ */ jsxRuntime.jsxs(
275
+ "select",
276
+ {
277
+ id: "as-landing-page",
278
+ value: form.landingPage,
279
+ onChange: (e) => setForm((p) => ({
280
+ ...p,
281
+ landingPage: e.target.value
282
+ })),
283
+ className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
284
+ children: [
285
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "no_preference", children: "No Preference" }),
286
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "login", children: "Login" }),
287
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "billing", children: "Billing" })
288
+ ]
289
+ }
290
+ ) }),
212
291
  /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Instant Payments", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
213
- /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", checked: form.requireInstantPayment, onChange: (e) => setForm((p) => ({ ...p, requireInstantPayment: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
292
+ /* @__PURE__ */ jsxRuntime.jsx(
293
+ "input",
294
+ {
295
+ type: "checkbox",
296
+ checked: form.requireInstantPayment,
297
+ onChange: (e) => setForm((p) => ({
298
+ ...p,
299
+ requireInstantPayment: e.target.checked
300
+ })),
301
+ className: "h-4 w-4 rounded border-ui-border-base"
302
+ }
303
+ ),
214
304
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Require Instant Payment" })
215
305
  ] }) }),
216
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Send Item Details", hint: "Include all line item details in the payment request to PayPal so that they can be seen from the PayPal transaction details page.", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
217
- /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", checked: form.sendItemDetails, onChange: (e) => setForm((p) => ({ ...p, sendItemDetails: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
218
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Send line item details to PayPal" })
219
- ] }) }),
220
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Invoice prefix", htmlFor: "as-invoice-prefix", children: /* @__PURE__ */ jsxRuntime.jsx("input", { id: "as-invoice-prefix", value: form.invoicePrefix, onChange: (e) => setForm((p) => ({ ...p, invoicePrefix: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", placeholder: "PP-" }) }),
221
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Credit Card Statement Name", htmlFor: "as-cc-statement", children: /* @__PURE__ */ jsxRuntime.jsx("input", { id: "as-cc-statement", value: form.creditCardStatementName, onChange: (e) => setForm((p) => ({ ...p, creditCardStatementName: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", placeholder: "PayPal" }) })
306
+ /* @__PURE__ */ jsxRuntime.jsx(
307
+ FieldRow,
308
+ {
309
+ label: "Send Item Details",
310
+ hint: "Include all line item details in the payment request to PayPal so that they can be seen from the PayPal transaction details page.",
311
+ children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
312
+ /* @__PURE__ */ jsxRuntime.jsx(
313
+ "input",
314
+ {
315
+ type: "checkbox",
316
+ checked: form.sendItemDetails,
317
+ onChange: (e) => setForm((p) => ({
318
+ ...p,
319
+ sendItemDetails: e.target.checked
320
+ })),
321
+ className: "h-4 w-4 rounded border-ui-border-base"
322
+ }
323
+ ),
324
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Send line item details to PayPal" })
325
+ ] })
326
+ }
327
+ ),
328
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Invoice prefix", htmlFor: "as-invoice-prefix", children: /* @__PURE__ */ jsxRuntime.jsx(
329
+ "input",
330
+ {
331
+ id: "as-invoice-prefix",
332
+ value: form.invoicePrefix,
333
+ onChange: (e) => setForm((p) => ({ ...p, invoicePrefix: e.target.value })),
334
+ className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
335
+ placeholder: "PP-"
336
+ }
337
+ ) }),
338
+ /* @__PURE__ */ jsxRuntime.jsx(
339
+ FieldRow,
340
+ {
341
+ label: "Credit Card Statement Name",
342
+ htmlFor: "as-cc-statement",
343
+ children: /* @__PURE__ */ jsxRuntime.jsx(
344
+ "input",
345
+ {
346
+ id: "as-cc-statement",
347
+ value: form.creditCardStatementName,
348
+ onChange: (e) => setForm((p) => ({
349
+ ...p,
350
+ creditCardStatementName: e.target.value
351
+ })),
352
+ className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
353
+ placeholder: "PayPal"
354
+ }
355
+ )
356
+ }
357
+ )
222
358
  ] })
223
359
  }
224
360
  )
225
361
  ] }) });
226
362
  }
363
+ function PayPalApplePayPage() {
364
+ return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
365
+ }
227
366
  const DEFAULT_FORM = {
228
367
  enabled: true,
229
368
  title: "Credit or Debit Card",
@@ -231,17 +370,36 @@ const DEFAULT_FORM = {
231
370
  };
232
371
  function mergeWithDefaults(saved) {
233
372
  if (!saved) return { ...DEFAULT_FORM };
234
- const entries = Object.entries(saved).filter(([, value]) => value !== void 0);
235
- return { ...DEFAULT_FORM, ...Object.fromEntries(entries) };
373
+ const entries = Object.entries(saved).filter(
374
+ ([, value]) => value !== void 0
375
+ );
376
+ return {
377
+ ...DEFAULT_FORM,
378
+ ...Object.fromEntries(entries)
379
+ };
236
380
  }
237
381
  const THREE_DS_OPTIONS = [
238
- { value: "when_required", label: "3D Secure when required", hint: "Triggers 3DS only when the card / issuer requires it." },
239
- { value: "sli", label: "3D Secure (SCA) / liability shift (recommended)", hint: "Attempts to optimize for liability shift while remaining compliant." },
240
- { value: "always", label: "Always request 3D Secure", hint: "Forces 3DS challenge whenever possible (may reduce conversion)." }
382
+ {
383
+ value: "when_required",
384
+ label: "3D Secure when required",
385
+ hint: "Triggers 3DS only when the card / issuer requires it."
386
+ },
387
+ {
388
+ value: "sli",
389
+ label: "3D Secure (SCA) / liability shift (recommended)",
390
+ hint: "Attempts to optimize for liability shift while remaining compliant."
391
+ },
392
+ {
393
+ value: "always",
394
+ label: "Always request 3D Secure",
395
+ hint: "Forces 3DS challenge whenever possible (may reduce conversion)."
396
+ }
241
397
  ];
242
398
  function AdvancedCardPaymentsTab() {
243
399
  var _a, _b;
244
- const [form, setForm] = react.useState(() => ({ ...DEFAULT_FORM }));
400
+ const [form, setForm] = react.useState(() => ({
401
+ ...DEFAULT_FORM
402
+ }));
245
403
  const [loading, setLoading] = react.useState(false);
246
404
  const [saving, setSaving] = react.useState(false);
247
405
  const [toast, setToast] = react.useState(null);
@@ -256,7 +414,8 @@ function AdvancedCardPaymentsTab() {
256
414
  const json = await adminFetch("/admin/paypal/settings");
257
415
  const payload = (json == null ? void 0 : json.data) ?? json;
258
416
  const saved = payload == null ? void 0 : payload.advanced_card_payments;
259
- if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
417
+ if (saved && typeof saved === "object")
418
+ setForm(mergeWithDefaults(saved));
260
419
  } catch {
261
420
  } finally {
262
421
  setLoading(false);
@@ -268,14 +427,19 @@ function AdvancedCardPaymentsTab() {
268
427
  setSaving(true);
269
428
  const json = await adminFetch("/admin/paypal/settings", {
270
429
  method: "POST",
271
- body: { advanced_card_payments: form }
430
+ body: {
431
+ advanced_card_payments: form
432
+ }
272
433
  });
273
434
  const payload = (json == null ? void 0 : json.data) ?? json;
274
435
  const saved = payload == null ? void 0 : payload.advanced_card_payments;
275
436
  if (saved && typeof saved === "object") setForm(mergeWithDefaults(saved));
276
437
  setToast({ kind: "success", message: "Settings saved" });
277
438
  } catch (e) {
278
- setToast({ kind: "error", message: (e instanceof Error ? e.message : "") || "Failed to save settings." });
439
+ setToast({
440
+ kind: "error",
441
+ message: (e instanceof Error ? e.message : "") || "Failed to save settings."
442
+ });
279
443
  } finally {
280
444
  setSaving(false);
281
445
  }
@@ -290,30 +454,70 @@ function AdvancedCardPaymentsTab() {
290
454
  title: "Advanced Card Payments",
291
455
  description: "Control card checkout settings and 3D Secure behavior.",
292
456
  right: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
293
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onSave, disabled: saving || loading, className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5", children: saving ? "Saving..." : "Save settings" }),
457
+ /* @__PURE__ */ jsxRuntime.jsx(
458
+ "button",
459
+ {
460
+ type: "button",
461
+ onClick: onSave,
462
+ disabled: saving || loading,
463
+ className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5",
464
+ children: saving ? "Saving..." : "Save settings"
465
+ }
466
+ ),
294
467
  loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-subtle", children: "Loading…" }) : null
295
468
  ] }),
296
469
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "divide-y divide-ui-border-base", children: [
297
470
  /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Enable/Disable", children: /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "inline-flex items-center gap-2", children: [
298
- /* @__PURE__ */ jsxRuntime.jsx("input", { type: "checkbox", checked: form.enabled, onChange: (e) => setForm((p) => ({ ...p, enabled: e.target.checked })), className: "h-4 w-4 rounded border-ui-border-base" }),
471
+ /* @__PURE__ */ jsxRuntime.jsx(
472
+ "input",
473
+ {
474
+ type: "checkbox",
475
+ checked: form.enabled,
476
+ onChange: (e) => setForm((p) => ({ ...p, enabled: e.target.checked })),
477
+ className: "h-4 w-4 rounded border-ui-border-base"
478
+ }
479
+ ),
299
480
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-ui-fg-base", children: "Enable Advanced Credit/Debit Card" })
300
481
  ] }) }),
301
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Title", htmlFor: "acp-title", children: /* @__PURE__ */ jsxRuntime.jsx("input", { id: "acp-title", value: form.title, onChange: (e) => setForm((p) => ({ ...p, title: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", placeholder: "Credit or Debit Card" }) }),
302
- /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Contingency for 3D Secure", hint: "Choose when 3D Secure should be triggered during card payments.", htmlFor: "acp-threeds", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
303
- /* @__PURE__ */ jsxRuntime.jsx("select", { id: "acp-threeds", value: form.threeDS, onChange: (e) => setForm((p) => ({ ...p, threeDS: e.target.value })), className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive", children: THREE_DS_OPTIONS.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value)) }),
304
- ((_a = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _a.hint) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-ui-fg-subtle", children: (_b = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _b.hint }) : null
305
- ] }) })
482
+ /* @__PURE__ */ jsxRuntime.jsx(FieldRow, { label: "Title", htmlFor: "acp-title", children: /* @__PURE__ */ jsxRuntime.jsx(
483
+ "input",
484
+ {
485
+ id: "acp-title",
486
+ value: form.title,
487
+ onChange: (e) => setForm((p) => ({ ...p, title: e.target.value })),
488
+ className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
489
+ placeholder: "Credit or Debit Card"
490
+ }
491
+ ) }),
492
+ /* @__PURE__ */ jsxRuntime.jsx(
493
+ FieldRow,
494
+ {
495
+ label: "Contingency for 3D Secure",
496
+ hint: "Choose when 3D Secure should be triggered during card payments.",
497
+ htmlFor: "acp-threeds",
498
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
499
+ /* @__PURE__ */ jsxRuntime.jsx(
500
+ "select",
501
+ {
502
+ id: "acp-threeds",
503
+ value: form.threeDS,
504
+ onChange: (e) => setForm((p) => ({
505
+ ...p,
506
+ threeDS: e.target.value
507
+ })),
508
+ className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
509
+ children: THREE_DS_OPTIONS.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value))
510
+ }
511
+ ),
512
+ ((_a = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _a.hint) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-ui-fg-subtle", children: (_b = THREE_DS_OPTIONS.find((o) => o.value === form.threeDS)) == null ? void 0 : _b.hint }) : null
513
+ ] })
514
+ }
515
+ )
306
516
  ] })
307
517
  }
308
518
  )
309
519
  ] }) });
310
520
  }
311
- function PayPalApplePayPage() {
312
- return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
313
- }
314
- function PayPalGooglePayPage() {
315
- return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
316
- }
317
521
  const config = adminSdk.defineRouteConfig({
318
522
  label: "PayPal Connection"
319
523
  });
@@ -342,7 +546,10 @@ function readCachedUrl(env) {
342
546
  }
343
547
  function writeCachedUrl(env, url) {
344
548
  try {
345
- localStorage.setItem(cacheKeyFor(env), JSON.stringify({ url, ts: Date.now() }));
549
+ localStorage.setItem(
550
+ cacheKeyFor(env),
551
+ JSON.stringify({ url, ts: Date.now() })
552
+ );
346
553
  } catch {
347
554
  }
348
555
  }
@@ -527,7 +734,8 @@ function PayPalConnectionPage() {
527
734
  ppScript.async = true;
528
735
  document.head.appendChild(ppScript);
529
736
  return () => {
530
- if (preloadLink == null ? void 0 : preloadLink.parentNode) preloadLink.parentNode.removeChild(preloadLink);
737
+ if (preloadLink == null ? void 0 : preloadLink.parentNode)
738
+ preloadLink.parentNode.removeChild(preloadLink);
531
739
  if (ppScript.parentNode) ppScript.parentNode.removeChild(ppScript);
532
740
  };
533
741
  }, []);
@@ -564,7 +772,8 @@ function PayPalConnectionPage() {
564
772
  async (targetEnv, runId) => {
565
773
  if (initLoaderRef.current) {
566
774
  const loaderText = initLoaderRef.current.querySelector("#loader-text");
567
- if (loaderText) loaderText.textContent = "Generating onboarding session...";
775
+ if (loaderText)
776
+ loaderText.textContent = "Generating onboarding session...";
568
777
  }
569
778
  try {
570
779
  const res = await fetch(SERVICE_URL, {
@@ -854,61 +1063,73 @@ function PayPalConnectionPage() {
854
1063
  ]
855
1064
  }
856
1065
  ),
857
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${connState === "ready" ? "block" : "hidden"}`, children: [
858
- /* @__PURE__ */ jsxRuntime.jsx(
859
- "a",
860
- {
861
- ref: (node) => {
862
- paypalButtonRef.current = node;
863
- ppBtnMeasureRef.current = node;
864
- },
865
- id: "paypal-button",
866
- "data-paypal-button": "true",
867
- href: finalUrl || "#",
868
- "data-paypal-onboard-complete": "onboardingCallback",
869
- onClick: handleConnectClick,
870
- className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none no-underline shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5",
871
- style: {
872
- cursor: onboardingInProgress ? "not-allowed" : "pointer",
873
- opacity: onboardingInProgress ? 0.6 : 1,
874
- pointerEvents: onboardingInProgress ? "none" : "auto"
875
- },
876
- children: "Connect to PayPal"
877
- }
878
- ),
879
- /* @__PURE__ */ jsxRuntime.jsx(
880
- "div",
881
- {
882
- className: "mt-2",
883
- style: {
884
- width: ppBtnWidth ? `${ppBtnWidth}px` : "auto",
885
- marginTop: "20px",
886
- marginBottom: "10px"
887
- },
888
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-ui-fg-muted leading-none", children: "OR" }) })
889
- }
890
- ),
891
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntime.jsx(
892
- "button",
893
- {
894
- type: "button",
895
- onClick: () => setShowManual(!showManual),
896
- disabled: onboardingInProgress,
897
- className: "text-sm text-ui-fg-interactive underline whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed",
898
- children: "Click here to insert credentials manually"
899
- }
900
- ) })
901
- ] }),
902
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${connState === "ready" ? "hidden" : "block"} mt-3`, children: /* @__PURE__ */ jsxRuntime.jsx(
903
- "button",
1066
+ /* @__PURE__ */ jsxRuntime.jsxs(
1067
+ "div",
904
1068
  {
905
- type: "button",
906
- onClick: () => setShowManual(!showManual),
907
- disabled: onboardingInProgress,
908
- className: "text-sm text-ui-fg-interactive underline whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed",
909
- children: "Click here to insert credentials manually"
1069
+ className: `${connState === "ready" ? "block" : "hidden"}`,
1070
+ children: [
1071
+ /* @__PURE__ */ jsxRuntime.jsx(
1072
+ "a",
1073
+ {
1074
+ ref: (node) => {
1075
+ paypalButtonRef.current = node;
1076
+ ppBtnMeasureRef.current = node;
1077
+ },
1078
+ id: "paypal-button",
1079
+ "data-paypal-button": "true",
1080
+ href: finalUrl || "#",
1081
+ "data-paypal-onboard-complete": "onboardingCallback",
1082
+ onClick: handleConnectClick,
1083
+ className: "transition-fg relative inline-flex w-fit items-center justify-center overflow-hidden rounded-md outline-none no-underline shadow-buttons-neutral text-ui-fg-base bg-ui-button-neutral after:transition-fg after:absolute after:inset-0 after:content-[''] after:button-neutral-gradient hover:bg-ui-button-neutral-hover hover:after:button-neutral-hover-gradient active:bg-ui-button-neutral-pressed active:after:button-neutral-pressed-gradient focus-visible:shadow-buttons-neutral-focus disabled:bg-ui-bg-disabled disabled:border-ui-border-base disabled:text-ui-fg-disabled disabled:shadow-buttons-neutral disabled:after:hidden txt-compact-small-plus px-3 py-1.5",
1084
+ style: {
1085
+ cursor: onboardingInProgress ? "not-allowed" : "pointer",
1086
+ opacity: onboardingInProgress ? 0.6 : 1,
1087
+ pointerEvents: onboardingInProgress ? "none" : "auto"
1088
+ },
1089
+ children: "Connect to PayPal"
1090
+ }
1091
+ ),
1092
+ /* @__PURE__ */ jsxRuntime.jsx(
1093
+ "div",
1094
+ {
1095
+ className: "mt-2",
1096
+ style: {
1097
+ width: ppBtnWidth ? `${ppBtnWidth}px` : "auto",
1098
+ marginTop: "20px",
1099
+ marginBottom: "10px"
1100
+ },
1101
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-ui-fg-muted leading-none", children: "OR" }) })
1102
+ }
1103
+ ),
1104
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsxRuntime.jsx(
1105
+ "button",
1106
+ {
1107
+ type: "button",
1108
+ onClick: () => setShowManual(!showManual),
1109
+ disabled: onboardingInProgress,
1110
+ className: "text-sm text-ui-fg-interactive underline whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed",
1111
+ children: "Click here to insert credentials manually"
1112
+ }
1113
+ ) })
1114
+ ]
910
1115
  }
911
- ) }),
1116
+ ),
1117
+ /* @__PURE__ */ jsxRuntime.jsx(
1118
+ "div",
1119
+ {
1120
+ className: `${connState === "ready" ? "hidden" : "block"} mt-3`,
1121
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1122
+ "button",
1123
+ {
1124
+ type: "button",
1125
+ onClick: () => setShowManual(!showManual),
1126
+ disabled: onboardingInProgress,
1127
+ className: "text-sm text-ui-fg-interactive underline whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed",
1128
+ children: "Click here to insert credentials manually"
1129
+ }
1130
+ )
1131
+ }
1132
+ ),
912
1133
  /* @__PURE__ */ jsxRuntime.jsx(
913
1134
  "div",
914
1135
  {
@@ -921,7 +1142,14 @@ function PayPalConnectionPage() {
921
1142
  ] }) }),
922
1143
  showManual && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:col-span-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-[260px] max-w-xl mt-4 grid grid-cols-1 gap-3 md:grid-cols-2", children: [
923
1144
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
924
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "pp-manual-client-id", className: "text-sm font-medium", children: "Client ID" }),
1145
+ /* @__PURE__ */ jsxRuntime.jsx(
1146
+ "label",
1147
+ {
1148
+ htmlFor: "pp-manual-client-id",
1149
+ className: "text-sm font-medium",
1150
+ children: "Client ID"
1151
+ }
1152
+ ),
925
1153
  /* @__PURE__ */ jsxRuntime.jsx(
926
1154
  "input",
927
1155
  {
@@ -936,7 +1164,14 @@ function PayPalConnectionPage() {
936
1164
  )
937
1165
  ] }),
938
1166
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
939
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: "pp-manual-secret", className: "text-sm font-medium", children: "Secret" }),
1167
+ /* @__PURE__ */ jsxRuntime.jsx(
1168
+ "label",
1169
+ {
1170
+ htmlFor: "pp-manual-secret",
1171
+ className: "text-sm font-medium",
1172
+ children: "Secret"
1173
+ }
1174
+ ),
940
1175
  /* @__PURE__ */ jsxRuntime.jsx(
941
1176
  "input",
942
1177
  {
@@ -970,18 +1205,25 @@ function PayPalConnectionPage() {
970
1205
  "and sign in or create an account."
971
1206
  ] }),
972
1207
  /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
973
- "Select ",
1208
+ "Select",
1209
+ " ",
974
1210
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-ui-fg-base", children: "Apps & Credentials" }),
975
- ", then choose ",
1211
+ ", then choose",
1212
+ " ",
976
1213
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-ui-fg-base", children: "Create App" }),
977
- " if you need a new project."
1214
+ " ",
1215
+ "if you need a new project."
978
1216
  ] }),
979
1217
  /* @__PURE__ */ jsxRuntime.jsxs("li", { children: [
980
- "Copy your app's ",
1218
+ "Copy your app's",
1219
+ " ",
981
1220
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-ui-fg-base", children: "Client ID" }),
982
- " and ",
1221
+ " ",
1222
+ "and",
1223
+ " ",
983
1224
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-ui-fg-base", children: "Secret" }),
984
- ", paste them above, then click ",
1225
+ ", paste them above, then click",
1226
+ " ",
985
1227
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium text-ui-fg-base", children: "Save credentials" }),
986
1228
  "."
987
1229
  ] })
@@ -1031,6 +1273,9 @@ function PayPalConnectionPage() {
1031
1273
  ` })
1032
1274
  ] });
1033
1275
  }
1276
+ function PayPalGooglePayPage() {
1277
+ return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
1278
+ }
1034
1279
  function PayPalPayLaterMessagingPage() {
1035
1280
  return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/settings/paypal/connection", replace: true });
1036
1281
  }
@@ -1080,9 +1325,7 @@ function PayPalSettingsTab() {
1080
1325
  (async () => {
1081
1326
  try {
1082
1327
  setLoading(true);
1083
- const json = await adminFetch(
1084
- "/admin/paypal/settings"
1085
- );
1328
+ const json = await adminFetch("/admin/paypal/settings");
1086
1329
  const payload = (json == null ? void 0 : json.data) ?? json;
1087
1330
  const saved = payload == null ? void 0 : payload.paypal_settings;
1088
1331
  if (saved && typeof saved === "object") {
@@ -1101,13 +1344,12 @@ function PayPalSettingsTab() {
1101
1344
  try {
1102
1345
  setSaving(true);
1103
1346
  const cleaned = { ...form };
1104
- const json = await adminFetch(
1105
- "/admin/paypal/settings",
1106
- {
1107
- method: "POST",
1108
- body: { paypal_settings: cleaned }
1347
+ const json = await adminFetch("/admin/paypal/settings", {
1348
+ method: "POST",
1349
+ body: {
1350
+ paypal_settings: cleaned
1109
1351
  }
1110
- );
1352
+ });
1111
1353
  const payload = (json == null ? void 0 : json.data) ?? json;
1112
1354
  const saved = payload == null ? void 0 : payload.paypal_settings;
1113
1355
  if (saved && typeof saved === "object") {
@@ -1127,10 +1369,7 @@ function PayPalSettingsTab() {
1127
1369
  }
1128
1370
  }
1129
1371
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-6", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-6", children: [
1130
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4", children: [
1131
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-xl font-semibold text-ui-fg-base", children: "PayPal Gateway By Easy Payment" }) }),
1132
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2" })
1133
- ] }),
1372
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-start justify-between gap-4", children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-xl font-semibold text-ui-fg-base", children: "PayPal Gateway By Easy Payment" }) }) }),
1134
1373
  /* @__PURE__ */ jsxRuntime.jsx(PayPalTabs, {}),
1135
1374
  /* @__PURE__ */ jsxRuntime.jsx(Toast, { toast, onClose: dismissToast }),
1136
1375
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1188,7 +1427,10 @@ function PayPalSettingsTab() {
1188
1427
  {
1189
1428
  id: "pp-btn-color",
1190
1429
  value: form.buttonColor,
1191
- onChange: (e) => setForm((p) => ({ ...p, buttonColor: e.target.value })),
1430
+ onChange: (e) => setForm((p) => ({
1431
+ ...p,
1432
+ buttonColor: e.target.value
1433
+ })),
1192
1434
  className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
1193
1435
  children: COLOR_OPTIONS.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value))
1194
1436
  }
@@ -1198,7 +1440,10 @@ function PayPalSettingsTab() {
1198
1440
  {
1199
1441
  id: "pp-btn-shape",
1200
1442
  value: form.buttonShape,
1201
- onChange: (e) => setForm((p) => ({ ...p, buttonShape: e.target.value })),
1443
+ onChange: (e) => setForm((p) => ({
1444
+ ...p,
1445
+ buttonShape: e.target.value
1446
+ })),
1202
1447
  className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
1203
1448
  children: SHAPE_OPTIONS.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value))
1204
1449
  }
@@ -1208,7 +1453,10 @@ function PayPalSettingsTab() {
1208
1453
  {
1209
1454
  id: "pp-btn-width",
1210
1455
  value: form.buttonWidth,
1211
- onChange: (e) => setForm((p) => ({ ...p, buttonWidth: e.target.value })),
1456
+ onChange: (e) => setForm((p) => ({
1457
+ ...p,
1458
+ buttonWidth: e.target.value
1459
+ })),
1212
1460
  className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
1213
1461
  children: WIDTH_OPTIONS.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value))
1214
1462
  }
@@ -1218,7 +1466,10 @@ function PayPalSettingsTab() {
1218
1466
  {
1219
1467
  id: "pp-btn-height",
1220
1468
  value: String(form.buttonHeight),
1221
- onChange: (e) => setForm((p) => ({ ...p, buttonHeight: Number(e.target.value) })),
1469
+ onChange: (e) => setForm((p) => ({
1470
+ ...p,
1471
+ buttonHeight: Number(e.target.value)
1472
+ })),
1222
1473
  className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
1223
1474
  children: HEIGHT_OPTIONS.map((h) => /* @__PURE__ */ jsxRuntime.jsxs("option", { value: h, children: [
1224
1475
  h,
@@ -1231,7 +1482,10 @@ function PayPalSettingsTab() {
1231
1482
  {
1232
1483
  id: "pp-btn-label",
1233
1484
  value: form.buttonLabel,
1234
- onChange: (e) => setForm((p) => ({ ...p, buttonLabel: e.target.value })),
1485
+ onChange: (e) => setForm((p) => ({
1486
+ ...p,
1487
+ buttonLabel: e.target.value
1488
+ })),
1235
1489
  className: "w-full rounded-md border border-ui-border-base bg-ui-bg-base px-3 py-2 text-sm text-ui-fg-base outline-none focus:ring-2 focus:ring-ui-border-interactive",
1236
1490
  children: LABEL_OPTIONS.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value))
1237
1491
  }
@@ -1252,22 +1506,22 @@ const routeModule = {
1252
1506
  Component: AdditionalSettingsTab,
1253
1507
  path: "/settings/paypal/additional-settings"
1254
1508
  },
1255
- {
1256
- Component: AdvancedCardPaymentsTab,
1257
- path: "/settings/paypal/advanced-card-payments"
1258
- },
1259
1509
  {
1260
1510
  Component: PayPalApplePayPage,
1261
1511
  path: "/settings/paypal/apple-pay"
1262
1512
  },
1263
1513
  {
1264
- Component: PayPalGooglePayPage,
1265
- path: "/settings/paypal/google-pay"
1514
+ Component: AdvancedCardPaymentsTab,
1515
+ path: "/settings/paypal/advanced-card-payments"
1266
1516
  },
1267
1517
  {
1268
1518
  Component: PayPalConnectionPage,
1269
1519
  path: "/settings/paypal/connection"
1270
1520
  },
1521
+ {
1522
+ Component: PayPalGooglePayPage,
1523
+ path: "/settings/paypal/google-pay"
1524
+ },
1271
1525
  {
1272
1526
  Component: PayPalPayLaterMessagingPage,
1273
1527
  path: "/settings/paypal/pay-later-messaging"