@easypayment/medusa-payment-paypal 1.2.2 → 1.2.4

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 (267) hide show
  1. package/.medusa/server/src/admin/index.js +390 -136
  2. package/.medusa/server/src/admin/index.mjs +390 -136
  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 +5 -0
  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 +54 -20
  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 +33 -6
  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.map +1 -1
  113. package/.medusa/server/src/modules/paypal/payment-provider/base-provider.js.map +1 -1
  114. package/.medusa/server/src/modules/paypal/payment-provider/card-service.d.ts +14 -6
  115. package/.medusa/server/src/modules/paypal/payment-provider/card-service.d.ts.map +1 -1
  116. package/.medusa/server/src/modules/paypal/payment-provider/card-service.js +55 -32
  117. package/.medusa/server/src/modules/paypal/payment-provider/card-service.js.map +1 -1
  118. package/.medusa/server/src/modules/paypal/payment-provider/index.d.ts +6 -1
  119. package/.medusa/server/src/modules/paypal/payment-provider/index.d.ts.map +1 -1
  120. package/.medusa/server/src/modules/paypal/payment-provider/index.js +6 -4
  121. package/.medusa/server/src/modules/paypal/payment-provider/index.js.map +1 -1
  122. package/.medusa/server/src/modules/paypal/payment-provider/service.d.ts +8 -0
  123. package/.medusa/server/src/modules/paypal/payment-provider/service.d.ts.map +1 -1
  124. package/.medusa/server/src/modules/paypal/payment-provider/service.js +39 -12
  125. package/.medusa/server/src/modules/paypal/payment-provider/service.js.map +1 -1
  126. package/.medusa/server/src/modules/paypal/service.d.ts +72 -2
  127. package/.medusa/server/src/modules/paypal/service.d.ts.map +1 -1
  128. package/.medusa/server/src/modules/paypal/service.js +159 -33
  129. package/.medusa/server/src/modules/paypal/service.js.map +1 -1
  130. package/.medusa/server/src/modules/paypal/types/config.d.ts +2 -0
  131. package/.medusa/server/src/modules/paypal/types/config.d.ts.map +1 -1
  132. package/.medusa/server/src/modules/paypal/types/config.js +5 -2
  133. package/.medusa/server/src/modules/paypal/types/config.js.map +1 -1
  134. package/.medusa/server/src/modules/paypal/utils/amounts.d.ts +1 -0
  135. package/.medusa/server/src/modules/paypal/utils/amounts.d.ts.map +1 -1
  136. package/.medusa/server/src/modules/paypal/utils/amounts.js +15 -5
  137. package/.medusa/server/src/modules/paypal/utils/amounts.js.map +1 -1
  138. package/.medusa/server/src/modules/paypal/utils/credential-resolver.d.ts.map +1 -1
  139. package/.medusa/server/src/modules/paypal/utils/credential-resolver.js +3 -1
  140. package/.medusa/server/src/modules/paypal/utils/credential-resolver.js.map +1 -1
  141. package/.medusa/server/src/modules/paypal/utils/currencies.d.ts +9 -0
  142. package/.medusa/server/src/modules/paypal/utils/currencies.d.ts.map +1 -1
  143. package/.medusa/server/src/modules/paypal/utils/currencies.js +13 -0
  144. package/.medusa/server/src/modules/paypal/utils/currencies.js.map +1 -1
  145. package/.medusa/server/src/modules/paypal/utils/payment-session.d.ts +12 -0
  146. package/.medusa/server/src/modules/paypal/utils/payment-session.d.ts.map +1 -1
  147. package/.medusa/server/src/modules/paypal/utils/payment-session.js +4 -3
  148. package/.medusa/server/src/modules/paypal/utils/payment-session.js.map +1 -1
  149. package/.medusa/server/src/modules/paypal/utils/paypal-auth.d.ts +1 -0
  150. package/.medusa/server/src/modules/paypal/utils/paypal-auth.d.ts.map +1 -1
  151. package/.medusa/server/src/modules/paypal/utils/paypal-auth.js +1 -0
  152. package/.medusa/server/src/modules/paypal/utils/paypal-auth.js.map +1 -1
  153. package/.medusa/server/src/modules/paypal/utils/paypal-fetch.d.ts +11 -0
  154. package/.medusa/server/src/modules/paypal/utils/paypal-fetch.d.ts.map +1 -1
  155. package/.medusa/server/src/modules/paypal/utils/paypal-fetch.js +17 -1
  156. package/.medusa/server/src/modules/paypal/utils/paypal-fetch.js.map +1 -1
  157. package/.medusa/server/src/modules/paypal/utils/provider-ids.d.ts +6 -0
  158. package/.medusa/server/src/modules/paypal/utils/provider-ids.d.ts.map +1 -1
  159. package/.medusa/server/src/modules/paypal/utils/provider-ids.js +6 -0
  160. package/.medusa/server/src/modules/paypal/utils/provider-ids.js.map +1 -1
  161. package/.medusa/server/src/modules/paypal/utils/secret-crypto.d.ts +2 -0
  162. package/.medusa/server/src/modules/paypal/utils/secret-crypto.d.ts.map +1 -1
  163. package/.medusa/server/src/modules/paypal/utils/secret-crypto.js +6 -1
  164. package/.medusa/server/src/modules/paypal/utils/secret-crypto.js.map +1 -1
  165. package/.medusa/server/src/modules/paypal/webhook-processor.d.ts +43 -0
  166. package/.medusa/server/src/modules/paypal/webhook-processor.d.ts.map +1 -1
  167. package/.medusa/server/src/modules/paypal/webhook-processor.js +57 -5
  168. package/.medusa/server/src/modules/paypal/webhook-processor.js.map +1 -1
  169. package/.medusa/server/src/providers/paypal/index.d.ts +1 -0
  170. package/.medusa/server/src/providers/paypal/index.d.ts.map +1 -1
  171. package/.medusa/server/src/providers/paypal/index.js +1 -0
  172. package/.medusa/server/src/providers/paypal/index.js.map +1 -1
  173. package/.medusa/server/src/providers/paypal_card/index.d.ts +1 -0
  174. package/.medusa/server/src/providers/paypal_card/index.d.ts.map +1 -1
  175. package/.medusa/server/src/providers/paypal_card/index.js +1 -0
  176. package/.medusa/server/src/providers/paypal_card/index.js.map +1 -1
  177. package/.medusa/server/src/subscribers/paypal-order-invoice.d.ts +6 -0
  178. package/.medusa/server/src/subscribers/paypal-order-invoice.d.ts.map +1 -1
  179. package/.medusa/server/src/subscribers/paypal-order-invoice.js +9 -1
  180. package/.medusa/server/src/subscribers/paypal-order-invoice.js.map +1 -1
  181. package/.medusa/server/src/subscribers/paypal-webhook-process.d.ts +1 -0
  182. package/.medusa/server/src/subscribers/paypal-webhook-process.d.ts.map +1 -1
  183. package/.medusa/server/src/subscribers/paypal-webhook-process.js +17 -4
  184. package/.medusa/server/src/subscribers/paypal-webhook-process.js.map +1 -1
  185. package/CHANGELOG.md +19 -0
  186. package/README.md +184 -175
  187. package/package.json +24 -5
  188. package/src/admin/index.ts +1 -1
  189. package/src/admin/routes/settings/paypal/_components/FieldRow.tsx +38 -29
  190. package/src/admin/routes/settings/paypal/_components/SectionCard.tsx +29 -26
  191. package/src/admin/routes/settings/paypal/_components/Tabs.tsx +49 -48
  192. package/src/admin/routes/settings/paypal/_components/Toast.tsx +63 -52
  193. package/src/admin/routes/settings/paypal/_utils/adminFetch.ts +52 -32
  194. package/src/admin/routes/settings/paypal/additional-settings/page.tsx +246 -139
  195. package/src/admin/routes/settings/paypal/advanced-card-payments/page.tsx +208 -123
  196. package/src/admin/routes/settings/paypal/apple-pay/page.tsx +9 -5
  197. package/src/admin/routes/settings/paypal/connection/page.tsx +974 -908
  198. package/src/admin/routes/settings/paypal/google-pay/page.tsx +9 -5
  199. package/src/admin/routes/settings/paypal/page.tsx +14 -13
  200. package/src/admin/routes/settings/paypal/pay-later-messaging/page.tsx +9 -5
  201. package/src/admin/routes/settings/paypal/paypal-settings/page.tsx +304 -273
  202. package/src/api/admin/payment-collections/[id]/payment-sessions/route.ts +48 -39
  203. package/src/api/admin/paypal/disconnect/route.ts +15 -14
  204. package/src/api/admin/paypal/environment/route.ts +34 -32
  205. package/src/api/admin/paypal/onboard-complete/route.ts +61 -50
  206. package/src/api/admin/paypal/onboarding-link/route.ts +91 -76
  207. package/src/api/admin/paypal/onboarding-status/route.ts +21 -20
  208. package/src/api/admin/paypal/save-credentials/route.ts +48 -37
  209. package/src/api/admin/paypal/settings/route.ts +63 -45
  210. package/src/api/admin/paypal/status/route.ts +29 -17
  211. package/src/api/hooks/paypal/onboard-return/route.ts +15 -15
  212. package/src/api/hooks/paypal/webhook/route.ts +17 -17
  213. package/src/api/middlewares.ts +61 -61
  214. package/src/api/store/payment-collections/[id]/payment-sessions/route.ts +63 -54
  215. package/src/api/store/paypal/capture-order/route.ts +416 -370
  216. package/src/api/store/paypal/config/route.ts +121 -115
  217. package/src/api/store/paypal/create-order/route.ts +586 -539
  218. package/src/api/store/paypal/onboard-return/route.ts +116 -113
  219. package/src/api/store/paypal/settings/route.ts +29 -19
  220. package/src/api/store/paypal/webhook/route.ts +380 -314
  221. package/src/api/store/paypal-complete/route.ts +157 -128
  222. package/src/api/utils/rate-limit.ts +143 -129
  223. package/src/index.ts +1 -1
  224. package/src/jobs/paypal-webhook-retry.ts +257 -241
  225. package/src/modules/paypal/index.ts +9 -8
  226. package/src/modules/paypal/migrations/20260115120000_create_paypal_connection.ts +33 -33
  227. package/src/modules/paypal/migrations/20260123090000_create_paypal_settings.ts +22 -22
  228. package/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.ts +29 -29
  229. package/src/modules/paypal/migrations/20260401090000_create_paypal_metric.ts +27 -27
  230. package/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.ts +31 -31
  231. package/src/modules/paypal/migrations/20261101090000_remove_paypal_reconciliation_status.ts +25 -25
  232. package/src/modules/paypal/migrations/20261201090000_remove_paypal_audit_log.ts +26 -26
  233. package/src/modules/paypal/migrations/20270101090000_set_paypal_environment_default_live.ts +15 -11
  234. package/src/modules/paypal/migrations/20270102090000_add_paypal_seller_email.ts +15 -11
  235. package/src/modules/paypal/migrations/20270103090000_add_paypal_seller_merchant_id.ts +15 -11
  236. package/src/modules/paypal/migrations/20270201000000_add_webhook_dead_letter.ts +17 -17
  237. package/src/modules/paypal/migrations/20270202000000_align_nullable_defaults.ts +44 -44
  238. package/src/modules/paypal/migrations/20270301000000_add_webhook_transmission_id_index.ts +15 -15
  239. package/src/modules/paypal/models/paypal_connection.ts +28 -23
  240. package/src/modules/paypal/models/paypal_metric.ts +13 -9
  241. package/src/modules/paypal/models/paypal_settings.ts +13 -8
  242. package/src/modules/paypal/models/paypal_webhook_event.ts +26 -19
  243. package/src/modules/paypal/payment-provider/base-provider.ts +287 -275
  244. package/src/modules/paypal/payment-provider/card-service.ts +927 -855
  245. package/src/modules/paypal/payment-provider/index.ts +14 -15
  246. package/src/modules/paypal/payment-provider/service.ts +906 -836
  247. package/src/modules/paypal/payment-provider/status-utils.ts +59 -59
  248. package/src/modules/paypal/payment-provider/webhook-utils.ts +109 -109
  249. package/src/modules/paypal/service.ts +362 -115
  250. package/src/modules/paypal/types/config.ts +70 -65
  251. package/src/modules/paypal/utils/amounts.ts +123 -107
  252. package/src/modules/paypal/utils/core-workflow.ts +46 -46
  253. package/src/modules/paypal/utils/credential-resolver.ts +275 -271
  254. package/src/modules/paypal/utils/currencies.ts +97 -84
  255. package/src/modules/paypal/utils/partner.ts +8 -8
  256. package/src/modules/paypal/utils/payment-session.ts +144 -138
  257. package/src/modules/paypal/utils/paypal-auth.ts +6 -5
  258. package/src/modules/paypal/utils/paypal-fetch.ts +197 -181
  259. package/src/modules/paypal/utils/provider-ids.ts +21 -15
  260. package/src/modules/paypal/utils/secret-crypto.ts +226 -197
  261. package/src/modules/paypal/utils/webhook-verify.ts +61 -61
  262. package/src/modules/paypal/webhook-processor.ts +641 -573
  263. package/src/providers/paypal/index.ts +9 -8
  264. package/src/providers/paypal_card/index.ts +9 -8
  265. package/src/subscribers/paypal-order-invoice.ts +180 -173
  266. package/src/subscribers/paypal-webhook-process.ts +147 -131
  267. package/tsconfig.json +21 -31
@@ -4,24 +4,24 @@ exports.Migration20261201090000 = void 0;
4
4
  const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
5
  class Migration20261201090000 extends migrations_1.Migration {
6
6
  async up() {
7
- this.addSql(`
8
- DROP TABLE IF EXISTS "paypal_audit_log" CASCADE;
7
+ this.addSql(`
8
+ DROP TABLE IF EXISTS "paypal_audit_log" CASCADE;
9
9
  `);
10
10
  }
11
11
  async down() {
12
- this.addSql(`
13
- CREATE TABLE IF NOT EXISTS "paypal_audit_log" (
14
- "id" text NOT NULL,
15
- "event_type" text NOT NULL,
16
- "metadata" jsonb NULL,
17
- "created_at" timestamptz NOT NULL DEFAULT now(),
18
- "updated_at" timestamptz NOT NULL DEFAULT now(),
19
- "deleted_at" timestamptz NULL,
20
- CONSTRAINT "paypal_audit_log_pkey" PRIMARY KEY ("id")
21
- );
22
-
23
- CREATE INDEX IF NOT EXISTS "idx_paypal_audit_log_deleted_at"
24
- ON "paypal_audit_log" ("deleted_at");
12
+ this.addSql(`
13
+ CREATE TABLE IF NOT EXISTS "paypal_audit_log" (
14
+ "id" text NOT NULL,
15
+ "event_type" text NOT NULL,
16
+ "metadata" jsonb NULL,
17
+ "created_at" timestamptz NOT NULL DEFAULT now(),
18
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
19
+ "deleted_at" timestamptz NULL,
20
+ CONSTRAINT "paypal_audit_log_pkey" PRIMARY KEY ("id")
21
+ );
22
+
23
+ CREATE INDEX IF NOT EXISTS "idx_paypal_audit_log_deleted_at"
24
+ ON "paypal_audit_log" ("deleted_at");
25
25
  `);
26
26
  }
27
27
  }
@@ -1 +1 @@
1
- {"version":3,"file":"20270101090000_set_paypal_environment_default_live.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270101090000_set_paypal_environment_default_live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAInB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAGrC"}
1
+ {"version":3,"file":"20270101090000_set_paypal_environment_default_live.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270101090000_set_paypal_environment_default_live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAMnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAKrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"20270101090000_set_paypal_environment_default_live.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270101090000_set_paypal_environment_default_live.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,0FAA0F,CAAC,CAAA;IACzG,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,6FAA6F,CAAC,CAAA;IAC5G,CAAC;CACF;AARD,0DAQC"}
1
+ {"version":3,"file":"20270101090000_set_paypal_environment_default_live.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270101090000_set_paypal_environment_default_live.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,0FAA0F,CAC3F,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CACT,6FAA6F,CAC9F,CAAA;IACH,CAAC;CACF;AAZD,0DAYC"}
@@ -1 +1 @@
1
- {"version":3,"file":"20270102090000_add_paypal_seller_email.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270102090000_add_paypal_seller_email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAInB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAGrC"}
1
+ {"version":3,"file":"20270102090000_add_paypal_seller_email.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270102090000_add_paypal_seller_email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAMnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAKrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"20270102090000_add_paypal_seller_email.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270102090000_add_paypal_seller_email.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,8FAA8F,CAAC,CAAA;IAC7G,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,iFAAiF,CAAC,CAAA;IAChG,CAAC;CACF;AARD,0DAQC"}
1
+ {"version":3,"file":"20270102090000_add_paypal_seller_email.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270102090000_add_paypal_seller_email.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,8FAA8F,CAC/F,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CACT,iFAAiF,CAClF,CAAA;IACH,CAAC;CACF;AAZD,0DAYC"}
@@ -1 +1 @@
1
- {"version":3,"file":"20270103090000_add_paypal_seller_merchant_id.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270103090000_add_paypal_seller_merchant_id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAInB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAGrC"}
1
+ {"version":3,"file":"20270103090000_add_paypal_seller_merchant_id.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270103090000_add_paypal_seller_merchant_id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAMnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAKrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"20270103090000_add_paypal_seller_merchant_id.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270103090000_add_paypal_seller_merchant_id.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,oGAAoG,CAAC,CAAA;IACnH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,uFAAuF,CAAC,CAAA;IACtG,CAAC;CACF;AARD,0DAQC"}
1
+ {"version":3,"file":"20270103090000_add_paypal_seller_merchant_id.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20270103090000_add_paypal_seller_merchant_id.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,oGAAoG,CACrG,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CACT,uFAAuF,CACxF,CAAA;IACH,CAAC;CACF;AAZD,0DAYC"}
@@ -4,15 +4,15 @@ exports.Migration20270201000000 = void 0;
4
4
  const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
5
  class Migration20270201000000 extends migrations_1.Migration {
6
6
  async up() {
7
- this.addSql(`
8
- CREATE INDEX IF NOT EXISTS "idx_paypal_webhook_event_status_retry"
9
- ON "paypal_webhook_event" ("status", "next_retry_at")
10
- WHERE "status" = 'failed';
7
+ this.addSql(`
8
+ CREATE INDEX IF NOT EXISTS "idx_paypal_webhook_event_status_retry"
9
+ ON "paypal_webhook_event" ("status", "next_retry_at")
10
+ WHERE "status" = 'failed';
11
11
  `);
12
12
  }
13
13
  async down() {
14
- this.addSql(`
15
- DROP INDEX IF EXISTS "idx_paypal_webhook_event_status_retry";
14
+ this.addSql(`
15
+ DROP INDEX IF EXISTS "idx_paypal_webhook_event_status_retry";
16
16
  `);
17
17
  }
18
18
  }
@@ -1,3 +1,8 @@
1
+ /**
2
+ * The merchant's PayPal connection. A single row is used; per-environment
3
+ * (sandbox/live) credentials live under `metadata.credentials.<env>` while the
4
+ * `seller_*` columns mirror the currently active environment for querying.
5
+ */
1
6
  declare const PayPalConnection: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
7
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
8
  environment: import("@medusajs/framework/utils").TextProperty;
@@ -1 +1 @@
1
- {"version":3,"file":"paypal_connection.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_connection.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;wBAkBpB,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"paypal_connection.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_connection.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;wBAkBpB,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/framework/utils");
4
+ /**
5
+ * The merchant's PayPal connection. A single row is used; per-environment
6
+ * (sandbox/live) credentials live under `metadata.credentials.<env>` while the
7
+ * `seller_*` columns mirror the currently active environment for querying.
8
+ */
4
9
  const PayPalConnection = utils_1.model.define("paypal_connection", {
5
10
  id: utils_1.model.id().primaryKey(),
6
11
  environment: utils_1.model.text().default("live"),
@@ -1 +1 @@
1
- {"version":3,"file":"paypal_connection.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_connection.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,gBAAgB,GAAG,aAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE;IACzD,EAAE,EAAE,aAAK,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE;IAE3B,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC;IAE5C,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAElC,gBAAgB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACzC,oBAAoB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC7C,kBAAkB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC3C,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAErC,gBAAgB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACzC,2BAA2B,EAAE,aAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAExD,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACnC,CAAC,CAAA;AAEF,kBAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"paypal_connection.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_connection.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,aAAK,CAAC,MAAM,CAAC,mBAAmB,EAAE;IACzD,EAAE,EAAE,aAAK,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE;IAE3B,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC;IAE5C,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAElC,gBAAgB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACzC,oBAAoB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC7C,kBAAkB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC3C,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAErC,gBAAgB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACzC,2BAA2B,EAAE,aAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAExD,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CACnC,CAAC,CAAA;AAEF,kBAAe,gBAAgB,CAAA"}
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Named operational counter (`data.count`, `data.last_recorded_at`, plus any
3
+ * merged metadata). Upserted atomically — see `utils/metrics.ts`.
4
+ */
1
5
  declare const PayPalMetric: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
6
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
7
  name: import("@medusajs/framework/utils").TextProperty;
@@ -1 +1 @@
1
- {"version":3,"file":"paypal_metric.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_metric.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY;;;;oBAIhB,CAAA;AAEF,eAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"paypal_metric.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_metric.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,QAAA,MAAM,YAAY;;;;oBAIhB,CAAA;AAEF,eAAe,YAAY,CAAA"}
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/framework/utils");
4
+ /**
5
+ * Named operational counter (`data.count`, `data.last_recorded_at`, plus any
6
+ * merged metadata). Upserted atomically — see `utils/metrics.ts`.
7
+ */
4
8
  const PayPalMetric = utils_1.model.define("paypal_metric", {
5
9
  id: utils_1.model.id().primaryKey(),
6
10
  name: utils_1.model.text().unique(),
@@ -1 +1 @@
1
- {"version":3,"file":"paypal_metric.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_metric.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,YAAY,GAAG,aAAK,CAAC,MAAM,CAAC,eAAe,EAAE;IACjD,EAAE,EAAE,aAAK,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE;IAC3B,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAC/B,CAAC,CAAA;AAEF,kBAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"paypal_metric.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_metric.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD;;;GAGG;AACH,MAAM,YAAY,GAAG,aAAK,CAAC,MAAM,CAAC,eAAe,EAAE;IACjD,EAAE,EAAE,aAAK,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE;IAC3B,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAC/B,CAAC,CAAA;AAEF,kBAAe,YAAY,CAAA"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Plugin settings singleton. All admin-configurable sections
3
+ * (`paypal_settings`, `advanced_card_payments`, `additional_settings`,
4
+ * `api_details`, `onboarding_config`, …) are stored as keys of `data`.
5
+ */
1
6
  declare const PayPalSettings: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
7
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
8
  data: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
@@ -1 +1 @@
1
- {"version":3,"file":"paypal_settings.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_settings.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,cAAc;;;sBAGlB,CAAA;AAEF,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"paypal_settings.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_settings.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,QAAA,MAAM,cAAc;;;sBAGlB,CAAA;AAEF,eAAe,cAAc,CAAA"}
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/framework/utils");
4
+ /**
5
+ * Plugin settings singleton. All admin-configurable sections
6
+ * (`paypal_settings`, `advanced_card_payments`, `additional_settings`,
7
+ * `api_details`, `onboarding_config`, …) are stored as keys of `data`.
8
+ */
4
9
  const PayPalSettings = utils_1.model.define("paypal_settings", {
5
10
  id: utils_1.model.id().primaryKey(),
6
11
  data: utils_1.model.json().nullable(),
@@ -1 +1 @@
1
- {"version":3,"file":"paypal_settings.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_settings.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,cAAc,GAAG,aAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE;IACrD,EAAE,EAAE,aAAK,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAA;AAEF,kBAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"paypal_settings.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_settings.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD;;;;GAIG;AACH,MAAM,cAAc,GAAG,aAAK,CAAC,MAAM,CAAC,iBAAiB,EAAE;IACrD,EAAE,EAAE,aAAK,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAA;AAEF,kBAAe,cAAc,CAAA"}
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Durable record of every verified webhook delivery. `event_id` and
3
+ * `transmission_id` drive deduplication; `status` / `attempt_count` /
4
+ * `next_retry_at` drive the async subscriber and the retry cron
5
+ * (`pending` → `processing` → `processed` | `failed` | `dead_letter` |
6
+ * `ignored`).
7
+ */
1
8
  declare const PayPalWebhookEvent: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
9
  id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
10
  event_id: import("@medusajs/framework/utils").TextProperty;
@@ -1 +1 @@
1
- {"version":3,"file":"paypal_webhook_event.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_webhook_event.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;2BActB,CAAA;AAEF,eAAe,kBAAkB,CAAA"}
1
+ {"version":3,"file":"paypal_webhook_event.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_webhook_event.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;2BActB,CAAA;AAEF,eAAe,kBAAkB,CAAA"}
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const utils_1 = require("@medusajs/framework/utils");
4
+ /**
5
+ * Durable record of every verified webhook delivery. `event_id` and
6
+ * `transmission_id` drive deduplication; `status` / `attempt_count` /
7
+ * `next_retry_at` drive the async subscriber and the retry cron
8
+ * (`pending` → `processing` → `processed` | `failed` | `dead_letter` |
9
+ * `ignored`).
10
+ */
4
11
  const PayPalWebhookEvent = utils_1.model.define("paypal_webhook_event", {
5
12
  id: utils_1.model.id().primaryKey(),
6
13
  event_id: utils_1.model.text().unique(),
@@ -1 +1 @@
1
- {"version":3,"file":"paypal_webhook_event.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_webhook_event.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,kBAAkB,GAAG,aAAK,CAAC,MAAM,CAAC,sBAAsB,EAAE;IAC9D,EAAE,EAAE,aAAK,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE;IAC3B,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE;IAC/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Aa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC;IAUlB;;;;;;;;;OASG;IACH,SAAS,CAAC,oBAAoB,CAC5B,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,EAC3D,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAgB1B,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM;IAS1C,SAAS,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM;IAShD,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM;IAWlC,mBAAmB,CACvB,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAc/B,aAAa,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAIvE,uBAAuB,CAC3B,OAAO,EAAE,sBAAsB,CAAC,SAAS,CAAC,GACzC,OAAO,CAAC,mBAAmB,CAAC;CAGhC"}
1
+ {"version":3,"file":"base-provider.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/payment-provider/base-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAMlC,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AAMvE,MAAM,MAAM,OAAO,GAAG,EAAE,CAAA;AAExB;;;;;;;;GAQG;AACH,8BAAsB,kBAAmB,SAAQ,uBAAuB,CAAC,OAAO,CAAC;IAC/E,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IACpC,SAAS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;;OASG;cACa,6BAA6B,CAC3C,KAAK,EAAE;QAAE,OAAO,CAAC,EAAE;YAAE,eAAe,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,EACjD,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC;IAUlB;;;;;;;;;OASG;IACH,SAAS,CAAC,oBAAoB,CAC5B,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,EAC3D,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAgB1B,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM;IAS1C,SAAS,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,MAAM;IAUhD,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM;IAYlC,mBAAmB,CACvB,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,yBAAyB,CAAC;IAc/B,aAAa,CACjB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,mBAAmB,CAAC;IAIzB,uBAAuB,CAC3B,OAAO,EAAE,sBAAsB,CAAC,SAAS,CAAC,GACzC,OAAO,CAAC,mBAAmB,CAAC;CAGhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-provider.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/payment-provider/base-provider.ts"],"names":[],"mappings":";;;AAAA,qDAAmE;AACnE,mCAAmC;AASnC,8CAAwE;AACxE,oDAG4B;AAC5B,sEAAuE;AACvE,8CAAgE;AAChE,wDAAmD;AACnD,mDAA+D;AAC/D,iDAAuD;AAIvD;;;;;;;;GAQG;AACH,MAAsB,kBAAmB,SAAQ,+BAAgC;IAC5D,QAAQ,CAAS;IAC1B,MAAM,CAA0B;IAO1C,YAAY,MAA2B,EAAE,OAAgB;QACvD,KAAK,CAAC,MAA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AAa,CAAC,MAA0B;QAC5C,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,uBAAuB,CAC3B,OAA0C;QAE1C,OAAO,IAAA,6CAA6B,EAAC,OAAO,CAAC,CAAA;IAC/C,CAAC;CACF;AAlPD,gDAkPC"}
1
+ {"version":3,"file":"base-provider.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/payment-provider/base-provider.ts"],"names":[],"mappings":";;;AAAA,qDAAmE;AACnE,mCAAmC;AASnC,8CAAwE;AACxE,oDAG4B;AAC5B,sEAAuE;AACvE,8CAAgE;AAChE,wDAAmD;AACnD,mDAA+D;AAC/D,iDAAuD;AAIvD;;;;;;;;GAQG;AACH,MAAsB,kBAAmB,SAAQ,+BAAgC;IAC5D,QAAQ,CAAS;IAC1B,MAAM,CAA0B;IAO1C,YAAY,MAA2B,EAAE,OAAgB;QACvD,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;QACvB,MAAM,EAAE,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAA;QACzD,IAAI,CAAC,MAAM,GAAG,IAAI,8CAAwB,CAAC,EAAE,CAAC,CAAA;IAChD,CAAC;IAES,MAAM,CAAC,mBAAmB,CAAC,MAA2B;QAC9D,KAAK,MAAM,GAAG,IAAI,CAAC,mBAAmB,EAAE,cAAc,EAAE,eAAe,CAAC,EAAE,CAAC;YACzE,IAAI,CAAC;gBACH,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;gBACvB,IAAI,GAAG;oBAAE,OAAO,GAAG,CAAA;YACrB,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACZ,CAAC;QACD,MAAM,IAAI,KAAK,CACb,oEAAoE;YAClE,yFAAyF,CAC5F,CAAA;IACH,CAAC;IAED,yEAAyE;IAC/D,cAAc,CAAC,KAAc;QACrC,IAAI,KA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IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;YAAE,OAAO,OAAO,CAAA;QAC9D,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,mBAAmB,CACvB,KAA+B;QAE/B,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAA;QAC9C,MAAM,UAAU,GAAG,UAAU;YAC3B,CAAC,CAAC,UAAU,UAAU,EAAE;YACxB,CAAC,CAAC,UAAU,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAA;QACxC,OAAO;YACL,EAAE,EAAE,UAAU;YACd,IAAI,EAAE;gBACJ,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,IAAI;gBAC7C,WAAW,EAAE,UAAU,IAAI,IAAI;aAChC;SACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CACjB,MAA0B;QAE1B,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,uBAAuB,CAC3B,OAA0C;QAE1C,OAAO,IAAA,6CAA6B,EAAC,OAAO,CAAC,CAAA;IAC/C,CAAC;CACF;AA9PD,gDA8PC"}
@@ -1,17 +1,25 @@
1
1
  import type { AuthorizePaymentInput, AuthorizePaymentOutput, CapturePaymentInput, CapturePaymentOutput, CancelPaymentInput, CancelPaymentOutput, GetPaymentStatusInput, GetPaymentStatusOutput, InitiatePaymentInput, InitiatePaymentOutput, RefundPaymentInput, RefundPaymentOutput, RetrievePaymentInput, RetrievePaymentOutput, UpdatePaymentInput, UpdatePaymentOutput } from "@medusajs/framework/types";
2
2
  import { PayPalProviderBase } from "./base-provider";
3
+ /**
4
+ * PayPal Advanced (hosted) Card Fields payment provider —
5
+ * `pp_paypal_card_paypal_card`.
6
+ *
7
+ * Shares the order-based flow of the wallet provider but adds admin-configured
8
+ * card-brand restrictions and 3-D Secure handling. Card orders are created
9
+ * with a `payment_source.card` verification method (see create-order).
10
+ */
3
11
  declare class PayPalAdvancedCardProvider extends PayPalProviderBase {
4
12
  static identifier: string;
5
13
  protected readonly sessionPrefix = "pp_card";
6
14
  protected readonly idempotencyPrefix = "pp-card";
7
15
  initiatePayment(input: InitiatePaymentInput): Promise<InitiatePaymentOutput>;
8
16
  updatePayment(input: UpdatePaymentInput): Promise<UpdatePaymentOutput>;
9
- authorizePayment(_input: AuthorizePaymentInput): Promise<AuthorizePaymentOutput>;
10
- capturePayment(_input: CapturePaymentInput): Promise<CapturePaymentOutput>;
11
- cancelPayment(_input: CancelPaymentInput): Promise<CancelPaymentOutput>;
12
- refundPayment(_input: RefundPaymentInput): Promise<RefundPaymentOutput>;
13
- retrievePayment(_input: RetrievePaymentInput): Promise<RetrievePaymentOutput>;
14
- getPaymentStatus(_input: GetPaymentStatusInput): Promise<GetPaymentStatusOutput>;
17
+ authorizePayment(input: AuthorizePaymentInput): Promise<AuthorizePaymentOutput>;
18
+ capturePayment(input: CapturePaymentInput): Promise<CapturePaymentOutput>;
19
+ cancelPayment(input: CancelPaymentInput): Promise<CancelPaymentOutput>;
20
+ refundPayment(input: RefundPaymentInput): Promise<RefundPaymentOutput>;
21
+ retrievePayment(input: RetrievePaymentInput): Promise<RetrievePaymentOutput>;
22
+ getPaymentStatus(input: GetPaymentStatusInput): Promise<GetPaymentStatusOutput>;
15
23
  }
16
24
  export default PayPalAdvancedCardProvider;
17
25
  export { PayPalAdvancedCardProvider };
@@ -1 +1 @@
1
- {"version":3,"file":"card-service.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/payment-provider/card-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAalC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,cAAM,0BAA2B,SAAQ,kBAAkB;IACzD,MAAM,CAAC,UAAU,SAAgB;IAEjC,SAAS,CAAC,QAAQ,CAAC,aAAa,aAAY;IAC5C,SAAS,CAAC,QAAQ,CAAC,iBAAiB,aAAY;IAE1C,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAoB5E,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAwBtE,gBAAgB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAmPhF,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAgN1E,aAAa,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA0IvE,aAAa,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA2HvE,eAAe,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAyB7E,gBAAgB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CA+BvF;AAED,eAAe,0BAA0B,CAAA;AACzC,OAAO,EAAE,0BAA0B,EAAE,CAAA"}
1
+ {"version":3,"file":"card-service.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/payment-provider/card-service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAalC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;;;GAOG;AACH,cAAM,0BAA2B,SAAQ,kBAAkB;IACzD,MAAM,CAAC,UAAU,SAAgB;IAEjC,SAAS,CAAC,QAAQ,CAAC,aAAa,aAAY;IAC5C,SAAS,CAAC,QAAQ,CAAC,iBAAiB,aAAY;IAE1C,eAAe,CACnB,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;IAoB3B,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAyBtE,gBAAgB,CACpB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,sBAAsB,CAAC;IAkQ5B,cAAc,CAClB,KAAK,EAAE,mBAAmB,GACzB,OAAO,CAAC,oBAAoB,CAAC;IAqO1B,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAkJtE,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAmItE,eAAe,CACnB,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,qBAAqB,CAAC;IA0B3B,gBAAgB,CACpB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,sBAAsB,CAAC;CA+BnC;AAED,eAAe,0BAA0B,CAAA;AACzC,OAAO,EAAE,0BAA0B,EAAE,CAAA"}
@@ -8,6 +8,14 @@ const partner_1 = require("../utils/partner");
8
8
  const paypal_fetch_1 = require("../utils/paypal-fetch");
9
9
  const status_utils_1 = require("./status-utils");
10
10
  const base_provider_1 = require("./base-provider");
11
+ /**
12
+ * PayPal Advanced (hosted) Card Fields payment provider —
13
+ * `pp_paypal_card_paypal_card`.
14
+ *
15
+ * Shares the order-based flow of the wallet provider but adds admin-configured
16
+ * card-brand restrictions and 3-D Secure handling. Card orders are created
17
+ * with a `payment_source.card` verification method (see create-order).
18
+ */
11
19
  class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
12
20
  static identifier = "paypal_card";
13
21
  sessionPrefix = "pp_card";
@@ -37,7 +45,8 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
37
45
  });
38
46
  // Preserve the provider_id passthrough exactly like the wallet provider —
39
47
  // dropping it here would make the two providers' session data diverge.
40
- const providerId = input.data?.provider_id;
48
+ const providerId = input.data
49
+ ?.provider_id;
41
50
  return {
42
51
  data: {
43
52
  ...(input.data || {}),
@@ -48,9 +57,9 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
48
57
  },
49
58
  };
50
59
  }
51
- async authorizePayment(_input) {
52
- const { data } = await this.normalizePaymentData(_input);
53
- const requestId = this.getIdempotencyKey(_input, "authorize");
60
+ async authorizePayment(input) {
61
+ const { data } = await this.normalizePaymentData(input);
62
+ const requestId = this.getIdempotencyKey(input, "authorize");
54
63
  const { advancedCardSettings } = await this.resolveSettings();
55
64
  const disabledCards = Array.isArray(advancedCardSettings.disabledCards)
56
65
  ? advancedCardSettings.disabledCards.map((card) => String(card).toLowerCase())
@@ -68,7 +77,7 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
68
77
  return {
69
78
  status: "captured",
70
79
  data: {
71
- ...(_input.data || {}),
80
+ ...(input.data || {}),
72
81
  captured_at: data.captured_at || new Date().toISOString(),
73
82
  },
74
83
  };
@@ -98,7 +107,10 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
98
107
  if (data.captured_at) {
99
108
  return {
100
109
  status: "captured",
101
- data: { ...(_input.data || {}), captured_at: data.captured_at },
110
+ data: {
111
+ ...(input.data || {}),
112
+ captured_at: data.captured_at,
113
+ },
102
114
  };
103
115
  }
104
116
  if (existingPayPal.capture_id ||
@@ -107,7 +119,7 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
107
119
  return {
108
120
  status: "authorized",
109
121
  data: {
110
- ...(_input.data || {}),
122
+ ...(input.data || {}),
111
123
  authorized_at: data.authorized_at || new Date().toISOString(),
112
124
  },
113
125
  };
@@ -259,8 +271,8 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
259
271
  });
260
272
  throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_ALLOWED, `PayPal order ${orderId} has not been approved by the buyer (status ${orderStatus || "UNKNOWN"}). The payment cannot be authorized.`);
261
273
  }
262
- async capturePayment(_input) {
263
- const data = (_input.data || {});
274
+ async capturePayment(input) {
275
+ const data = (input.data || {});
264
276
  const paypalData = (data.paypal || {});
265
277
  const orderId = String(paypalData.order_id || data.order_id || "");
266
278
  let authorizationId = String(paypalData.authorization_id || data.authorization_id || "");
@@ -280,16 +292,16 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
280
292
  },
281
293
  };
282
294
  }
283
- const { amount: sessionAmount, currencyCode } = await this.normalizePaymentData(_input);
295
+ const { amount: sessionAmount, currencyCode } = await this.normalizePaymentData(input);
284
296
  // The requested (possibly partial) capture amount lives on the Medusa
285
297
  // capture row, not in the provider input — resolve it so partial captures
286
298
  // don't charge the full session total.
287
- const amount = await this.resolveRequestedCaptureAmount(_input, sessionAmount);
299
+ const amount = await this.resolveRequestedCaptureAmount(input, sessionAmount);
288
300
  // Include the amount in the idempotency suffix: PayPal deduplicates by
289
301
  // PayPal-Request-Id, so two sequential partial captures of the same order
290
302
  // that share an upstream idempotency_key would otherwise collide and the
291
303
  // second capture would silently return the first one's result.
292
- const requestId = this.getIdempotencyKey(_input, `capture-${orderId}-${amount}`);
304
+ const requestId = this.getIdempotencyKey(input, `capture-${orderId}-${amount}`);
293
305
  let debugId = null;
294
306
  try {
295
307
  const { accessToken, base } = await this.getPayPalAccessToken();
@@ -332,9 +344,7 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
332
344
  data.is_final_capture ??
333
345
  data.final_capture ??
334
346
  undefined;
335
- const captureValue = amount > 0
336
- ? (0, amounts_1.formatAmountForPayPal)(amount, currencyCode || "EUR")
337
- : null;
347
+ const captureValue = amount > 0 ? (0, amounts_1.formatAmountForPayPal)(amount, currencyCode || "EUR") : null;
338
348
  // `amount` and `is_final_capture` are only honored on the authorizations
339
349
  // capture endpoint. The orders capture endpoint always captures the FULL
340
350
  // order and silently ignores an `amount` body — so a partial amount there
@@ -347,9 +357,16 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
347
357
  captureUrl = `${base}/v2/payments/authorizations/${encodeURIComponent(authorizationId)}/capture`;
348
358
  capturePayload = {
349
359
  ...(captureValue
350
- ? { amount: { currency_code: currencyCode || "EUR", value: captureValue } }
360
+ ? {
361
+ amount: {
362
+ currency_code: currencyCode || "EUR",
363
+ value: captureValue,
364
+ },
365
+ }
366
+ : {}),
367
+ ...(typeof isFinalCapture === "boolean"
368
+ ? { is_final_capture: isFinalCapture }
351
369
  : {}),
352
- ...(typeof isFinalCapture === "boolean" ? { is_final_capture: isFinalCapture } : {}),
353
370
  };
354
371
  }
355
372
  else {
@@ -391,7 +408,9 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
391
408
  `The payment was not captured.${debugId ? ` debug_id=${debugId}` : ""}`);
392
409
  }
393
410
  const captureId = capture?.id || capture?.purchase_units?.[0]?.payments?.captures?.[0]?.id;
394
- const existingCaptures = Array.isArray(paypalData.captures) ? paypalData.captures : [];
411
+ const existingCaptures = Array.isArray(paypalData.captures)
412
+ ? paypalData.captures
413
+ : [];
395
414
  const captureEntry = {
396
415
  id: captureId,
397
416
  status: capture?.status,
@@ -436,8 +455,8 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
436
455
  : new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, error?.message || "PayPal capture failed.");
437
456
  }
438
457
  }
439
- async cancelPayment(_input) {
440
- const data = (_input.data || {});
458
+ async cancelPayment(input) {
459
+ const data = (input.data || {});
441
460
  const paypalData = (data.paypal || {});
442
461
  const orderId = String(paypalData.order_id || data.order_id || "");
443
462
  const captureId = String(paypalData.capture_id || data.capture_id || "");
@@ -449,7 +468,7 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
449
468
  storedAuthorizationId;
450
469
  if (intent === "AUTHORIZE" && authorizationId) {
451
470
  const { accessToken, base } = await this.getPayPalAccessToken();
452
- const requestId = this.getIdempotencyKey(_input, `void-${authorizationId}`);
471
+ const requestId = this.getIdempotencyKey(input, `void-${authorizationId}`);
453
472
  const resp = await (0, paypal_fetch_1.paypalFetch)(`${base}/v2/payments/authorizations/${encodeURIComponent(authorizationId)}/void`, {
454
473
  method: "POST",
455
474
  headers: {
@@ -472,7 +491,7 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
472
491
  }
473
492
  else if (captureId) {
474
493
  const { accessToken, base } = await this.getPayPalAccessToken();
475
- const requestId = this.getIdempotencyKey(_input, `cancel-refund-${captureId}`);
494
+ const requestId = this.getIdempotencyKey(input, `cancel-refund-${captureId}`);
476
495
  const resp = await (0, paypal_fetch_1.paypalFetch)(`${base}/v2/payments/captures/${encodeURIComponent(captureId)}/refund`, {
477
496
  method: "POST",
478
497
  headers: {
@@ -497,7 +516,9 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
497
516
  if ((0, status_utils_1.isRefundFailureStatus)(cancelRefundStatus)) {
498
517
  throw new Error(`PayPal cancel-refund did not succeed (status=${cancelRefundStatus}). The payment was not canceled.`);
499
518
  }
500
- const existingRefunds = Array.isArray(paypalData.refunds) ? paypalData.refunds : [];
519
+ const existingRefunds = Array.isArray(paypalData.refunds)
520
+ ? paypalData.refunds
521
+ : [];
501
522
  const refundEntry = {
502
523
  id: refund?.id,
503
524
  status: refund?.status,
@@ -543,8 +564,8 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
543
564
  throw error;
544
565
  }
545
566
  }
546
- async refundPayment(_input) {
547
- const data = (_input.data || {});
567
+ async refundPayment(input) {
568
+ const data = (input.data || {});
548
569
  const paypalData = (data.paypal || {});
549
570
  const captureId = String(paypalData.capture_id || data.capture_id || "");
550
571
  if (!captureId) {
@@ -555,8 +576,8 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
555
576
  // Medusa passes it as a BigNumberInput, so coerce it to a number; a naive
556
577
  // Number() of the object form yields NaN and silently refunds the full
557
578
  // capture.
558
- const amount = (0, amounts_1.toAmountNumber)(_input.amount);
559
- const requestId = this.getIdempotencyKey(_input, `refund-${captureId}-${amount}`);
579
+ const amount = (0, amounts_1.toAmountNumber)(input.amount);
580
+ const requestId = this.getIdempotencyKey(input, `refund-${captureId}-${amount}`);
560
581
  const currencyOverride = await this.resolveCurrencyOverride();
561
582
  const currencyCode = (0, currencies_1.normalizeCurrencyCode)(data.currency_code || currencyOverride || "EUR");
562
583
  try {
@@ -598,7 +619,9 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
598
619
  throw new utils_1.MedusaError(utils_1.MedusaError.Types.UNEXPECTED_STATE, `PayPal refund did not succeed (status=${refundStatus}). The refund was not issued.` +
599
620
  (refundDebugId ? ` debug_id=${refundDebugId}` : ""));
600
621
  }
601
- const existingRefunds = Array.isArray(paypalData.refunds) ? paypalData.refunds : [];
622
+ const existingRefunds = Array.isArray(paypalData.refunds)
623
+ ? paypalData.refunds
624
+ : [];
602
625
  const refundEntry = {
603
626
  id: refund?.id,
604
627
  status: refund?.status,
@@ -640,8 +663,8 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
640
663
  : new utils_1.MedusaError(utils_1.MedusaError.Types.UNEXPECTED_STATE, error?.message || "PayPal refund failed.");
641
664
  }
642
665
  }
643
- async retrievePayment(_input) {
644
- const data = (_input.data || {});
666
+ async retrievePayment(input) {
667
+ const data = (input.data || {});
645
668
  const paypalData = (data.paypal || {});
646
669
  const orderId = String(paypalData.order_id || data.order_id || "");
647
670
  if (!orderId) {
@@ -662,8 +685,8 @@ class PayPalAdvancedCardProvider extends base_provider_1.PayPalProviderBase {
662
685
  },
663
686
  };
664
687
  }
665
- async getPaymentStatus(_input) {
666
- const data = (_input.data || {});
688
+ async getPaymentStatus(input) {
689
+ const data = (input.data || {});
667
690
  const paypalData = (data.paypal || {});
668
691
  const orderId = String(paypalData.order_id || data.order_id || "");
669
692
  if (!orderId) {