@easypayment/medusa-paypal 0.1.0

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 (272) hide show
  1. package/.medusa/server/src/admin/index.js +2127 -0
  2. package/.medusa/server/src/admin/index.mjs +2128 -0
  3. package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.d.ts +3 -0
  4. package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.d.ts.map +1 -0
  5. package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.js +25 -0
  6. package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.js.map +1 -0
  7. package/.medusa/server/src/api/admin/paypal/audit-logs/route.d.ts +3 -0
  8. package/.medusa/server/src/api/admin/paypal/audit-logs/route.d.ts.map +1 -0
  9. package/.medusa/server/src/api/admin/paypal/audit-logs/route.js +12 -0
  10. package/.medusa/server/src/api/admin/paypal/audit-logs/route.js.map +1 -0
  11. package/.medusa/server/src/api/admin/paypal/disconnect/route.d.ts +3 -0
  12. package/.medusa/server/src/api/admin/paypal/disconnect/route.d.ts.map +1 -0
  13. package/.medusa/server/src/api/admin/paypal/disconnect/route.js +9 -0
  14. package/.medusa/server/src/api/admin/paypal/disconnect/route.js.map +1 -0
  15. package/.medusa/server/src/api/admin/paypal/disputes/[id]/route.d.ts +3 -0
  16. package/.medusa/server/src/api/admin/paypal/disputes/[id]/route.d.ts.map +1 -0
  17. package/.medusa/server/src/api/admin/paypal/disputes/[id]/route.js +17 -0
  18. package/.medusa/server/src/api/admin/paypal/disputes/[id]/route.js.map +1 -0
  19. package/.medusa/server/src/api/admin/paypal/disputes/route.d.ts +3 -0
  20. package/.medusa/server/src/api/admin/paypal/disputes/route.d.ts.map +1 -0
  21. package/.medusa/server/src/api/admin/paypal/disputes/route.js +27 -0
  22. package/.medusa/server/src/api/admin/paypal/disputes/route.js.map +1 -0
  23. package/.medusa/server/src/api/admin/paypal/disputes/summary/route.d.ts +3 -0
  24. package/.medusa/server/src/api/admin/paypal/disputes/summary/route.d.ts.map +1 -0
  25. package/.medusa/server/src/api/admin/paypal/disputes/summary/route.js +17 -0
  26. package/.medusa/server/src/api/admin/paypal/disputes/summary/route.js.map +1 -0
  27. package/.medusa/server/src/api/admin/paypal/environment/route.d.ts +4 -0
  28. package/.medusa/server/src/api/admin/paypal/environment/route.d.ts.map +1 -0
  29. package/.medusa/server/src/api/admin/paypal/environment/route.js +23 -0
  30. package/.medusa/server/src/api/admin/paypal/environment/route.js.map +1 -0
  31. package/.medusa/server/src/api/admin/paypal/onboard-complete/route.d.ts +8 -0
  32. package/.medusa/server/src/api/admin/paypal/onboard-complete/route.d.ts.map +1 -0
  33. package/.medusa/server/src/api/admin/paypal/onboard-complete/route.js +41 -0
  34. package/.medusa/server/src/api/admin/paypal/onboard-complete/route.js.map +1 -0
  35. package/.medusa/server/src/api/admin/paypal/onboarding-link/route.d.ts +4 -0
  36. package/.medusa/server/src/api/admin/paypal/onboarding-link/route.d.ts.map +1 -0
  37. package/.medusa/server/src/api/admin/paypal/onboarding-link/route.js +35 -0
  38. package/.medusa/server/src/api/admin/paypal/onboarding-link/route.js.map +1 -0
  39. package/.medusa/server/src/api/admin/paypal/onboarding-status/route.d.ts +3 -0
  40. package/.medusa/server/src/api/admin/paypal/onboarding-status/route.d.ts.map +1 -0
  41. package/.medusa/server/src/api/admin/paypal/onboarding-status/route.js +20 -0
  42. package/.medusa/server/src/api/admin/paypal/onboarding-status/route.js.map +1 -0
  43. package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.d.ts +3 -0
  44. package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.d.ts.map +1 -0
  45. package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.js +8 -0
  46. package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.js.map +1 -0
  47. package/.medusa/server/src/api/admin/paypal/rotate-credentials/route.d.ts +3 -0
  48. package/.medusa/server/src/api/admin/paypal/rotate-credentials/route.d.ts.map +1 -0
  49. package/.medusa/server/src/api/admin/paypal/rotate-credentials/route.js +9 -0
  50. package/.medusa/server/src/api/admin/paypal/rotate-credentials/route.js.map +1 -0
  51. package/.medusa/server/src/api/admin/paypal/save-credentials/route.d.ts +3 -0
  52. package/.medusa/server/src/api/admin/paypal/save-credentials/route.d.ts.map +1 -0
  53. package/.medusa/server/src/api/admin/paypal/save-credentials/route.js +13 -0
  54. package/.medusa/server/src/api/admin/paypal/save-credentials/route.js.map +1 -0
  55. package/.medusa/server/src/api/admin/paypal/settings/route.d.ts +4 -0
  56. package/.medusa/server/src/api/admin/paypal/settings/route.d.ts.map +1 -0
  57. package/.medusa/server/src/api/admin/paypal/settings/route.js +14 -0
  58. package/.medusa/server/src/api/admin/paypal/settings/route.js.map +1 -0
  59. package/.medusa/server/src/api/admin/paypal/status/route.d.ts +3 -0
  60. package/.medusa/server/src/api/admin/paypal/status/route.d.ts.map +1 -0
  61. package/.medusa/server/src/api/admin/paypal/status/route.js +11 -0
  62. package/.medusa/server/src/api/admin/paypal/status/route.js.map +1 -0
  63. package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.d.ts +3 -0
  64. package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.d.ts.map +1 -0
  65. package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.js +43 -0
  66. package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.js.map +1 -0
  67. package/.medusa/server/src/api/store/paypal/capture-order/route.d.ts +3 -0
  68. package/.medusa/server/src/api/store/paypal/capture-order/route.d.ts.map +1 -0
  69. package/.medusa/server/src/api/store/paypal/capture-order/route.js +215 -0
  70. package/.medusa/server/src/api/store/paypal/capture-order/route.js.map +1 -0
  71. package/.medusa/server/src/api/store/paypal/config/route.d.ts +3 -0
  72. package/.medusa/server/src/api/store/paypal/config/route.d.ts.map +1 -0
  73. package/.medusa/server/src/api/store/paypal/config/route.js +45 -0
  74. package/.medusa/server/src/api/store/paypal/config/route.js.map +1 -0
  75. package/.medusa/server/src/api/store/paypal/create-order/route.d.ts +3 -0
  76. package/.medusa/server/src/api/store/paypal/create-order/route.d.ts.map +1 -0
  77. package/.medusa/server/src/api/store/paypal/create-order/route.js +305 -0
  78. package/.medusa/server/src/api/store/paypal/create-order/route.js.map +1 -0
  79. package/.medusa/server/src/api/store/paypal/disputes/route.d.ts +3 -0
  80. package/.medusa/server/src/api/store/paypal/disputes/route.d.ts.map +1 -0
  81. package/.medusa/server/src/api/store/paypal/disputes/route.js +46 -0
  82. package/.medusa/server/src/api/store/paypal/disputes/route.js.map +1 -0
  83. package/.medusa/server/src/api/store/paypal/settings/route.d.ts +3 -0
  84. package/.medusa/server/src/api/store/paypal/settings/route.d.ts.map +1 -0
  85. package/.medusa/server/src/api/store/paypal/settings/route.js +14 -0
  86. package/.medusa/server/src/api/store/paypal/settings/route.js.map +1 -0
  87. package/.medusa/server/src/api/store/paypal/webhook/route.d.ts +3 -0
  88. package/.medusa/server/src/api/store/paypal/webhook/route.d.ts.map +1 -0
  89. package/.medusa/server/src/api/store/paypal/webhook/route.js +203 -0
  90. package/.medusa/server/src/api/store/paypal/webhook/route.js.map +1 -0
  91. package/.medusa/server/src/jobs/paypal-reconcile.d.ts +7 -0
  92. package/.medusa/server/src/jobs/paypal-reconcile.d.ts.map +1 -0
  93. package/.medusa/server/src/jobs/paypal-reconcile.js +131 -0
  94. package/.medusa/server/src/jobs/paypal-reconcile.js.map +1 -0
  95. package/.medusa/server/src/jobs/paypal-webhook-retry.d.ts +7 -0
  96. package/.medusa/server/src/jobs/paypal-webhook-retry.d.ts.map +1 -0
  97. package/.medusa/server/src/jobs/paypal-webhook-retry.js +78 -0
  98. package/.medusa/server/src/jobs/paypal-webhook-retry.js.map +1 -0
  99. package/.medusa/server/src/modules/paypal/clients/paypal-seller.client.d.ts +14 -0
  100. package/.medusa/server/src/modules/paypal/clients/paypal-seller.client.d.ts.map +1 -0
  101. package/.medusa/server/src/modules/paypal/clients/paypal-seller.client.js +65 -0
  102. package/.medusa/server/src/modules/paypal/clients/paypal-seller.client.js.map +1 -0
  103. package/.medusa/server/src/modules/paypal/index.d.ts +92 -0
  104. package/.medusa/server/src/modules/paypal/index.d.ts.map +1 -0
  105. package/.medusa/server/src/modules/paypal/index.js +13 -0
  106. package/.medusa/server/src/modules/paypal/index.js.map +1 -0
  107. package/.medusa/server/src/modules/paypal/migrations/20260115120000_create_paypal_connection.d.ts +6 -0
  108. package/.medusa/server/src/modules/paypal/migrations/20260115120000_create_paypal_connection.d.ts.map +1 -0
  109. package/.medusa/server/src/modules/paypal/migrations/20260115120000_create_paypal_connection.js +36 -0
  110. package/.medusa/server/src/modules/paypal/migrations/20260115120000_create_paypal_connection.js.map +1 -0
  111. package/.medusa/server/src/modules/paypal/migrations/20260123090000_create_paypal_settings.d.ts +6 -0
  112. package/.medusa/server/src/modules/paypal/migrations/20260123090000_create_paypal_settings.d.ts.map +1 -0
  113. package/.medusa/server/src/modules/paypal/migrations/20260123090000_create_paypal_settings.js +25 -0
  114. package/.medusa/server/src/modules/paypal/migrations/20260123090000_create_paypal_settings.js.map +1 -0
  115. package/.medusa/server/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.d.ts +6 -0
  116. package/.medusa/server/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.d.ts.map +1 -0
  117. package/.medusa/server/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.js +32 -0
  118. package/.medusa/server/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.js.map +1 -0
  119. package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.d.ts +6 -0
  120. package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.d.ts.map +1 -0
  121. package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.js +29 -0
  122. package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.js.map +1 -0
  123. package/.medusa/server/src/modules/paypal/migrations/20260401090000_create_paypal_metric.d.ts +6 -0
  124. package/.medusa/server/src/modules/paypal/migrations/20260401090000_create_paypal_metric.d.ts.map +1 -0
  125. package/.medusa/server/src/modules/paypal/migrations/20260401090000_create_paypal_metric.js +30 -0
  126. package/.medusa/server/src/modules/paypal/migrations/20260401090000_create_paypal_metric.js.map +1 -0
  127. package/.medusa/server/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.d.ts +6 -0
  128. package/.medusa/server/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.d.ts.map +1 -0
  129. package/.medusa/server/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.js +43 -0
  130. package/.medusa/server/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.js.map +1 -0
  131. package/.medusa/server/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.d.ts +6 -0
  132. package/.medusa/server/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.d.ts.map +1 -0
  133. package/.medusa/server/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.js +34 -0
  134. package/.medusa/server/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.js.map +1 -0
  135. package/.medusa/server/src/modules/paypal/models/paypal_audit_log.d.ts +7 -0
  136. package/.medusa/server/src/modules/paypal/models/paypal_audit_log.d.ts.map +1 -0
  137. package/.medusa/server/src/modules/paypal/models/paypal_audit_log.js +10 -0
  138. package/.medusa/server/src/modules/paypal/models/paypal_audit_log.js.map +1 -0
  139. package/.medusa/server/src/modules/paypal/models/paypal_connection.d.ts +14 -0
  140. package/.medusa/server/src/modules/paypal/models/paypal_connection.d.ts.map +1 -0
  141. package/.medusa/server/src/modules/paypal/models/paypal_connection.js +17 -0
  142. package/.medusa/server/src/modules/paypal/models/paypal_connection.js.map +1 -0
  143. package/.medusa/server/src/modules/paypal/models/paypal_dispute.d.ts +16 -0
  144. package/.medusa/server/src/modules/paypal/models/paypal_dispute.d.ts.map +1 -0
  145. package/.medusa/server/src/modules/paypal/models/paypal_dispute.js +19 -0
  146. package/.medusa/server/src/modules/paypal/models/paypal_dispute.js.map +1 -0
  147. package/.medusa/server/src/modules/paypal/models/paypal_metric.d.ts +7 -0
  148. package/.medusa/server/src/modules/paypal/models/paypal_metric.d.ts.map +1 -0
  149. package/.medusa/server/src/modules/paypal/models/paypal_metric.js +10 -0
  150. package/.medusa/server/src/modules/paypal/models/paypal_metric.js.map +1 -0
  151. package/.medusa/server/src/modules/paypal/models/paypal_settings.d.ts +6 -0
  152. package/.medusa/server/src/modules/paypal/models/paypal_settings.d.ts.map +1 -0
  153. package/.medusa/server/src/modules/paypal/models/paypal_settings.js +9 -0
  154. package/.medusa/server/src/modules/paypal/models/paypal_settings.js.map +1 -0
  155. package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.d.ts +17 -0
  156. package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.d.ts.map +1 -0
  157. package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.js +20 -0
  158. package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.js.map +1 -0
  159. package/.medusa/server/src/modules/paypal/payment-provider/card-service.d.ts +35 -0
  160. package/.medusa/server/src/modules/paypal/payment-provider/card-service.d.ts.map +1 -0
  161. package/.medusa/server/src/modules/paypal/payment-provider/card-service.js +569 -0
  162. package/.medusa/server/src/modules/paypal/payment-provider/card-service.js.map +1 -0
  163. package/.medusa/server/src/modules/paypal/payment-provider/index.d.ts +10 -0
  164. package/.medusa/server/src/modules/paypal/payment-provider/index.d.ts.map +1 -0
  165. package/.medusa/server/src/modules/paypal/payment-provider/index.js +22 -0
  166. package/.medusa/server/src/modules/paypal/payment-provider/index.js.map +1 -0
  167. package/.medusa/server/src/modules/paypal/payment-provider/service.d.ts +44 -0
  168. package/.medusa/server/src/modules/paypal/payment-provider/service.d.ts.map +1 -0
  169. package/.medusa/server/src/modules/paypal/payment-provider/service.js +825 -0
  170. package/.medusa/server/src/modules/paypal/payment-provider/service.js.map +1 -0
  171. package/.medusa/server/src/modules/paypal/payment-provider/webhook-utils.d.ts +3 -0
  172. package/.medusa/server/src/modules/paypal/payment-provider/webhook-utils.d.ts.map +1 -0
  173. package/.medusa/server/src/modules/paypal/payment-provider/webhook-utils.js +74 -0
  174. package/.medusa/server/src/modules/paypal/payment-provider/webhook-utils.js.map +1 -0
  175. package/.medusa/server/src/modules/paypal/service.d.ts +362 -0
  176. package/.medusa/server/src/modules/paypal/service.d.ts.map +1 -0
  177. package/.medusa/server/src/modules/paypal/service.js +1180 -0
  178. package/.medusa/server/src/modules/paypal/service.js.map +1 -0
  179. package/.medusa/server/src/modules/paypal/types/config.d.ts +14 -0
  180. package/.medusa/server/src/modules/paypal/types/config.d.ts.map +1 -0
  181. package/.medusa/server/src/modules/paypal/types/config.js +33 -0
  182. package/.medusa/server/src/modules/paypal/types/config.js.map +1 -0
  183. package/.medusa/server/src/modules/paypal/utils/amounts.d.ts +3 -0
  184. package/.medusa/server/src/modules/paypal/utils/amounts.d.ts.map +1 -0
  185. package/.medusa/server/src/modules/paypal/utils/amounts.js +40 -0
  186. package/.medusa/server/src/modules/paypal/utils/amounts.js.map +1 -0
  187. package/.medusa/server/src/modules/paypal/utils/crypto.d.ts +4 -0
  188. package/.medusa/server/src/modules/paypal/utils/crypto.d.ts.map +1 -0
  189. package/.medusa/server/src/modules/paypal/utils/crypto.js +47 -0
  190. package/.medusa/server/src/modules/paypal/utils/crypto.js.map +1 -0
  191. package/.medusa/server/src/modules/paypal/utils/currencies.d.ts +19 -0
  192. package/.medusa/server/src/modules/paypal/utils/currencies.d.ts.map +1 -0
  193. package/.medusa/server/src/modules/paypal/utils/currencies.js +69 -0
  194. package/.medusa/server/src/modules/paypal/utils/currencies.js.map +1 -0
  195. package/.medusa/server/src/modules/paypal/utils/provider-ids.d.ts +9 -0
  196. package/.medusa/server/src/modules/paypal/utils/provider-ids.d.ts.map +1 -0
  197. package/.medusa/server/src/modules/paypal/utils/provider-ids.js +50 -0
  198. package/.medusa/server/src/modules/paypal/utils/provider-ids.js.map +1 -0
  199. package/.medusa/server/src/modules/paypal/webhook-processor.d.ts +38 -0
  200. package/.medusa/server/src/modules/paypal/webhook-processor.d.ts.map +1 -0
  201. package/.medusa/server/src/modules/paypal/webhook-processor.js +265 -0
  202. package/.medusa/server/src/modules/paypal/webhook-processor.js.map +1 -0
  203. package/LICENSE +21 -0
  204. package/README.md +67 -0
  205. package/package.json +61 -0
  206. package/postcss.config.cjs +3 -0
  207. package/src/admin/index.ts +7 -0
  208. package/src/admin/routes/settings/paypal/_components/Tabs.tsx +55 -0
  209. package/src/admin/routes/settings/paypal/_components/Toast.tsx +51 -0
  210. package/src/admin/routes/settings/paypal/additional-settings/page.tsx +346 -0
  211. package/src/admin/routes/settings/paypal/advanced-card-payments/page.tsx +381 -0
  212. package/src/admin/routes/settings/paypal/apple-pay/page.tsx +5 -0
  213. package/src/admin/routes/settings/paypal/audit-logs/page.tsx +131 -0
  214. package/src/admin/routes/settings/paypal/connection/page.tsx +750 -0
  215. package/src/admin/routes/settings/paypal/disputes/page.tsx +259 -0
  216. package/src/admin/routes/settings/paypal/google-pay/page.tsx +5 -0
  217. package/src/admin/routes/settings/paypal/page.tsx +16 -0
  218. package/src/admin/routes/settings/paypal/pay-later-messaging/page.tsx +5 -0
  219. package/src/admin/routes/settings/paypal/paypal-settings/page.tsx +557 -0
  220. package/src/admin/routes/settings/paypal/reconciliation-status/page.tsx +165 -0
  221. package/src/api/admin/payment-collections/[id]/payment-sessions/route.ts +32 -0
  222. package/src/api/admin/paypal/audit-logs/route.ts +13 -0
  223. package/src/api/admin/paypal/disconnect/route.ts +8 -0
  224. package/src/api/admin/paypal/disputes/[id]/route.ts +19 -0
  225. package/src/api/admin/paypal/disputes/route.ts +30 -0
  226. package/src/api/admin/paypal/disputes/summary/route.ts +18 -0
  227. package/src/api/admin/paypal/environment/route.ts +25 -0
  228. package/src/api/admin/paypal/onboard-complete/route.ts +44 -0
  229. package/src/api/admin/paypal/onboarding-link/route.ts +45 -0
  230. package/src/api/admin/paypal/onboarding-status/route.ts +18 -0
  231. package/src/api/admin/paypal/reconciliation-status/route.ts +7 -0
  232. package/src/api/admin/paypal/rotate-credentials/route.ts +8 -0
  233. package/src/api/admin/paypal/save-credentials/route.ts +14 -0
  234. package/src/api/admin/paypal/settings/route.ts +14 -0
  235. package/src/api/admin/paypal/status/route.ts +12 -0
  236. package/src/api/store/payment-collections/[id]/payment-sessions/route.ts +51 -0
  237. package/src/api/store/paypal/capture-order/route.ts +270 -0
  238. package/src/api/store/paypal/config/route.ts +59 -0
  239. package/src/api/store/paypal/create-order/route.ts +374 -0
  240. package/src/api/store/paypal/disputes/route.ts +67 -0
  241. package/src/api/store/paypal/settings/route.ts +12 -0
  242. package/src/api/store/paypal/webhook/route.ts +247 -0
  243. package/src/jobs/paypal-reconcile.ts +135 -0
  244. package/src/jobs/paypal-webhook-retry.ts +86 -0
  245. package/src/modules/paypal/clients/paypal-seller.client.ts +59 -0
  246. package/src/modules/paypal/index.ts +8 -0
  247. package/src/modules/paypal/migrations/20260115120000_create_paypal_connection.ts +33 -0
  248. package/src/modules/paypal/migrations/20260123090000_create_paypal_settings.ts +22 -0
  249. package/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.ts +29 -0
  250. package/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.ts +26 -0
  251. package/src/modules/paypal/migrations/20260401090000_create_paypal_metric.ts +27 -0
  252. package/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.ts +40 -0
  253. package/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.ts +31 -0
  254. package/src/modules/paypal/models/paypal_audit_log.ts +9 -0
  255. package/src/modules/paypal/models/paypal_connection.ts +21 -0
  256. package/src/modules/paypal/models/paypal_dispute.ts +18 -0
  257. package/src/modules/paypal/models/paypal_metric.ts +9 -0
  258. package/src/modules/paypal/models/paypal_settings.ts +8 -0
  259. package/src/modules/paypal/models/paypal_webhook_event.ts +19 -0
  260. package/src/modules/paypal/payment-provider/README.md +22 -0
  261. package/src/modules/paypal/payment-provider/card-service.ts +710 -0
  262. package/src/modules/paypal/payment-provider/index.ts +19 -0
  263. package/src/modules/paypal/payment-provider/service.ts +1035 -0
  264. package/src/modules/paypal/payment-provider/webhook-utils.ts +88 -0
  265. package/src/modules/paypal/service.ts +1422 -0
  266. package/src/modules/paypal/types/config.ts +47 -0
  267. package/src/modules/paypal/utils/amounts.ts +41 -0
  268. package/src/modules/paypal/utils/crypto.ts +51 -0
  269. package/src/modules/paypal/utils/currencies.ts +84 -0
  270. package/src/modules/paypal/utils/provider-ids.ts +53 -0
  271. package/src/modules/paypal/webhook-processor.ts +313 -0
  272. package/tsconfig.json +31 -0
@@ -0,0 +1,92 @@
1
+ import PayPalModuleService from "./service";
2
+ export declare const PAYPAL_MODULE = "paypal_onboarding";
3
+ declare const _default: import("@medusajs/types").ModuleExports<typeof PayPalModuleService> & {
4
+ linkable: {
5
+ readonly paypalAuditLog: {
6
+ id: {
7
+ serviceName: "paypal_onboarding";
8
+ field: "paypalAuditLog";
9
+ linkable: "paypal_audit_log_id";
10
+ primaryKey: "id";
11
+ };
12
+ toJSON: () => {
13
+ serviceName: "paypal_onboarding";
14
+ field: "paypalAuditLog";
15
+ linkable: "paypal_audit_log_id";
16
+ primaryKey: "id";
17
+ };
18
+ };
19
+ readonly paypalConnection: {
20
+ id: {
21
+ serviceName: "paypal_onboarding";
22
+ field: "paypalConnection";
23
+ linkable: "paypal_connection_id";
24
+ primaryKey: "id";
25
+ };
26
+ toJSON: () => {
27
+ serviceName: "paypal_onboarding";
28
+ field: "paypalConnection";
29
+ linkable: "paypal_connection_id";
30
+ primaryKey: "id";
31
+ };
32
+ };
33
+ readonly paypalDispute: {
34
+ id: {
35
+ serviceName: "paypal_onboarding";
36
+ field: "paypalDispute";
37
+ linkable: "paypal_dispute_id";
38
+ primaryKey: "id";
39
+ };
40
+ toJSON: () => {
41
+ serviceName: "paypal_onboarding";
42
+ field: "paypalDispute";
43
+ linkable: "paypal_dispute_id";
44
+ primaryKey: "id";
45
+ };
46
+ };
47
+ readonly paypalMetric: {
48
+ id: {
49
+ serviceName: "paypal_onboarding";
50
+ field: "paypalMetric";
51
+ linkable: "paypal_metric_id";
52
+ primaryKey: "id";
53
+ };
54
+ toJSON: () => {
55
+ serviceName: "paypal_onboarding";
56
+ field: "paypalMetric";
57
+ linkable: "paypal_metric_id";
58
+ primaryKey: "id";
59
+ };
60
+ };
61
+ readonly paypalSettings: {
62
+ id: {
63
+ serviceName: "paypal_onboarding";
64
+ field: "paypalSettings";
65
+ linkable: "paypal_settings_id";
66
+ primaryKey: "id";
67
+ };
68
+ toJSON: () => {
69
+ serviceName: "paypal_onboarding";
70
+ field: "paypalSettings";
71
+ linkable: "paypal_settings_id";
72
+ primaryKey: "id";
73
+ };
74
+ };
75
+ readonly paypalWebhookEvent: {
76
+ id: {
77
+ serviceName: "paypal_onboarding";
78
+ field: "paypalWebhookEvent";
79
+ linkable: "paypal_webhook_event_id";
80
+ primaryKey: "id";
81
+ };
82
+ toJSON: () => {
83
+ serviceName: "paypal_onboarding";
84
+ field: "paypalWebhookEvent";
85
+ linkable: "paypal_webhook_event_id";
86
+ primaryKey: "id";
87
+ };
88
+ };
89
+ };
90
+ };
91
+ export default _default;
92
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/modules/paypal/index.ts"],"names":[],"mappings":"AACA,OAAO,mBAAmB,MAAM,WAAW,CAAA;AAE3C,eAAO,MAAM,aAAa,sBAAsB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhD,wBAEE"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PAYPAL_MODULE = void 0;
7
+ const utils_1 = require("@medusajs/framework/utils");
8
+ const service_1 = __importDefault(require("./service"));
9
+ exports.PAYPAL_MODULE = "paypal_onboarding";
10
+ exports.default = (0, utils_1.Module)(exports.PAYPAL_MODULE, {
11
+ service: service_1.default,
12
+ });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/paypal/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAAkD;AAClD,wDAA2C;AAE9B,QAAA,aAAa,GAAG,mBAAmB,CAAA;AAEhD,kBAAe,IAAA,cAAM,EAAC,qBAAa,EAAE;IACnC,OAAO,EAAE,iBAAmB;CAC7B,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20260115120000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20260115120000_create_paypal_connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260115120000_create_paypal_connection.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260115120000_create_paypal_connection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAwBnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20260115120000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20260115120000 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ CREATE TABLE IF NOT EXISTS "paypal_connection" (
9
+ "id" text NOT NULL,
10
+ "environment" text NOT NULL DEFAULT 'sandbox',
11
+ "status" text NOT NULL DEFAULT 'disconnected',
12
+ "shared_id" text NULL,
13
+ "auth_code" text NULL,
14
+ "seller_client_id" text NULL,
15
+ "seller_client_secret" text NULL,
16
+ "app_access_token" text NULL,
17
+ "app_access_token_expires_at" timestamptz NULL,
18
+ "metadata" jsonb NOT NULL DEFAULT '{}'::jsonb,
19
+ "created_at" timestamptz NOT NULL DEFAULT now(),
20
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
21
+ "deleted_at" timestamptz NULL,
22
+ CONSTRAINT "paypal_connection_pkey" PRIMARY KEY ("id")
23
+ );
24
+
25
+ CREATE INDEX IF NOT EXISTS "idx_paypal_connection_deleted_at"
26
+ ON "paypal_connection" ("deleted_at");
27
+ `);
28
+ }
29
+ async down() {
30
+ this.addSql(`
31
+ DROP TABLE IF EXISTS "paypal_connection" CASCADE;
32
+ `);
33
+ }
34
+ }
35
+ exports.Migration20260115120000 = Migration20260115120000;
36
+ //# sourceMappingURL=20260115120000_create_paypal_connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260115120000_create_paypal_connection.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260115120000_create_paypal_connection.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;KAoBX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC;;KAEX,CAAC,CAAA;IACJ,CAAC;CACF;AA9BD,0DA8BC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20260123090000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20260123090000_create_paypal_settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260123090000_create_paypal_settings.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260123090000_create_paypal_settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAenB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20260123090000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20260123090000 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ CREATE TABLE IF NOT EXISTS "paypal_settings" (
9
+ "id" text NOT NULL,
10
+ "data" jsonb NULL,
11
+ "created_at" timestamptz NOT NULL DEFAULT now(),
12
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
13
+ "deleted_at" timestamptz NULL,
14
+ CONSTRAINT "paypal_settings_pkey" PRIMARY KEY ("id")
15
+ );
16
+ CREATE INDEX IF NOT EXISTS "idx_paypal_settings_deleted_at"
17
+ ON "paypal_settings" ("deleted_at");
18
+ `);
19
+ }
20
+ async down() {
21
+ this.addSql(`DROP TABLE IF EXISTS "paypal_settings" CASCADE;`);
22
+ }
23
+ }
24
+ exports.Migration20260123090000 = Migration20260123090000;
25
+ //# sourceMappingURL=20260123090000_create_paypal_settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260123090000_create_paypal_settings.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260123090000_create_paypal_settings.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;KAWX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC,iDAAiD,CAAC,CAAA;IAChE,CAAC;CACF;AAnBD,0DAmBC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20260201090000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20260201090000_create_paypal_webhook_event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260201090000_create_paypal_webhook_event.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAoBnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20260201090000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20260201090000 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ CREATE TABLE IF NOT EXISTS "paypal_webhook_event" (
9
+ "id" text NOT NULL,
10
+ "event_id" text NOT NULL,
11
+ "event_type" text NOT NULL,
12
+ "resource_id" text NULL,
13
+ "payload" jsonb NOT NULL DEFAULT '{}'::jsonb,
14
+ "created_at" timestamptz NOT NULL DEFAULT now(),
15
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
16
+ "deleted_at" timestamptz NULL,
17
+ CONSTRAINT "paypal_webhook_event_pkey" PRIMARY KEY ("id"),
18
+ CONSTRAINT "paypal_webhook_event_event_id_unique" UNIQUE ("event_id")
19
+ );
20
+
21
+ CREATE INDEX IF NOT EXISTS "idx_paypal_webhook_event_deleted_at"
22
+ ON "paypal_webhook_event" ("deleted_at");
23
+ `);
24
+ }
25
+ async down() {
26
+ this.addSql(`
27
+ DROP TABLE IF EXISTS "paypal_webhook_event" CASCADE;
28
+ `);
29
+ }
30
+ }
31
+ exports.Migration20260201090000 = Migration20260201090000;
32
+ //# sourceMappingURL=20260201090000_create_paypal_webhook_event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260201090000_create_paypal_webhook_event.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;KAgBX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC;;KAEX,CAAC,CAAA;IACJ,CAAC;CACF;AA1BD,0DA0BC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20260301090000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20260301090000_create_paypal_audit_log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260301090000_create_paypal_audit_log.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20260301090000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20260301090000 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ CREATE TABLE IF NOT EXISTS "paypal_audit_log" (
9
+ "id" text NOT NULL,
10
+ "event_type" text NOT NULL,
11
+ "metadata" jsonb NOT NULL DEFAULT '{}'::jsonb,
12
+ "created_at" timestamptz NOT NULL DEFAULT now(),
13
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
14
+ "deleted_at" timestamptz NULL,
15
+ CONSTRAINT "paypal_audit_log_pkey" PRIMARY KEY ("id")
16
+ );
17
+
18
+ CREATE INDEX IF NOT EXISTS "idx_paypal_audit_log_deleted_at"
19
+ ON "paypal_audit_log" ("deleted_at");
20
+ `);
21
+ }
22
+ async down() {
23
+ this.addSql(`
24
+ DROP TABLE IF EXISTS "paypal_audit_log" CASCADE;
25
+ `);
26
+ }
27
+ }
28
+ exports.Migration20260301090000 = Migration20260301090000;
29
+ //# sourceMappingURL=20260301090000_create_paypal_audit_log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260301090000_create_paypal_audit_log.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;KAaX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC;;KAEX,CAAC,CAAA;IACJ,CAAC;CACF;AAvBD,0DAuBC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20260401090000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20260401090000_create_paypal_metric.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260401090000_create_paypal_metric.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260401090000_create_paypal_metric.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAkBnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20260401090000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20260401090000 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ CREATE TABLE IF NOT EXISTS "paypal_metric" (
9
+ "id" text NOT NULL,
10
+ "name" text NOT NULL,
11
+ "data" jsonb NOT NULL DEFAULT '{}'::jsonb,
12
+ "created_at" timestamptz NOT NULL DEFAULT now(),
13
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
14
+ "deleted_at" timestamptz NULL,
15
+ CONSTRAINT "paypal_metric_pkey" PRIMARY KEY ("id"),
16
+ CONSTRAINT "paypal_metric_name_unique" UNIQUE ("name")
17
+ );
18
+
19
+ CREATE INDEX IF NOT EXISTS "idx_paypal_metric_deleted_at"
20
+ ON "paypal_metric" ("deleted_at");
21
+ `);
22
+ }
23
+ async down() {
24
+ this.addSql(`
25
+ DROP TABLE IF EXISTS "paypal_metric" CASCADE;
26
+ `);
27
+ }
28
+ }
29
+ exports.Migration20260401090000 = Migration20260401090000;
30
+ //# sourceMappingURL=20260401090000_create_paypal_metric.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260401090000_create_paypal_metric.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260401090000_create_paypal_metric.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;;KAcX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC;;KAEX,CAAC,CAAA;IACJ,CAAC;CACF;AAxBD,0DAwBC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20260501090000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20260501090000_create_paypal_dispute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260501090000_create_paypal_dispute.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260501090000_create_paypal_dispute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20260501090000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20260501090000 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ CREATE TABLE IF NOT EXISTS "paypal_dispute" (
9
+ "id" text NOT NULL,
10
+ "dispute_id" text NOT NULL,
11
+ "status" text NULL,
12
+ "reason" text NULL,
13
+ "stage" text NULL,
14
+ "amount" text NULL,
15
+ "currency_code" text NULL,
16
+ "transaction_id" text NULL,
17
+ "seller_transaction_id" text NULL,
18
+ "order_id" text NULL,
19
+ "cart_id" text NULL,
20
+ "payload" jsonb NOT NULL DEFAULT '{}'::jsonb,
21
+ "created_at" timestamptz NOT NULL DEFAULT now(),
22
+ "updated_at" timestamptz NOT NULL DEFAULT now(),
23
+ "deleted_at" timestamptz NULL,
24
+ CONSTRAINT "paypal_dispute_pkey" PRIMARY KEY ("id"),
25
+ CONSTRAINT "paypal_dispute_dispute_id_unique" UNIQUE ("dispute_id")
26
+ );
27
+
28
+ CREATE INDEX IF NOT EXISTS "idx_paypal_dispute_deleted_at"
29
+ ON "paypal_dispute" ("deleted_at");
30
+ CREATE INDEX IF NOT EXISTS "idx_paypal_dispute_order_id"
31
+ ON "paypal_dispute" ("order_id");
32
+ CREATE INDEX IF NOT EXISTS "idx_paypal_dispute_cart_id"
33
+ ON "paypal_dispute" ("cart_id");
34
+ `);
35
+ }
36
+ async down() {
37
+ this.addSql(`
38
+ DROP TABLE IF EXISTS "paypal_dispute" CASCADE;
39
+ `);
40
+ }
41
+ }
42
+ exports.Migration20260501090000 = Migration20260501090000;
43
+ //# sourceMappingURL=20260501090000_create_paypal_dispute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260501090000_create_paypal_dispute.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260501090000_create_paypal_dispute.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC;;KAEX,CAAC,CAAA;IACJ,CAAC;CACF;AArCD,0DAqCC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20260701090000 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=20260701090000_add_paypal_webhook_event_processing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260701090000_add_paypal_webhook_event_processing.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IAC9C,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAcnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAa5B"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20260701090000 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20260701090000 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`
8
+ ALTER TABLE "paypal_webhook_event"
9
+ ADD COLUMN IF NOT EXISTS "event_version" text NULL,
10
+ ADD COLUMN IF NOT EXISTS "transmission_id" text NULL,
11
+ ADD COLUMN IF NOT EXISTS "transmission_time" timestamptz NULL,
12
+ ADD COLUMN IF NOT EXISTS "status" text NOT NULL DEFAULT 'pending',
13
+ ADD COLUMN IF NOT EXISTS "attempt_count" integer NOT NULL DEFAULT 0,
14
+ ADD COLUMN IF NOT EXISTS "next_retry_at" timestamptz NULL,
15
+ ADD COLUMN IF NOT EXISTS "processed_at" timestamptz NULL,
16
+ ADD COLUMN IF NOT EXISTS "last_error" text NULL;
17
+ `);
18
+ }
19
+ async down() {
20
+ this.addSql(`
21
+ ALTER TABLE "paypal_webhook_event"
22
+ DROP COLUMN IF EXISTS "event_version",
23
+ DROP COLUMN IF EXISTS "transmission_id",
24
+ DROP COLUMN IF EXISTS "transmission_time",
25
+ DROP COLUMN IF EXISTS "status",
26
+ DROP COLUMN IF EXISTS "attempt_count",
27
+ DROP COLUMN IF EXISTS "next_retry_at",
28
+ DROP COLUMN IF EXISTS "processed_at",
29
+ DROP COLUMN IF EXISTS "last_error";
30
+ `);
31
+ }
32
+ }
33
+ exports.Migration20260701090000 = Migration20260701090000;
34
+ //# sourceMappingURL=20260701090000_add_paypal_webhook_event_processing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20260701090000_add_paypal_webhook_event_processing.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IACpD,KAAK,CAAC,EAAE;QACN,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;KAUX,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,MAAM,CAAC;;;;;;;;;;KAUX,CAAC,CAAA;IACJ,CAAC;CACF;AA5BD,0DA4BC"}
@@ -0,0 +1,7 @@
1
+ declare const PayPalAuditLog: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
+ event_type: import("@medusajs/framework/utils").TextProperty;
4
+ metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
5
+ }>, "paypal_audit_log">;
6
+ export default PayPalAuditLog;
7
+ //# sourceMappingURL=paypal_audit_log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paypal_audit_log.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_audit_log.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,cAAc;;;;uBAIlB,CAAA;AAEF,eAAe,cAAc,CAAA"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@medusajs/framework/utils");
4
+ const PayPalAuditLog = utils_1.model.define("paypal_audit_log", {
5
+ id: utils_1.model.id().primaryKey(),
6
+ event_type: utils_1.model.text(),
7
+ metadata: utils_1.model.json().nullable(),
8
+ });
9
+ exports.default = PayPalAuditLog;
10
+ //# sourceMappingURL=paypal_audit_log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paypal_audit_log.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_audit_log.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,cAAc,GAAG,aAAK,CAAC,MAAM,CAAC,kBAAkB,EAAE;IACtD,EAAE,EAAE,aAAK,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE;IAC3B,UAAU,EAAE,aAAK,CAAC,IAAI,EAAE;IACxB,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAA;AAEF,kBAAe,cAAc,CAAA"}
@@ -0,0 +1,14 @@
1
+ declare const PayPalConnection: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
+ environment: import("@medusajs/framework/utils").TextProperty;
4
+ status: import("@medusajs/framework/utils").TextProperty;
5
+ shared_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
6
+ auth_code: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
7
+ seller_client_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
8
+ seller_client_secret: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
9
+ app_access_token: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
10
+ app_access_token_expires_at: import("@medusajs/framework/utils").NullableModifier<Date, import("@medusajs/framework/utils").DateTimeProperty>;
11
+ metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
12
+ }>, "paypal_connection">;
13
+ export default PayPalConnection;
14
+ //# sourceMappingURL=paypal_connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paypal_connection.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_connection.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,gBAAgB;;;;;;;;;;;wBAgBpB,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@medusajs/framework/utils");
4
+ const PayPalConnection = utils_1.model.define("paypal_connection", {
5
+ id: utils_1.model.id().primaryKey(),
6
+ environment: utils_1.model.text(), // sandbox|live
7
+ status: utils_1.model.text(), // disconnected|pending|pending_credentials|connected|revoked
8
+ shared_id: utils_1.model.text().nullable(),
9
+ auth_code: utils_1.model.text().nullable(),
10
+ seller_client_id: utils_1.model.text().nullable(),
11
+ seller_client_secret: utils_1.model.text().nullable(),
12
+ app_access_token: utils_1.model.text().nullable(),
13
+ app_access_token_expires_at: utils_1.model.dateTime().nullable(),
14
+ metadata: utils_1.model.json().nullable(),
15
+ });
16
+ exports.default = PayPalConnection;
17
+ //# sourceMappingURL=paypal_connection.js.map
@@ -0,0 +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,EAAE,eAAe;IAC1C,MAAM,EAAE,aAAK,CAAC,IAAI,EAAE,EAAO,6DAA6D;IAExF,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;IAE7C,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,QAAQ,EAAE;CAClC,CAAC,CAAA;AAEF,kBAAe,gBAAgB,CAAA"}
@@ -0,0 +1,16 @@
1
+ declare const PayPalDispute: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
+ dispute_id: import("@medusajs/framework/utils").TextProperty;
4
+ status: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
5
+ reason: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
6
+ stage: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
7
+ amount: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
8
+ currency_code: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
9
+ transaction_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
10
+ seller_transaction_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
11
+ order_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
12
+ cart_id: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
13
+ payload: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
14
+ }>, "paypal_dispute">;
15
+ export default PayPalDispute;
16
+ //# sourceMappingURL=paypal_dispute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paypal_dispute.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_dispute.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,aAAa;;;;;;;;;;;;;qBAajB,CAAA;AAEF,eAAe,aAAa,CAAA"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@medusajs/framework/utils");
4
+ const PayPalDispute = utils_1.model.define("paypal_dispute", {
5
+ id: utils_1.model.id().primaryKey(),
6
+ dispute_id: utils_1.model.text().unique(),
7
+ status: utils_1.model.text().nullable(),
8
+ reason: utils_1.model.text().nullable(),
9
+ stage: utils_1.model.text().nullable(),
10
+ amount: utils_1.model.text().nullable(),
11
+ currency_code: utils_1.model.text().nullable(),
12
+ transaction_id: utils_1.model.text().nullable(),
13
+ seller_transaction_id: utils_1.model.text().nullable(),
14
+ order_id: utils_1.model.text().nullable(),
15
+ cart_id: utils_1.model.text().nullable(),
16
+ payload: utils_1.model.json().nullable(),
17
+ });
18
+ exports.default = PayPalDispute;
19
+ //# sourceMappingURL=paypal_dispute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paypal_dispute.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/models/paypal_dispute.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,aAAa,GAAG,aAAK,CAAC,MAAM,CAAC,gBAAgB,EAAE;IACnD,EAAE,EAAE,aAAK,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE;IAC3B,UAAU,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE;IACjC,MAAM,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC9B,MAAM,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC/B,aAAa,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACtC,cAAc,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACvC,qBAAqB,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAC9C,QAAQ,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACjC,OAAO,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAA;AAEF,kBAAe,aAAa,CAAA"}
@@ -0,0 +1,7 @@
1
+ declare const PayPalMetric: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
+ name: import("@medusajs/framework/utils").TextProperty;
4
+ data: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
5
+ }>, "paypal_metric">;
6
+ export default PayPalMetric;
7
+ //# sourceMappingURL=paypal_metric.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@medusajs/framework/utils");
4
+ const PayPalMetric = utils_1.model.define("paypal_metric", {
5
+ id: utils_1.model.id().primaryKey(),
6
+ name: utils_1.model.text().unique(),
7
+ data: utils_1.model.json().nullable(),
8
+ });
9
+ exports.default = PayPalMetric;
10
+ //# sourceMappingURL=paypal_metric.js.map
@@ -0,0 +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,QAAQ,EAAE;CAC9B,CAAC,CAAA;AAEF,kBAAe,YAAY,CAAA"}