sf-payments
Implement Salesforce Commerce payments — Salesforce Payments (supports multiple processors including Stripe and Adyen), B2C payment adapters (JavaScript cartridge-based), B2B payment adapters (Apex-based), PCI compliance via tokenization, 3D Secure/SCA support, and payment method management. Use when implementing payment processing.
Best use case
sf-payments is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Implement Salesforce Commerce payments — Salesforce Payments (supports multiple processors including Stripe and Adyen), B2C payment adapters (JavaScript cartridge-based), B2B payment adapters (Apex-based), PCI compliance via tokenization, 3D Secure/SCA support, and payment method management. Use when implementing payment processing.
Teams using sf-payments should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/sf-payments/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How sf-payments Compares
| Feature / Agent | sf-payments | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Implement Salesforce Commerce payments — Salesforce Payments (supports multiple processors including Stripe and Adyen), B2C payment adapters (JavaScript cartridge-based), B2B payment adapters (Apex-based), PCI compliance via tokenization, 3D Secure/SCA support, and payment method management. Use when implementing payment processing.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# sf-payments
## Before Writing Code
**Fetch live docs before implementing payment processing features.**
1. Web-search: "Salesforce Payments documentation Stripe Adyen 2026"
2. Web-search: "Salesforce B2C Commerce payment cartridge integration guide 2026"
3. Web-search: "Salesforce B2B Commerce Apex PaymentGatewayAdapter 2026"
4. Web-search: "PCI DSS SAQ-A compliance tokenization 2026"
5. Web-search: "3D Secure 2 SCA authentication flow implementation 2026"
6. Web-fetch the Salesforce Payments setup guide and B2C payment hook documentation
## Conceptual Architecture
### Payment Flow Overview
```
Authorize (reserve funds)
-> Capture (collect on shipment)
-> Refund (return funds, full or partial)
-> Void (cancel before capture)
```
This authorize-capture-refund lifecycle applies to both B2C and B2B. Some flows combine authorize + capture into a single "sale" operation.
### Salesforce Payments (Native)
**Multi-processor support:** Salesforce Payments integrates with Stripe, Adyen, PayPal, and other processors. Configuration is unified within Salesforce Commerce setup.
| Feature | Detail |
|---|---|
| Payment methods | Cards, Apple Pay, Google Pay, ACH, SEPA, local methods |
| Saved methods | Tokenized cards for returning customers |
| Fraud detection | Via configured processor (Stripe Radar, Adyen risk) |
| 3DS / SCA | Built-in support through processor |
| Dispute management | Chargeback handling and evidence submission |
| Multi-currency | Configured per processor account |
### B2C Payment Processor Architecture
**Cartridge-based integration:**
- Payment processors packaged as SFCC cartridges (int_stripe, int_adyen, int_paypal, int_cybersource)
- Cartridge overlays base commerce cartridge
- Configuration in Business Manager: credentials, endpoints, payment method assignment
- Site-specific processor configuration per locale
**Payment Hook Points:**
| Hook | Purpose |
|---|---|
| Authorize | Reserve funds on payment method |
| Capture | Capture authorized amount (full or partial) |
| Refund | Return funds to customer |
| Void | Cancel authorization before capture |
| Verify | Validate payment method ($0 auth) |
**Server-side scripts** (authorize.js, capture.js, refund.js, void.js) receive basket/order, payment instrument, and amount; return `{authorized, error, errorMessage}`.
**Client-side integration:**
- Tokenization via processor SDK (Stripe Elements, Adyen Drop-in)
- Hosted payment fields (iframe) for PCI compliance
- Token submitted to server instead of raw card data
### B2B Payment Adapter Architecture
**Apex PaymentGatewayAdapter interface:**
- Implement in custom Apex class with methods: authorize, capture, refund, sale
- Return PaymentGatewayResponse with status, transaction ID, errors
- Register adapter in Setup > Payment Gateways
```apex
// Pattern: B2B PaymentGatewayAdapter skeleton
public class MyAdapter implements PaymentGatewayAdapter {
// Fetch live docs for PaymentGatewayAdapter interface
// Implement: authorize, capture, refund
}
```
**B2B Payment Method Types:**
| Method | Notes |
|---|---|
| Credit / debit card | Via PaymentGatewayAdapter |
| Purchase order (PO) | PO number required at checkout |
| Net terms | Net 30, Net 60 per account |
| ACH / bank transfer | For B2B bank payments |
| Invoice | Payment against generated invoice |
**B2B-specific considerations:**
- Credit limit enforcement at checkout
- Integration with approval workflows for high-value orders
- Multiple payment methods per order (split payment)
### PCI Compliance
**Tokenization Principle:**
- Never store or transmit raw card numbers through merchant servers
- Payment processor tokens replace card data; tokens stored in Salesforce (safe)
- Processor maintains secure vault with actual card data
**SAQ-A Compliance:**
| Requirement | Implementation |
|---|---|
| Card data never touches merchant servers | Use hosted payment fields (iframe) |
| Client-side tokenization only | Processor JS SDK tokenizes before form submit |
| Server receives tokens only | No raw card data in server logs or database |
| Processor handles PCI DSS Level 1 | Stripe Elements, Adyen Drop-in provide compliant fields |
### 3D Secure / SCA
**3DS2 Authentication Flow:**
```
Payment submitted
-> Processor risk assessment
-> Frictionless (low risk): instant approval
-> Challenge (high risk): redirect/iframe to bank
-> Customer authenticates (password, biometric, OTP)
-> Success: proceed with authorization
-> Failure: decline payment
```
**SCA Requirements (European Transactions):**
- Strong Customer Authentication required for European cards/merchants
- Exemptions: low-value (<30 EUR), recurring, trusted beneficiaries
- 3DS2 is primary SCA compliance method
- Successful 3DS2 shifts liability to card issuer
## Code Examples
```javascript
// Pattern: B2C payment authorization hook
// Fetch live docs for SFCC PaymentProcessor scripts
// function authorize(order, paymentInstrument, amount)
// -> call processor API -> return {authorized, error}
```
```apex
// Pattern: B2B gateway registration
// Fetch live docs for PaymentGateway setup
// Setup > Payment Gateways > register adapter class
// Store API keys in Named Credentials, not code
```
## Best Practices
### General Payment Security
- Always tokenize; never handle or store raw card data
- Use hosted payment fields (processor iframe) for SAQ-A eligibility
- Store API keys in Named Credentials or Custom Settings, never in code
- Implement webhook signature verification for async payment events
### B2C Cartridge Development
- Follow standard cartridge structure for payment scripts
- Return proper error messages for failed authorizations
- Always capture and store processor transaction IDs
- Support partial capture (split shipments) and partial refund (returns)
### B2B Payment Integration
- Support purchase orders with net payment terms for B2B buyers
- Validate against account credit limits before authorization
- Integrate payment with B2B approval workflows
- Enable ACH/bank transfer methods for B2B transactions
### 3D Secure
- Request 3DS2 authentication for all card payments
- Handle SCA exemptions properly (recurring, low-value)
- Provide good UX for challenge flows (iframe preferred over redirect)
- Verify 3DS authentication status and liability shift before proceeding
Fetch the Salesforce Payments configuration guide, PaymentGatewayAdapter Apex reference, and your processor's SDK docs for exact implementation details before coding.Related Skills
woo-payments
Build WooCommerce payment gateways — WC_Payment_Gateway, direct/redirect/hosted integrations, tokenization, subscriptions support, refunds, and PCI compliance. Use when creating custom payment method integrations.
spree-payments
Integrate payment gateways with Spree — PaymentMethod model, the v5.4+ PaymentSession provider-agnostic checkout flow, Stripe via `spree_stripe` (Apple/Google Pay, Link, Connect for marketplaces), Adyen via `spree_adyen`, PayPal via `spree_paypal_checkout`, StoreCredit / GiftCard as payment methods, refunds, payment state machine, and authoring a custom gateway. Use when wiring a payment integration, handling webhooks from a gateway, or debugging payment-state issues.
saleor-payments
Implement Saleor payment processing — transaction-based payment flow, payment Apps, sync webhook events, Stripe/Adyen patterns, and refunds. Use when building payment integrations.
medusa-payments
Implement Medusa v2 payment processing — payment module, provider abstraction, payment sessions, authorization/capture/refund lifecycle, and Stripe/PayPal integration. Use when adding payment providers.
bc-payments
Integrate BigCommerce payments — Payment Processing API, stored payment instruments, payment methods, server-side payment processing for headless, and PCI considerations. Use when building custom payment flows or processing payments programmatically.
woo-testing
Test WooCommerce extensions — PHPUnit unit/integration tests, WP test suite, WooCommerce test helpers, E2E with Playwright, and WP-CLI test scaffolding. Use when writing tests for WooCommerce plugins or setting up a test environment.
woo-shipping
Build WooCommerce shipping methods — WC_Shipping_Method, shipping zones, shipping classes, rate calculation, tracking, and integration with carriers. Use when creating custom shipping integrations or configuring shipping logic.
woo-setup
Install WooCommerce, configure the development stack, and set up a local dev environment with WP-CLI, Docker, or wp-env. Use when setting up a new WooCommerce project or development environment.
woo-security
Implement WooCommerce security — nonces, capabilities, input sanitization, output escaping, data validation, PCI compliance considerations, and WordPress security best practices. Use when hardening a WooCommerce store or reviewing security posture.
woo-plugin-dev
Create WooCommerce extensions/plugins — file structure, main plugin file, activation/deactivation hooks, custom database tables, autoloading, and WordPress plugin API. Use when building new WooCommerce extensions or structuring plugin code.
woo-performance
Optimize WooCommerce performance — object caching, transients, HPOS, database optimization, Action Scheduler, lazy loading, and query optimization. Use when improving store performance or diagnosing slowness.
woo-hooks-filters
Master the WordPress hook system for WooCommerce — actions, filters, hook priorities, WooCommerce-specific hooks, and extensibility patterns. Use when adding functionality via hooks or understanding the WooCommerce execution flow.