@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.
- package/.medusa/server/src/admin/index.js +2127 -0
- package/.medusa/server/src/admin/index.mjs +2128 -0
- package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.js +25 -0
- package/.medusa/server/src/api/admin/payment-collections/[id]/payment-sessions/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/audit-logs/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/audit-logs/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/audit-logs/route.js +12 -0
- package/.medusa/server/src/api/admin/paypal/audit-logs/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/disconnect/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/disconnect/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/disconnect/route.js +9 -0
- package/.medusa/server/src/api/admin/paypal/disconnect/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/disputes/[id]/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/disputes/[id]/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/disputes/[id]/route.js +17 -0
- package/.medusa/server/src/api/admin/paypal/disputes/[id]/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/disputes/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/disputes/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/disputes/route.js +27 -0
- package/.medusa/server/src/api/admin/paypal/disputes/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/disputes/summary/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/disputes/summary/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/disputes/summary/route.js +17 -0
- package/.medusa/server/src/api/admin/paypal/disputes/summary/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/environment/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/paypal/environment/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/environment/route.js +23 -0
- package/.medusa/server/src/api/admin/paypal/environment/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/onboard-complete/route.d.ts +8 -0
- package/.medusa/server/src/api/admin/paypal/onboard-complete/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/onboard-complete/route.js +41 -0
- package/.medusa/server/src/api/admin/paypal/onboard-complete/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/onboarding-link/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/paypal/onboarding-link/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/onboarding-link/route.js +35 -0
- package/.medusa/server/src/api/admin/paypal/onboarding-link/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/onboarding-status/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/onboarding-status/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/onboarding-status/route.js +20 -0
- package/.medusa/server/src/api/admin/paypal/onboarding-status/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.js +8 -0
- package/.medusa/server/src/api/admin/paypal/reconciliation-status/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/rotate-credentials/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/rotate-credentials/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/rotate-credentials/route.js +9 -0
- package/.medusa/server/src/api/admin/paypal/rotate-credentials/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/save-credentials/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/save-credentials/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/save-credentials/route.js +13 -0
- package/.medusa/server/src/api/admin/paypal/save-credentials/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/settings/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/paypal/settings/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/settings/route.js +14 -0
- package/.medusa/server/src/api/admin/paypal/settings/route.js.map +1 -0
- package/.medusa/server/src/api/admin/paypal/status/route.d.ts +3 -0
- package/.medusa/server/src/api/admin/paypal/status/route.d.ts.map +1 -0
- package/.medusa/server/src/api/admin/paypal/status/route.js +11 -0
- package/.medusa/server/src/api/admin/paypal/status/route.js.map +1 -0
- package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.d.ts +3 -0
- package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.d.ts.map +1 -0
- package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.js +43 -0
- package/.medusa/server/src/api/store/payment-collections/[id]/payment-sessions/route.js.map +1 -0
- package/.medusa/server/src/api/store/paypal/capture-order/route.d.ts +3 -0
- package/.medusa/server/src/api/store/paypal/capture-order/route.d.ts.map +1 -0
- package/.medusa/server/src/api/store/paypal/capture-order/route.js +215 -0
- package/.medusa/server/src/api/store/paypal/capture-order/route.js.map +1 -0
- package/.medusa/server/src/api/store/paypal/config/route.d.ts +3 -0
- package/.medusa/server/src/api/store/paypal/config/route.d.ts.map +1 -0
- package/.medusa/server/src/api/store/paypal/config/route.js +45 -0
- package/.medusa/server/src/api/store/paypal/config/route.js.map +1 -0
- package/.medusa/server/src/api/store/paypal/create-order/route.d.ts +3 -0
- package/.medusa/server/src/api/store/paypal/create-order/route.d.ts.map +1 -0
- package/.medusa/server/src/api/store/paypal/create-order/route.js +305 -0
- package/.medusa/server/src/api/store/paypal/create-order/route.js.map +1 -0
- package/.medusa/server/src/api/store/paypal/disputes/route.d.ts +3 -0
- package/.medusa/server/src/api/store/paypal/disputes/route.d.ts.map +1 -0
- package/.medusa/server/src/api/store/paypal/disputes/route.js +46 -0
- package/.medusa/server/src/api/store/paypal/disputes/route.js.map +1 -0
- package/.medusa/server/src/api/store/paypal/settings/route.d.ts +3 -0
- package/.medusa/server/src/api/store/paypal/settings/route.d.ts.map +1 -0
- package/.medusa/server/src/api/store/paypal/settings/route.js +14 -0
- package/.medusa/server/src/api/store/paypal/settings/route.js.map +1 -0
- package/.medusa/server/src/api/store/paypal/webhook/route.d.ts +3 -0
- package/.medusa/server/src/api/store/paypal/webhook/route.d.ts.map +1 -0
- package/.medusa/server/src/api/store/paypal/webhook/route.js +203 -0
- package/.medusa/server/src/api/store/paypal/webhook/route.js.map +1 -0
- package/.medusa/server/src/jobs/paypal-reconcile.d.ts +7 -0
- package/.medusa/server/src/jobs/paypal-reconcile.d.ts.map +1 -0
- package/.medusa/server/src/jobs/paypal-reconcile.js +131 -0
- package/.medusa/server/src/jobs/paypal-reconcile.js.map +1 -0
- package/.medusa/server/src/jobs/paypal-webhook-retry.d.ts +7 -0
- package/.medusa/server/src/jobs/paypal-webhook-retry.d.ts.map +1 -0
- package/.medusa/server/src/jobs/paypal-webhook-retry.js +78 -0
- package/.medusa/server/src/jobs/paypal-webhook-retry.js.map +1 -0
- package/.medusa/server/src/modules/paypal/clients/paypal-seller.client.d.ts +14 -0
- package/.medusa/server/src/modules/paypal/clients/paypal-seller.client.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/clients/paypal-seller.client.js +65 -0
- package/.medusa/server/src/modules/paypal/clients/paypal-seller.client.js.map +1 -0
- package/.medusa/server/src/modules/paypal/index.d.ts +92 -0
- package/.medusa/server/src/modules/paypal/index.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/index.js +13 -0
- package/.medusa/server/src/modules/paypal/index.js.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260115120000_create_paypal_connection.d.ts +6 -0
- package/.medusa/server/src/modules/paypal/migrations/20260115120000_create_paypal_connection.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260115120000_create_paypal_connection.js +36 -0
- package/.medusa/server/src/modules/paypal/migrations/20260115120000_create_paypal_connection.js.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260123090000_create_paypal_settings.d.ts +6 -0
- package/.medusa/server/src/modules/paypal/migrations/20260123090000_create_paypal_settings.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260123090000_create_paypal_settings.js +25 -0
- package/.medusa/server/src/modules/paypal/migrations/20260123090000_create_paypal_settings.js.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.d.ts +6 -0
- package/.medusa/server/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.js +32 -0
- package/.medusa/server/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.js.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.d.ts +6 -0
- package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.js +29 -0
- package/.medusa/server/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.js.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260401090000_create_paypal_metric.d.ts +6 -0
- package/.medusa/server/src/modules/paypal/migrations/20260401090000_create_paypal_metric.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260401090000_create_paypal_metric.js +30 -0
- package/.medusa/server/src/modules/paypal/migrations/20260401090000_create_paypal_metric.js.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.d.ts +6 -0
- package/.medusa/server/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.js +43 -0
- package/.medusa/server/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.js.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.d.ts +6 -0
- package/.medusa/server/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.js +34 -0
- package/.medusa/server/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.js.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_audit_log.d.ts +7 -0
- package/.medusa/server/src/modules/paypal/models/paypal_audit_log.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_audit_log.js +10 -0
- package/.medusa/server/src/modules/paypal/models/paypal_audit_log.js.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_connection.d.ts +14 -0
- package/.medusa/server/src/modules/paypal/models/paypal_connection.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_connection.js +17 -0
- package/.medusa/server/src/modules/paypal/models/paypal_connection.js.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_dispute.d.ts +16 -0
- package/.medusa/server/src/modules/paypal/models/paypal_dispute.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_dispute.js +19 -0
- package/.medusa/server/src/modules/paypal/models/paypal_dispute.js.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_metric.d.ts +7 -0
- package/.medusa/server/src/modules/paypal/models/paypal_metric.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_metric.js +10 -0
- package/.medusa/server/src/modules/paypal/models/paypal_metric.js.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_settings.d.ts +6 -0
- package/.medusa/server/src/modules/paypal/models/paypal_settings.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_settings.js +9 -0
- package/.medusa/server/src/modules/paypal/models/paypal_settings.js.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.d.ts +17 -0
- package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.js +20 -0
- package/.medusa/server/src/modules/paypal/models/paypal_webhook_event.js.map +1 -0
- package/.medusa/server/src/modules/paypal/payment-provider/card-service.d.ts +35 -0
- package/.medusa/server/src/modules/paypal/payment-provider/card-service.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/payment-provider/card-service.js +569 -0
- package/.medusa/server/src/modules/paypal/payment-provider/card-service.js.map +1 -0
- package/.medusa/server/src/modules/paypal/payment-provider/index.d.ts +10 -0
- package/.medusa/server/src/modules/paypal/payment-provider/index.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/payment-provider/index.js +22 -0
- package/.medusa/server/src/modules/paypal/payment-provider/index.js.map +1 -0
- package/.medusa/server/src/modules/paypal/payment-provider/service.d.ts +44 -0
- package/.medusa/server/src/modules/paypal/payment-provider/service.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/payment-provider/service.js +825 -0
- package/.medusa/server/src/modules/paypal/payment-provider/service.js.map +1 -0
- package/.medusa/server/src/modules/paypal/payment-provider/webhook-utils.d.ts +3 -0
- package/.medusa/server/src/modules/paypal/payment-provider/webhook-utils.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/payment-provider/webhook-utils.js +74 -0
- package/.medusa/server/src/modules/paypal/payment-provider/webhook-utils.js.map +1 -0
- package/.medusa/server/src/modules/paypal/service.d.ts +362 -0
- package/.medusa/server/src/modules/paypal/service.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/service.js +1180 -0
- package/.medusa/server/src/modules/paypal/service.js.map +1 -0
- package/.medusa/server/src/modules/paypal/types/config.d.ts +14 -0
- package/.medusa/server/src/modules/paypal/types/config.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/types/config.js +33 -0
- package/.medusa/server/src/modules/paypal/types/config.js.map +1 -0
- package/.medusa/server/src/modules/paypal/utils/amounts.d.ts +3 -0
- package/.medusa/server/src/modules/paypal/utils/amounts.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/utils/amounts.js +40 -0
- package/.medusa/server/src/modules/paypal/utils/amounts.js.map +1 -0
- package/.medusa/server/src/modules/paypal/utils/crypto.d.ts +4 -0
- package/.medusa/server/src/modules/paypal/utils/crypto.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/utils/crypto.js +47 -0
- package/.medusa/server/src/modules/paypal/utils/crypto.js.map +1 -0
- package/.medusa/server/src/modules/paypal/utils/currencies.d.ts +19 -0
- package/.medusa/server/src/modules/paypal/utils/currencies.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/utils/currencies.js +69 -0
- package/.medusa/server/src/modules/paypal/utils/currencies.js.map +1 -0
- package/.medusa/server/src/modules/paypal/utils/provider-ids.d.ts +9 -0
- package/.medusa/server/src/modules/paypal/utils/provider-ids.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/utils/provider-ids.js +50 -0
- package/.medusa/server/src/modules/paypal/utils/provider-ids.js.map +1 -0
- package/.medusa/server/src/modules/paypal/webhook-processor.d.ts +38 -0
- package/.medusa/server/src/modules/paypal/webhook-processor.d.ts.map +1 -0
- package/.medusa/server/src/modules/paypal/webhook-processor.js +265 -0
- package/.medusa/server/src/modules/paypal/webhook-processor.js.map +1 -0
- package/LICENSE +21 -0
- package/README.md +67 -0
- package/package.json +61 -0
- package/postcss.config.cjs +3 -0
- package/src/admin/index.ts +7 -0
- package/src/admin/routes/settings/paypal/_components/Tabs.tsx +55 -0
- package/src/admin/routes/settings/paypal/_components/Toast.tsx +51 -0
- package/src/admin/routes/settings/paypal/additional-settings/page.tsx +346 -0
- package/src/admin/routes/settings/paypal/advanced-card-payments/page.tsx +381 -0
- package/src/admin/routes/settings/paypal/apple-pay/page.tsx +5 -0
- package/src/admin/routes/settings/paypal/audit-logs/page.tsx +131 -0
- package/src/admin/routes/settings/paypal/connection/page.tsx +750 -0
- package/src/admin/routes/settings/paypal/disputes/page.tsx +259 -0
- package/src/admin/routes/settings/paypal/google-pay/page.tsx +5 -0
- package/src/admin/routes/settings/paypal/page.tsx +16 -0
- package/src/admin/routes/settings/paypal/pay-later-messaging/page.tsx +5 -0
- package/src/admin/routes/settings/paypal/paypal-settings/page.tsx +557 -0
- package/src/admin/routes/settings/paypal/reconciliation-status/page.tsx +165 -0
- package/src/api/admin/payment-collections/[id]/payment-sessions/route.ts +32 -0
- package/src/api/admin/paypal/audit-logs/route.ts +13 -0
- package/src/api/admin/paypal/disconnect/route.ts +8 -0
- package/src/api/admin/paypal/disputes/[id]/route.ts +19 -0
- package/src/api/admin/paypal/disputes/route.ts +30 -0
- package/src/api/admin/paypal/disputes/summary/route.ts +18 -0
- package/src/api/admin/paypal/environment/route.ts +25 -0
- package/src/api/admin/paypal/onboard-complete/route.ts +44 -0
- package/src/api/admin/paypal/onboarding-link/route.ts +45 -0
- package/src/api/admin/paypal/onboarding-status/route.ts +18 -0
- package/src/api/admin/paypal/reconciliation-status/route.ts +7 -0
- package/src/api/admin/paypal/rotate-credentials/route.ts +8 -0
- package/src/api/admin/paypal/save-credentials/route.ts +14 -0
- package/src/api/admin/paypal/settings/route.ts +14 -0
- package/src/api/admin/paypal/status/route.ts +12 -0
- package/src/api/store/payment-collections/[id]/payment-sessions/route.ts +51 -0
- package/src/api/store/paypal/capture-order/route.ts +270 -0
- package/src/api/store/paypal/config/route.ts +59 -0
- package/src/api/store/paypal/create-order/route.ts +374 -0
- package/src/api/store/paypal/disputes/route.ts +67 -0
- package/src/api/store/paypal/settings/route.ts +12 -0
- package/src/api/store/paypal/webhook/route.ts +247 -0
- package/src/jobs/paypal-reconcile.ts +135 -0
- package/src/jobs/paypal-webhook-retry.ts +86 -0
- package/src/modules/paypal/clients/paypal-seller.client.ts +59 -0
- package/src/modules/paypal/index.ts +8 -0
- package/src/modules/paypal/migrations/20260115120000_create_paypal_connection.ts +33 -0
- package/src/modules/paypal/migrations/20260123090000_create_paypal_settings.ts +22 -0
- package/src/modules/paypal/migrations/20260201090000_create_paypal_webhook_event.ts +29 -0
- package/src/modules/paypal/migrations/20260301090000_create_paypal_audit_log.ts +26 -0
- package/src/modules/paypal/migrations/20260401090000_create_paypal_metric.ts +27 -0
- package/src/modules/paypal/migrations/20260501090000_create_paypal_dispute.ts +40 -0
- package/src/modules/paypal/migrations/20260701090000_add_paypal_webhook_event_processing.ts +31 -0
- package/src/modules/paypal/models/paypal_audit_log.ts +9 -0
- package/src/modules/paypal/models/paypal_connection.ts +21 -0
- package/src/modules/paypal/models/paypal_dispute.ts +18 -0
- package/src/modules/paypal/models/paypal_metric.ts +9 -0
- package/src/modules/paypal/models/paypal_settings.ts +8 -0
- package/src/modules/paypal/models/paypal_webhook_event.ts +19 -0
- package/src/modules/paypal/payment-provider/README.md +22 -0
- package/src/modules/paypal/payment-provider/card-service.ts +710 -0
- package/src/modules/paypal/payment-provider/index.ts +19 -0
- package/src/modules/paypal/payment-provider/service.ts +1035 -0
- package/src/modules/paypal/payment-provider/webhook-utils.ts +88 -0
- package/src/modules/paypal/service.ts +1422 -0
- package/src/modules/paypal/types/config.ts +47 -0
- package/src/modules/paypal/utils/amounts.ts +41 -0
- package/src/modules/paypal/utils/crypto.ts +51 -0
- package/src/modules/paypal/utils/currencies.ts +84 -0
- package/src/modules/paypal/utils/provider-ids.ts +53 -0
- package/src/modules/paypal/webhook-processor.ts +313 -0
- package/tsconfig.json +31 -0
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PayPalAdvancedCardProvider = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const webhook_utils_1 = require("./webhook-utils");
|
|
7
|
+
const amounts_1 = require("../utils/amounts");
|
|
8
|
+
const currencies_1 = require("../utils/currencies");
|
|
9
|
+
function generateSessionId() {
|
|
10
|
+
try {
|
|
11
|
+
return (0, crypto_1.randomUUID)();
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return `pp_card_${Date.now()}_${Math.random().toString(16).slice(2)}`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class PayPalAdvancedCardProvider extends utils_1.AbstractPaymentProvider {
|
|
18
|
+
static identifier = "paypal_card";
|
|
19
|
+
options_;
|
|
20
|
+
constructor(cradle, options) {
|
|
21
|
+
super(cradle, options);
|
|
22
|
+
this.options_ = options;
|
|
23
|
+
}
|
|
24
|
+
resolvePayPalService() {
|
|
25
|
+
const container = this.container;
|
|
26
|
+
return container.resolve("paypal_onboarding");
|
|
27
|
+
}
|
|
28
|
+
async resolveSettings() {
|
|
29
|
+
const paypal = this.resolvePayPalService();
|
|
30
|
+
const settings = await paypal.getSettings().catch(() => ({}));
|
|
31
|
+
const data = settings && typeof settings === "object" && "data" in settings
|
|
32
|
+
? (settings.data ?? {})
|
|
33
|
+
: {};
|
|
34
|
+
return {
|
|
35
|
+
additionalSettings: (data.additional_settings || {}),
|
|
36
|
+
advancedCardSettings: (data.advanced_card_payments || {}),
|
|
37
|
+
apiDetails: (data.api_details || {}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async resolveCurrencyOverride() {
|
|
41
|
+
const { apiDetails } = await this.resolveSettings();
|
|
42
|
+
if (typeof apiDetails.currency_code === "string" && apiDetails.currency_code.trim()) {
|
|
43
|
+
return (0, currencies_1.normalizeCurrencyCode)(apiDetails.currency_code);
|
|
44
|
+
}
|
|
45
|
+
return (0, currencies_1.normalizeCurrencyCode)(process.env.PAYPAL_CURRENCY || "USD");
|
|
46
|
+
}
|
|
47
|
+
async getPayPalAccessToken() {
|
|
48
|
+
const paypal = this.resolvePayPalService();
|
|
49
|
+
const creds = await paypal.getActiveCredentials();
|
|
50
|
+
const base = creds.environment === "live"
|
|
51
|
+
? "https://api-m.paypal.com"
|
|
52
|
+
: "https://api-m.sandbox.paypal.com";
|
|
53
|
+
const auth = Buffer.from(`${creds.client_id}:${creds.client_secret}`).toString("base64");
|
|
54
|
+
const resp = await fetch(`${base}/v1/oauth2/token`, {
|
|
55
|
+
method: "POST",
|
|
56
|
+
headers: {
|
|
57
|
+
Authorization: `Basic ${auth}`,
|
|
58
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
59
|
+
},
|
|
60
|
+
body: "grant_type=client_credentials",
|
|
61
|
+
});
|
|
62
|
+
const text = await resp.text();
|
|
63
|
+
if (!resp.ok) {
|
|
64
|
+
throw new Error(`PayPal token error (${resp.status}): ${text}`);
|
|
65
|
+
}
|
|
66
|
+
const json = JSON.parse(text);
|
|
67
|
+
return { accessToken: String(json.access_token), base };
|
|
68
|
+
}
|
|
69
|
+
async getOrderDetails(orderId) {
|
|
70
|
+
const { accessToken, base } = await this.getPayPalAccessToken();
|
|
71
|
+
const resp = await fetch(`${base}/v2/checkout/orders/${orderId}`, {
|
|
72
|
+
method: "GET",
|
|
73
|
+
headers: {
|
|
74
|
+
Authorization: `Bearer ${accessToken}`,
|
|
75
|
+
"Content-Type": "application/json",
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
const text = await resp.text();
|
|
79
|
+
if (!resp.ok) {
|
|
80
|
+
throw new Error(`PayPal get order error (${resp.status}): ${text}`);
|
|
81
|
+
}
|
|
82
|
+
return JSON.parse(text);
|
|
83
|
+
}
|
|
84
|
+
getIdempotencyKey(input, suffix) {
|
|
85
|
+
const key = input?.context?.idempotency_key?.trim();
|
|
86
|
+
if (key) {
|
|
87
|
+
return `${key}-${suffix}`;
|
|
88
|
+
}
|
|
89
|
+
return `pp-card-${suffix}-${generateSessionId()}`;
|
|
90
|
+
}
|
|
91
|
+
async normalizePaymentData(input) {
|
|
92
|
+
const data = (input.data || {});
|
|
93
|
+
const amount = Number(data.amount ?? 0);
|
|
94
|
+
const currencyOverride = await this.resolveCurrencyOverride();
|
|
95
|
+
const currencyCode = (0, currencies_1.normalizeCurrencyCode)(data.currency_code || currencyOverride || "USD");
|
|
96
|
+
(0, currencies_1.assertPayPalCurrencySupported)({
|
|
97
|
+
currencyCode,
|
|
98
|
+
paypalCurrencyOverride: currencyOverride,
|
|
99
|
+
});
|
|
100
|
+
return { data, amount, currencyCode };
|
|
101
|
+
}
|
|
102
|
+
mapCaptureStatus(status) {
|
|
103
|
+
const normalized = String(status || "").toUpperCase();
|
|
104
|
+
if (!normalized) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
if (normalized === "COMPLETED") {
|
|
108
|
+
return "captured";
|
|
109
|
+
}
|
|
110
|
+
if (normalized === "PENDING") {
|
|
111
|
+
return "pending";
|
|
112
|
+
}
|
|
113
|
+
if (["DENIED", "DECLINED", "FAILED"].includes(normalized)) {
|
|
114
|
+
return "error";
|
|
115
|
+
}
|
|
116
|
+
if (["REFUNDED", "PARTIALLY_REFUNDED", "REVERSED"].includes(normalized)) {
|
|
117
|
+
return "canceled";
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
mapAuthorizationStatus(status) {
|
|
122
|
+
const normalized = String(status || "").toUpperCase();
|
|
123
|
+
if (!normalized) {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
if (["CREATED", "APPROVED", "PENDING"].includes(normalized)) {
|
|
127
|
+
return "authorized";
|
|
128
|
+
}
|
|
129
|
+
if (["VOIDED", "EXPIRED"].includes(normalized)) {
|
|
130
|
+
return "canceled";
|
|
131
|
+
}
|
|
132
|
+
if (["DENIED", "DECLINED", "FAILED"].includes(normalized)) {
|
|
133
|
+
return "error";
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
mapOrderStatus(status) {
|
|
138
|
+
const normalized = String(status || "").toUpperCase();
|
|
139
|
+
if (!normalized) {
|
|
140
|
+
return "pending";
|
|
141
|
+
}
|
|
142
|
+
if (normalized === "COMPLETED") {
|
|
143
|
+
return "captured";
|
|
144
|
+
}
|
|
145
|
+
if (normalized === "APPROVED") {
|
|
146
|
+
return "authorized";
|
|
147
|
+
}
|
|
148
|
+
if (["VOIDED", "CANCELLED"].includes(normalized)) {
|
|
149
|
+
return "canceled";
|
|
150
|
+
}
|
|
151
|
+
if (["CREATED", "SAVED", "PAYER_ACTION_REQUIRED"].includes(normalized)) {
|
|
152
|
+
return "pending";
|
|
153
|
+
}
|
|
154
|
+
if (["FAILED", "EXPIRED"].includes(normalized)) {
|
|
155
|
+
return "error";
|
|
156
|
+
}
|
|
157
|
+
return "pending";
|
|
158
|
+
}
|
|
159
|
+
async createAccountHolder(input) {
|
|
160
|
+
const customerId = input.context?.customer?.id;
|
|
161
|
+
const externalId = customerId ? `paypal_${customerId}` : `paypal_${generateSessionId()}`;
|
|
162
|
+
return {
|
|
163
|
+
id: externalId,
|
|
164
|
+
data: {
|
|
165
|
+
email: input.context?.customer?.email || null,
|
|
166
|
+
customer_id: customerId || null,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
async initiatePayment(input) {
|
|
171
|
+
const currencyOverride = await this.resolveCurrencyOverride();
|
|
172
|
+
const currencyCode = (0, currencies_1.normalizeCurrencyCode)(input.currency_code || currencyOverride || "USD");
|
|
173
|
+
(0, currencies_1.assertPayPalCurrencySupported)({
|
|
174
|
+
currencyCode,
|
|
175
|
+
paypalCurrencyOverride: currencyOverride,
|
|
176
|
+
});
|
|
177
|
+
return {
|
|
178
|
+
id: generateSessionId(),
|
|
179
|
+
data: {
|
|
180
|
+
...(input.data || {}),
|
|
181
|
+
// store amount/currency so Medusa has something consistent
|
|
182
|
+
amount: input.amount,
|
|
183
|
+
currency_code: currencyCode,
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
async updatePayment(input) {
|
|
188
|
+
const currencyOverride = await this.resolveCurrencyOverride();
|
|
189
|
+
const currencyCode = (0, currencies_1.normalizeCurrencyCode)(input.currency_code || currencyOverride || "USD");
|
|
190
|
+
(0, currencies_1.assertPayPalCurrencySupported)({
|
|
191
|
+
currencyCode,
|
|
192
|
+
paypalCurrencyOverride: currencyOverride,
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
data: {
|
|
196
|
+
...(input.data || {}),
|
|
197
|
+
amount: input.amount,
|
|
198
|
+
currency_code: currencyCode,
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
async authorizePayment(_input) {
|
|
203
|
+
const { data, amount, currencyCode } = await this.normalizePaymentData(_input);
|
|
204
|
+
const requestId = this.getIdempotencyKey(_input, "authorize");
|
|
205
|
+
let debugId = null;
|
|
206
|
+
const { additionalSettings, advancedCardSettings } = await this.resolveSettings();
|
|
207
|
+
const paymentActionRaw = typeof additionalSettings.paymentAction === "string"
|
|
208
|
+
? additionalSettings.paymentAction
|
|
209
|
+
: "capture";
|
|
210
|
+
const orderIntent = paymentActionRaw === "authorize" ? "AUTHORIZE" : "CAPTURE";
|
|
211
|
+
const threeDsRaw = typeof advancedCardSettings.threeDS === "string"
|
|
212
|
+
? advancedCardSettings.threeDS
|
|
213
|
+
: "when_required";
|
|
214
|
+
const threeDsMethod = threeDsRaw === "always"
|
|
215
|
+
? "SCA_ALWAYS"
|
|
216
|
+
: threeDsRaw === "when_required" || threeDsRaw === "sli"
|
|
217
|
+
? "SCA_WHEN_REQUIRED"
|
|
218
|
+
: null;
|
|
219
|
+
const disabledCards = Array.isArray(advancedCardSettings.disabledCards)
|
|
220
|
+
? advancedCardSettings.disabledCards.map((card) => String(card).toLowerCase())
|
|
221
|
+
: [];
|
|
222
|
+
const cardBrand = String(data.card_brand || data.cardBrand || data?.paypal?.card_brand || "").toLowerCase();
|
|
223
|
+
if (cardBrand && disabledCards.includes(cardBrand)) {
|
|
224
|
+
throw new Error(`Card brand ${cardBrand} is disabled by admin settings.`);
|
|
225
|
+
}
|
|
226
|
+
const { accessToken, base } = await this.getPayPalAccessToken();
|
|
227
|
+
const existingPayPal = (data.paypal || {});
|
|
228
|
+
let orderId = String(existingPayPal.order_id || data.order_id || "");
|
|
229
|
+
let order = null;
|
|
230
|
+
let authorization = null;
|
|
231
|
+
if (!orderId) {
|
|
232
|
+
const value = (0, amounts_1.formatAmountForPayPal)(amount, currencyCode || "USD");
|
|
233
|
+
const orderPayload = {
|
|
234
|
+
intent: orderIntent,
|
|
235
|
+
purchase_units: [
|
|
236
|
+
{
|
|
237
|
+
reference_id: data.cart_id || data.payment_collection_id || undefined,
|
|
238
|
+
custom_id: data.session_id || data.cart_id || data.payment_collection_id || undefined,
|
|
239
|
+
amount: {
|
|
240
|
+
currency_code: currencyCode || "USD",
|
|
241
|
+
value,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
custom_id: data.session_id || data.cart_id || data.payment_collection_id || undefined,
|
|
246
|
+
...(threeDsMethod
|
|
247
|
+
? {
|
|
248
|
+
payment_source: {
|
|
249
|
+
card: {
|
|
250
|
+
attributes: {
|
|
251
|
+
verification: {
|
|
252
|
+
method: threeDsMethod,
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
}
|
|
258
|
+
: {}),
|
|
259
|
+
};
|
|
260
|
+
const ppResp = await fetch(`${base}/v2/checkout/orders`, {
|
|
261
|
+
method: "POST",
|
|
262
|
+
headers: {
|
|
263
|
+
Authorization: `Bearer ${accessToken}`,
|
|
264
|
+
"Content-Type": "application/json",
|
|
265
|
+
"PayPal-Request-Id": requestId,
|
|
266
|
+
},
|
|
267
|
+
body: JSON.stringify(orderPayload),
|
|
268
|
+
});
|
|
269
|
+
const ppText = await ppResp.text();
|
|
270
|
+
debugId = ppResp.headers.get("paypal-debug-id");
|
|
271
|
+
if (!ppResp.ok) {
|
|
272
|
+
throw new Error(`PayPal create order error (${ppResp.status}): ${ppText}${debugId ? ` debug_id=${debugId}` : ""}`);
|
|
273
|
+
}
|
|
274
|
+
order = JSON.parse(ppText);
|
|
275
|
+
orderId = String(order.id || "");
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
order = (await this.getOrderDetails(orderId));
|
|
279
|
+
}
|
|
280
|
+
if (!order || !orderId) {
|
|
281
|
+
throw new Error("Unable to resolve PayPal order details for authorization.");
|
|
282
|
+
}
|
|
283
|
+
const existingAuthorization = order?.purchase_units?.[0]?.payments?.authorizations?.[0] || null;
|
|
284
|
+
if (existingAuthorization) {
|
|
285
|
+
authorization = order;
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
const authorizeResp = await fetch(`${base}/v2/checkout/orders/${orderId}/authorize`, {
|
|
289
|
+
method: "POST",
|
|
290
|
+
headers: {
|
|
291
|
+
Authorization: `Bearer ${accessToken}`,
|
|
292
|
+
"Content-Type": "application/json",
|
|
293
|
+
"PayPal-Request-Id": `${requestId}-auth`,
|
|
294
|
+
},
|
|
295
|
+
});
|
|
296
|
+
const authorizeText = await authorizeResp.text();
|
|
297
|
+
const authorizeDebugId = authorizeResp.headers.get("paypal-debug-id");
|
|
298
|
+
if (!authorizeResp.ok) {
|
|
299
|
+
throw new Error(`PayPal authorize order error (${authorizeResp.status}): ${authorizeText}${authorizeDebugId ? ` debug_id=${authorizeDebugId}` : ""}`);
|
|
300
|
+
}
|
|
301
|
+
authorization = JSON.parse(authorizeText);
|
|
302
|
+
}
|
|
303
|
+
const authorizationId = authorization?.purchase_units?.[0]?.payments?.authorizations?.[0]?.id ||
|
|
304
|
+
existingAuthorization?.id;
|
|
305
|
+
return {
|
|
306
|
+
status: "authorized",
|
|
307
|
+
data: {
|
|
308
|
+
...(data || {}),
|
|
309
|
+
paypal: {
|
|
310
|
+
...existingPayPal,
|
|
311
|
+
order_id: orderId,
|
|
312
|
+
order: order || authorization,
|
|
313
|
+
authorization_id: authorizationId,
|
|
314
|
+
authorizations: authorization?.purchase_units?.[0]?.payments?.authorizations || [],
|
|
315
|
+
},
|
|
316
|
+
authorized_at: new Date().toISOString(),
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
async capturePayment(_input) {
|
|
321
|
+
const data = (_input.data || {});
|
|
322
|
+
const paypalData = (data.paypal || {});
|
|
323
|
+
const orderId = String(paypalData.order_id || data.order_id || "");
|
|
324
|
+
let authorizationId = String(paypalData.authorization_id || data.authorization_id || "");
|
|
325
|
+
if (!orderId) {
|
|
326
|
+
throw new Error("PayPal order_id is required to capture payment");
|
|
327
|
+
}
|
|
328
|
+
if (paypalData.capture_id || paypalData.capture) {
|
|
329
|
+
return {
|
|
330
|
+
data: {
|
|
331
|
+
...(data || {}),
|
|
332
|
+
paypal: {
|
|
333
|
+
...paypalData,
|
|
334
|
+
capture_id: paypalData.capture_id,
|
|
335
|
+
capture: paypalData.capture,
|
|
336
|
+
},
|
|
337
|
+
captured_at: new Date().toISOString(),
|
|
338
|
+
},
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
const requestId = this.getIdempotencyKey(_input, `capture-${orderId}`);
|
|
342
|
+
const { amount, currencyCode } = await this.normalizePaymentData(_input);
|
|
343
|
+
let debugId = null;
|
|
344
|
+
const { accessToken, base } = await this.getPayPalAccessToken();
|
|
345
|
+
const order = await this.getOrderDetails(orderId).catch(() => null);
|
|
346
|
+
const existingCapture = order?.purchase_units?.[0]?.payments?.captures?.[0];
|
|
347
|
+
if (existingCapture?.id) {
|
|
348
|
+
return {
|
|
349
|
+
data: {
|
|
350
|
+
...(data || {}),
|
|
351
|
+
paypal: {
|
|
352
|
+
...paypalData,
|
|
353
|
+
capture_id: existingCapture.id,
|
|
354
|
+
capture: existingCapture,
|
|
355
|
+
},
|
|
356
|
+
captured_at: new Date().toISOString(),
|
|
357
|
+
},
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
const resolvedIntent = String(order?.intent || paypalData.order?.intent || data.intent || "").toUpperCase();
|
|
361
|
+
if (!authorizationId && resolvedIntent === "AUTHORIZE") {
|
|
362
|
+
const authorizeResp = await fetch(`${base}/v2/checkout/orders/${orderId}/authorize`, {
|
|
363
|
+
method: "POST",
|
|
364
|
+
headers: {
|
|
365
|
+
Authorization: `Bearer ${accessToken}`,
|
|
366
|
+
"Content-Type": "application/json",
|
|
367
|
+
"PayPal-Request-Id": `${requestId}-auth`,
|
|
368
|
+
},
|
|
369
|
+
});
|
|
370
|
+
const authorizeText = await authorizeResp.text();
|
|
371
|
+
debugId = authorizeResp.headers.get("paypal-debug-id");
|
|
372
|
+
if (!authorizeResp.ok) {
|
|
373
|
+
throw new Error(`PayPal authorize order error (${authorizeResp.status}): ${authorizeText}${debugId ? ` debug_id=${debugId}` : ""}`);
|
|
374
|
+
}
|
|
375
|
+
const authorization = JSON.parse(authorizeText);
|
|
376
|
+
authorizationId =
|
|
377
|
+
authorization?.purchase_units?.[0]?.payments?.authorizations?.[0]?.id;
|
|
378
|
+
}
|
|
379
|
+
const isFinalCapture = paypalData.is_final_capture ??
|
|
380
|
+
data.is_final_capture ??
|
|
381
|
+
data.final_capture ??
|
|
382
|
+
undefined;
|
|
383
|
+
const capturePayload = amount > 0
|
|
384
|
+
? {
|
|
385
|
+
amount: {
|
|
386
|
+
currency_code: currencyCode || "USD",
|
|
387
|
+
value: (0, amounts_1.formatAmountForPayPal)(amount, currencyCode || "USD"),
|
|
388
|
+
},
|
|
389
|
+
...(typeof isFinalCapture === "boolean"
|
|
390
|
+
? { is_final_capture: isFinalCapture }
|
|
391
|
+
: {}),
|
|
392
|
+
}
|
|
393
|
+
: {
|
|
394
|
+
...(typeof isFinalCapture === "boolean"
|
|
395
|
+
? { is_final_capture: isFinalCapture }
|
|
396
|
+
: {}),
|
|
397
|
+
};
|
|
398
|
+
const captureUrl = authorizationId
|
|
399
|
+
? `${base}/v2/payments/authorizations/${authorizationId}/capture`
|
|
400
|
+
: `${base}/v2/checkout/orders/${orderId}/capture`;
|
|
401
|
+
const ppResp = await fetch(captureUrl, {
|
|
402
|
+
method: "POST",
|
|
403
|
+
headers: {
|
|
404
|
+
Authorization: `Bearer ${accessToken}`,
|
|
405
|
+
"Content-Type": "application/json",
|
|
406
|
+
"PayPal-Request-Id": requestId,
|
|
407
|
+
},
|
|
408
|
+
body: JSON.stringify(capturePayload),
|
|
409
|
+
});
|
|
410
|
+
const ppText = await ppResp.text();
|
|
411
|
+
debugId = ppResp.headers.get("paypal-debug-id");
|
|
412
|
+
if (!ppResp.ok) {
|
|
413
|
+
throw new Error(`PayPal capture error (${ppResp.status}): ${ppText}${debugId ? ` debug_id=${debugId}` : ""}`);
|
|
414
|
+
}
|
|
415
|
+
const capture = JSON.parse(ppText);
|
|
416
|
+
const captureId = capture?.id || capture?.purchase_units?.[0]?.payments?.captures?.[0]?.id;
|
|
417
|
+
const existingCaptures = Array.isArray(paypalData.captures) ? paypalData.captures : [];
|
|
418
|
+
const captureEntry = {
|
|
419
|
+
id: captureId,
|
|
420
|
+
status: capture?.status,
|
|
421
|
+
amount: capture?.amount,
|
|
422
|
+
raw: capture,
|
|
423
|
+
};
|
|
424
|
+
return {
|
|
425
|
+
data: {
|
|
426
|
+
...(data || {}),
|
|
427
|
+
paypal: {
|
|
428
|
+
...paypalData,
|
|
429
|
+
order_id: orderId,
|
|
430
|
+
capture_id: captureId,
|
|
431
|
+
capture,
|
|
432
|
+
authorization_id: authorizationId || paypalData.authorization_id,
|
|
433
|
+
captures: [...existingCaptures, captureEntry],
|
|
434
|
+
},
|
|
435
|
+
captured_at: new Date().toISOString(),
|
|
436
|
+
},
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
async cancelPayment(_input) {
|
|
440
|
+
const data = (_input.data || {});
|
|
441
|
+
return {
|
|
442
|
+
data: {
|
|
443
|
+
...(data || {}),
|
|
444
|
+
canceled_at: new Date().toISOString(),
|
|
445
|
+
},
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
async refundPayment(_input) {
|
|
449
|
+
const data = (_input.data || {});
|
|
450
|
+
const paypalData = (data.paypal || {});
|
|
451
|
+
const captureId = String(paypalData.capture_id || data.capture_id || "");
|
|
452
|
+
if (!captureId) {
|
|
453
|
+
return {
|
|
454
|
+
data: {
|
|
455
|
+
...(data || {}),
|
|
456
|
+
refunded_at: new Date().toISOString(),
|
|
457
|
+
},
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
const requestId = this.getIdempotencyKey(_input, `refund-${captureId}`);
|
|
461
|
+
const amount = Number(data.amount ?? 0);
|
|
462
|
+
const currencyCode = (0, currencies_1.normalizeCurrencyCode)(data.currency_code || process.env.PAYPAL_CURRENCY || "USD");
|
|
463
|
+
const { accessToken, base } = await this.getPayPalAccessToken();
|
|
464
|
+
const refundPayload = amount > 0
|
|
465
|
+
? {
|
|
466
|
+
amount: {
|
|
467
|
+
currency_code: currencyCode,
|
|
468
|
+
value: (0, amounts_1.formatAmountForPayPal)(amount, currencyCode),
|
|
469
|
+
},
|
|
470
|
+
}
|
|
471
|
+
: {};
|
|
472
|
+
const resp = await fetch(`${base}/v2/payments/captures/${captureId}/refund`, {
|
|
473
|
+
method: "POST",
|
|
474
|
+
headers: {
|
|
475
|
+
Authorization: `Bearer ${accessToken}`,
|
|
476
|
+
"Content-Type": "application/json",
|
|
477
|
+
"PayPal-Request-Id": requestId,
|
|
478
|
+
},
|
|
479
|
+
body: JSON.stringify(refundPayload),
|
|
480
|
+
});
|
|
481
|
+
const text = await resp.text();
|
|
482
|
+
if (!resp.ok) {
|
|
483
|
+
const debugId = resp.headers.get("paypal-debug-id");
|
|
484
|
+
throw new Error(`PayPal refund error (${resp.status}): ${text}${debugId ? ` debug_id=${debugId}` : ""}`);
|
|
485
|
+
}
|
|
486
|
+
const refund = JSON.parse(text);
|
|
487
|
+
const existingRefunds = Array.isArray(paypalData.refunds) ? paypalData.refunds : [];
|
|
488
|
+
const refundEntry = {
|
|
489
|
+
id: refund?.id,
|
|
490
|
+
status: refund?.status,
|
|
491
|
+
amount: refund?.amount,
|
|
492
|
+
raw: refund,
|
|
493
|
+
};
|
|
494
|
+
return {
|
|
495
|
+
data: {
|
|
496
|
+
...(data || {}),
|
|
497
|
+
paypal: {
|
|
498
|
+
...paypalData,
|
|
499
|
+
refund_id: refund?.id,
|
|
500
|
+
refund_status: refund?.status,
|
|
501
|
+
refunds: [...existingRefunds, refundEntry],
|
|
502
|
+
refund,
|
|
503
|
+
},
|
|
504
|
+
refunded_at: new Date().toISOString(),
|
|
505
|
+
},
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
async retrievePayment(_input) {
|
|
509
|
+
const data = (_input.data || {});
|
|
510
|
+
const paypalData = (data.paypal || {});
|
|
511
|
+
const orderId = String(paypalData.order_id || data.order_id || "");
|
|
512
|
+
if (!orderId) {
|
|
513
|
+
return { data: { ...(data || {}) } };
|
|
514
|
+
}
|
|
515
|
+
const order = await this.getOrderDetails(orderId);
|
|
516
|
+
const capture = order?.purchase_units?.[0]?.payments?.captures?.[0];
|
|
517
|
+
const authorization = order?.purchase_units?.[0]?.payments?.authorizations?.[0];
|
|
518
|
+
return {
|
|
519
|
+
data: {
|
|
520
|
+
...(data || {}),
|
|
521
|
+
paypal: {
|
|
522
|
+
...paypalData,
|
|
523
|
+
order,
|
|
524
|
+
authorization_id: authorization?.id || paypalData.authorization_id,
|
|
525
|
+
capture_id: capture?.id || paypalData.capture_id,
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
async getPaymentStatus(_input) {
|
|
531
|
+
const data = (_input.data || {});
|
|
532
|
+
const paypalData = (data.paypal || {});
|
|
533
|
+
const orderId = String(paypalData.order_id || data.order_id || "");
|
|
534
|
+
if (!orderId) {
|
|
535
|
+
return { status: "pending", data: { ...(data || {}) } };
|
|
536
|
+
}
|
|
537
|
+
const order = await this.getOrderDetails(orderId);
|
|
538
|
+
const capture = order?.purchase_units?.[0]?.payments?.captures?.[0];
|
|
539
|
+
const authorization = order?.purchase_units?.[0]?.payments?.authorizations?.[0];
|
|
540
|
+
const mappedStatus = this.mapCaptureStatus(capture?.status) ||
|
|
541
|
+
this.mapAuthorizationStatus(authorization?.status) ||
|
|
542
|
+
this.mapOrderStatus(order?.status) ||
|
|
543
|
+
"pending";
|
|
544
|
+
return {
|
|
545
|
+
status: mappedStatus,
|
|
546
|
+
data: {
|
|
547
|
+
...(data || {}),
|
|
548
|
+
paypal: {
|
|
549
|
+
...paypalData,
|
|
550
|
+
order,
|
|
551
|
+
authorization_id: authorization?.id || paypalData.authorization_id,
|
|
552
|
+
capture_id: capture?.id || paypalData.capture_id,
|
|
553
|
+
},
|
|
554
|
+
},
|
|
555
|
+
};
|
|
556
|
+
}
|
|
557
|
+
async deletePayment(_input) {
|
|
558
|
+
return { data: {} };
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Medusa requires this method even if you don't support webhooks yet.
|
|
562
|
+
*/
|
|
563
|
+
async getWebhookActionAndData(payload) {
|
|
564
|
+
return (0, webhook_utils_1.getPayPalWebhookActionAndData)(payload);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
exports.PayPalAdvancedCardProvider = PayPalAdvancedCardProvider;
|
|
568
|
+
exports.default = PayPalAdvancedCardProvider;
|
|
569
|
+
//# sourceMappingURL=card-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-service.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/payment-provider/card-service.ts"],"names":[],"mappings":";;;AAAA,qDAAmE;AACnE,mCAAmC;AAyBnC,mDAA+D;AAC/D,8CAAwD;AACxD,oDAG4B;AAK5B,SAAS,iBAAiB;IACxB,IAAI,CAAC;QACH,OAAO,IAAA,mBAAU,GAAE,CAAA;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,WAAW,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,C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CAAA;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,MAA0B;QAC5C,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,uBAAuB,CAC3B,OAA0C;QAE1C,OAAO,IAAA,6CAA6B,EAAC,OAAO,CAAC,CAAA;IAC/C,CAAC;;AAIM,gEAA0B;AADnC,kBAAe,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import PayPalPaymentProvider from "./service";
|
|
2
|
+
import PayPalAdvancedCardProvider from "./card-service";
|
|
3
|
+
/**
|
|
4
|
+
* Payment Module Provider definition
|
|
5
|
+
* Medusa will scan `services` to register payment providers on boot.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: import("@medusajs/types").ModuleProviderExports;
|
|
8
|
+
export default _default;
|
|
9
|
+
export { PayPalPaymentProvider, PayPalAdvancedCardProvider, };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/paypal/payment-provider/index.ts"],"names":[],"mappings":"AACA,OAAO,qBAAqB,MAAM,WAAW,CAAA;AAC7C,OAAO,0BAA0B,MAAM,gBAAgB,CAAA;AAEvD;;;GAGG;;AACH,wBAKE;AAEF,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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.PayPalAdvancedCardProvider = exports.PayPalPaymentProvider = void 0;
|
|
7
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
8
|
+
const service_1 = __importDefault(require("./service"));
|
|
9
|
+
exports.PayPalPaymentProvider = service_1.default;
|
|
10
|
+
const card_service_1 = __importDefault(require("./card-service"));
|
|
11
|
+
exports.PayPalAdvancedCardProvider = card_service_1.default;
|
|
12
|
+
/**
|
|
13
|
+
* Payment Module Provider definition
|
|
14
|
+
* Medusa will scan `services` to register payment providers on boot.
|
|
15
|
+
*/
|
|
16
|
+
exports.default = (0, utils_1.ModuleProvider)(utils_1.Modules.PAYMENT, {
|
|
17
|
+
services: [
|
|
18
|
+
service_1.default,
|
|
19
|
+
card_service_1.default,
|
|
20
|
+
],
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/modules/paypal/payment-provider/index.ts"],"names":[],"mappings":";;;;;;AAAA,qDAAmE;AACnE,wDAA6C;AAe3C,gCAfK,iBAAqB,CAeL;AAdvB,kEAAuD;AAerD,qCAfK,sBAA0B,CAeL;AAb5B;;;GAGG;AACH,kBAAe,IAAA,sBAAc,EAAC,eAAO,CAAC,OAAO,EAAE;IAC7C,QAAQ,EAAE;QACR,iBAAqB;QACrB,sBAA0B;KAC3B;CACF,CAAC,CAAA"}
|