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