
For many stores, the hardest part of checkout isn’t cart building; it’s taking payment securely without slowing down buyers. COPYandPAY solves this with a hosted, embeddable payment widget that keeps card data off the Magento server, achieves PCI SAQ‑A scope, and supports a broad range of brands. The result is a faster path to “Paid,” with less compliance overhead and fewer integration pitfalls. This is developer-ready guide for Magento2 COPYandPAY Integration.
What COPYandPAY Is and How It Works
COPYandPAY is a hosted payment form embedded via a lightweight JavaScript snippet. The workflow is deliberately simple:
- Prepare the checkout: The server posts order details (amount, currency, type) to the payment API and receives a checkoutId.
- Render the payment form: The storefront includes a script using the checkoutId and displays one or more card/brand forms to the shopper.
- Get payment status: After submission, the shopper returns to a result URL; the server retrieves the status from the payment API and finalises the order.
Why merchants like it:
- PCI SAQ‑A compliant (the widget captures card data, not Magento).
- Quick to implement, easy to brand groups of methods, supports 3‑D Secure 2.
- Stable checkoutId behaviour (reusable up to a short window if the buyer reloads).
Key Benefits for Magento Teams
- Faster go‑live: Minimal front end work, drop in a script and form tags.
- Lower PCI scope: No card data touches Magento; audits are simpler.
- Reliable UX: The hosted widget handles brand flows and 3‑D Secure.
- Safer operations: Clear transaction lifecycles, robust status checks, throttling guidance.
Module Overview: Admin Configuration
The new “COPYandPAY” payment method for Magento 2 includes:
- Enable/Disable and Title: Show or hide and label the method at checkout.
- Mode: Sandbox or Production for safe testing and go‑live control.
- Credentials: Entity ID and Token required by the provider.
- Brands: Space‑separated list of supported brands to render (for example: VISA MASTER AMEX).
- Test Modes: External or Internal.
- External: Full end‑to‑end against the provider’s test environment (creates test transactions).
- Internal: Simulator mode for local flows (returns simulated responses; doesn’t create transactions).
- Debug: Logs request/response for troubleshooting.
- Auto‑cancellation: A cron‑driven job cancels pending orders after a configured timeout (for example, two hours) to keep order queues clean.
Front End Flow: What Shoppers See
- At checkout, the buyer selects “COPYandPAY.”
- On “Continue to payment,” Magento generates a checkoutId and renders the hosted widget.
- The widget displays the configured card brands (for example: Visa/Mastercard only, or multiple groups across separate forms).
- The shopper enters test card details in sandbox, or real details in production, completes any required 3‑D Secure challenge, and proceeds.
- The order moves to Processing with a transaction ID; Magento can auto‑invoice.
Supported Brand Grouping
The widget supports:
- Single form with multiple brands (for example: VISA MASTER AMEX).
Technical Walkthrough: COPYandPAY in Magento 2
- Prepare the checkout (server‑to‑server)
- Magento posts order parameters (amount, currency, order type) to the provider.
- Receives checkoutId (short‑lived token) for rendering the widget.
- Render the payment widget (storefront)
- Include the provider’s widget script with the checkoutId.
- Add one or more form tags with class “paymentWidgets,” action set to shopperResultUrl, and data‑brands listing supported methods.
- Get payment status (server)
- After submission, the shopper lands on the configured result URL with a resourcePath query parameter.
- Magento makes an authenticated GET to baseUrl + resourcePath to retrieve final status.
- Important behaviours:
Data to verify on status
- Payment ID(s)
- Amount
- Currency
- Brand
- Type
- Result code
- 3‑D Secure outcomes (if used)
Admin Features That Help Operations
- Debug mode: Controlled logging for requests and responses to speed investigations.
- Auto‑cancel job: Cancels unfinalised orders after X hours to prevent stale states and stock locks.
- Test mode selector:
- Internal simulator for basic flows without hitting external systems.
- External sandbox for realistic end‑to‑end (recommended before launch).
Security and Compliance in Practice
- PCI SAQ‑A alignment: Card data is collected by the hosted form, not Magento.
- 3‑D Secure 2: Risk‑based authentication and challenge windows handled by the provider.
- Reduced exposure: Lower surface area within Magento for sensitive data.
Conclusion: Faster, Safer Payments Without Heavy Lifting
COPYandPAY gives Magento teams a clean balance of speed, security, and control. The PCI SAQ‑A model reduces compliance effort. The widget handles brand rendering and 3‑D Secure, while the module’s sandbox modes, simulator option, debug logs, and auto‑cancellation make testing and operations straightforward. For stores that want reliable payments without reinventing checkout, Magento 2 COPYandPAY Integration is a smart choice.