orcaqubits/agentic-commerce-skills-plugins/medusa-payments

Claude Code and agent skill by orcaqubits/agentic-commerce-skills-plugins

Trust tier 2
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Implement Medusa v2 payment processing — payment module, provider abstraction, payment sessions, authorization/capture/refund lifecycle, and Stripe/PayPal integration. Use when adding payment providers.

Install

npx vskill@latest install orcaqubits/agentic-commerce-skills-plugins/medusa-payments

SKILL.md

Medusa v2 Payment Processing

Before writing code

Fetch live docs:

  1. Web-search site:docs.medusajs.com payment module for payment data model and service methods
  2. Web-search site:docs.medusajs.com payment provider for the provider abstraction layer
  3. Web-search site:docs.medusajs.com stripe payment for Stripe integration setup
  4. Fetch https://docs.medusajs.com/resources/references/payment and review the IPaymentModuleService interface
  5. Web-search medusajs v2 AbstractPaymentProvider 2026 for latest provider interface

Payment Module Architecture

Entity Relationships
EntityContainsKey Fields
PaymentCollectionSessions, Paymentsstatus, amount, currency_code
PaymentSessionProvider dataprovider_id, status, amount, data (JSON)
PaymentCaptures, Refundsprovider_id, amount, captured_at
Module Links
Cart Module ──link──> Payment Module (payment collection)
Order Module ──link──> Payment Module (payment collection)
Region Module ──link──> Payment Module (available providers)
Fetch live docs for exact link definitions and how payment collections bridge carts and orders.

Payment Lifecycle

PaymentSession Statuses
StatusMeaning
pendingSession initialized, awaiting customer action
requires_moreAdditional steps needed (e.g., 3DS)
authorizedPayment authorized, funds reserved
canceledPayment voided/canceled
errorPayment failed
Payment Statuses

After authorization, a Payment entity is created from the session:

StatusMeaning
capturedFunds captured to merchant
partially_refundedPartial refund issued
refundedFull refund issued

Payment Provider Abstraction

All payment providers extend AbstractPaymentProvider:

ts
// Skeleton: custom payment provider
// Fetch live docs for AbstractPaymentProvider interface
class MyPaymentProvider extends AbstractPaymentProvider {
// Implement: initiatePayment, authorizePayment,
// capturePayment, refundPayment, cancelPayment
// Fetch live docs for exact method signatures
}
Key Provider Methods
MethodPurpose
initiatePaymentCreate payment session with provider
authorizePaymentAuthorize payment (reserve funds)
capturePaymentCapture authorized payment
refundPaymentRefund captured payment
cancelPaymentCancel/void payment
deletePaymentClean up provider-side session
getPaymentStatusQuery current status from provider
updatePaymentUpdate an existing payment session
retrievePaymentRetrieve payment data from provider
getWebhookActionAndDataParse incoming webhook events
Fetch live docs for the full method list — the provider interface has additional methods beyond those listed above (e.g., createAccountHolder, listPaymentMethods, savePaymentMethod). Always verify the current AbstractPaymentProvider interface.

Stripe Integration

ConfigurationDescription
apiKeyStripe secret key
webhookSecretStripe webhook signing secret
captureAuto-capture or manual (true/false)
Stripe Webhook Events
EventMedusa Action
payment_intent.succeededMark session authorized/captured
payment_intent.payment_failedMark session errored
charge.refundedMark refund completed
Fetch live docs for Stripe provider configuration options and webhook endpoint setup.

PayPal Integration

ConfigurationDescription
clientIdPayPal client ID
clientSecretPayPal client secret
sandboxUse sandbox environment (true/false)
Fetch live docs for PayPal provider options, redirect handling, and webhook configuration.

Payment Workflows

WorkflowPurpose
createPaymentCollectionForCartWorkflowCreate collection linked to cart
initializePaymentSessionWorkflowStart session with specific provider
authorizePaymentSessionWorkflowAuthorize a pending session
capturePaymentWorkflowCapture an authorized payment
refundPaymentWorkflowRefund a captured payment
cancelPaymentWorkflowCancel/void a payment
Key Service Methods
OperationMethod
Create collectionpaymentModuleService.createPaymentCollections()
Create sessionpaymentModuleService.createPaymentSession()
Authorize sessionpaymentModuleService.authorizePaymentSession()
Capture paymentpaymentModuleService.capturePayment()
Refund paymentpaymentModuleService.refundPayment()
Fetch live docs for workflow input shapes and provider-specific data requirements.

Admin API Routes

Route PatternMethodPurpose
/admin/paymentsGETList payments
/admin/payments/:idGETRetrieve payment
/admin/payments/:id/capturePOSTCapture payment
/admin/payments/:id/refundPOSTRefund payment

Best Practices

Provider Implementation
  • Always extend AbstractPaymentProvider — do not implement from scratch
  • Store provider-specific data in the session data field (not in metadata)
  • Handle requires_more status for providers with multi-step flows (3DS, redirect)
  • Implement idempotent operations — captures and refunds may be retried
Webhook Handling
  • Validate webhook signatures before processing events
  • Use idempotency keys to prevent duplicate payment processing
  • Log all webhook events for audit trails and debugging
  • Handle out-of-order webhook delivery gracefully
Security
  • Never store raw API keys in code — use environment variables
  • Never expose payment session secrets to the client
  • Use HTTPS-only webhook endpoints
  • Implement amount validation — verify captured amount matches the order total
Testing
  • Use provider sandbox/test modes during development
  • Test the full lifecycle: initiate -> authorize -> capture -> refund
  • Test error scenarios: declined cards, insufficient funds, network timeouts

Fetch the Medusa v2 payment module documentation and provider interface references for exact method signatures, webhook configuration, and provider registration patterns before implementing.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
21
Repository forks
12
7-day trend score
15

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 26 Apr 2026, 6 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/orcaqubits/agentic-commerce-skills-plugins/medusa-payments/badge)](https://verified-skill.com/skills/orcaqubits/agentic-commerce-skills-plugins/medusa-payments)

Something wrong with this skill or its page? Tell us.