Sf payments

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Sf payments is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. 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 whe

How to use this skill

Skill file

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 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:

B2B Payment Adapter Architecture

Apex PaymentGatewayAdapter interface:

// 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:

PCI Compliance

Tokenization Principle:

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):

Code Examples

// Pattern: B2C payment authorization hook
// Fetch live docs for SFCC PaymentProcessor scripts
// function authorize(order, paymentInstrument, amount)
//   -> call processor API -> return {authorized, error}
// 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

B2C Cartridge Development

B2B Payment Integration

3D Secure

Fetch the Salesforce Payments configuration guide, PaymentGatewayAdapter Apex reference, and your processor's SDK docs for exact implementation details before coding.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.