<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Rachid Attia</title>
    <description>The latest articles on DEV Community by Rachid Attia (@rachid_attia).</description>
    <link>https://dev.to/rachid_attia</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4252637%2F864ba47a-921b-41d4-a9ad-3fa49d2023d5.jpg</url>
      <title>DEV Community: Rachid Attia</title>
      <link>https://dev.to/rachid_attia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rachid_attia"/>
    <language>en</language>
    <item>
      <title>How I Built a WooCommerce PayPal Card Payments SaaS with Server-Verified Capture</title>
      <dc:creator>Rachid Attia</dc:creator>
      <pubDate>Wed, 18 Nov 2026 22:22:06 +0000</pubDate>
      <link>https://dev.to/rachid_attia/how-i-built-a-woocommerce-paypal-card-payments-saas-with-server-verified-capture-an8</link>
      <guid>https://dev.to/rachid_attia/how-i-built-a-woocommerce-paypal-card-payments-saas-with-server-verified-capture-an8</guid>
      <description>&lt;p&gt;When I started building GPCB Pay, I thought displaying the card payment interface in WooCommerce would be the difficult part.&lt;/p&gt;

&lt;p&gt;I was wrong. 😅&lt;/p&gt;

&lt;p&gt;The bigger challenge was everything happening &lt;strong&gt;after a customer clicked Pay&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;What happens when PayPal approves an interaction but the capture hasn't been verified? What if a network request times out? What if the same capture request is triggered twice?&lt;/p&gt;

&lt;p&gt;These questions led me to build &lt;strong&gt;GPCB Pay (General PayPal Card Bridge)&lt;/strong&gt;, an independently developed WooCommerce payment integration.&lt;/p&gt;

&lt;p&gt;I recently released its open-source WordPress connector in the official WordPress Plugin Directory. I wanted to share the architecture behind it and some lessons from building a payment SaaS independently.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. A Payment Button Is Not a Payment System
&lt;/h2&gt;

&lt;p&gt;Integrating a payment provider is more than displaying a checkout button or collecting a successful browser callback.&lt;/p&gt;

&lt;p&gt;I designed GPCB Pay around three important rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Browser approval is not proof of payment.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Creating a PayPal Order does not mean the customer has paid.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;WooCommerce should complete an order only after successful server-verified capture.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;p&gt;A customer can approve a payment while the server is still processing the financial operation. Network interruptions and repeated requests can also leave the application uncertain about the outcome.&lt;/p&gt;

&lt;p&gt;The system needs to handle those situations without assuming that a payment succeeded or blindly repeating a capture.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The Architecture: Three Separate Components
&lt;/h2&gt;

&lt;p&gt;Instead of placing the entire payment system inside a WordPress plugin, I separated GPCB Pay into three components.&lt;/p&gt;

&lt;h3&gt;
  
  
  WooCommerce Connector
&lt;/h3&gt;

&lt;p&gt;A lightweight WordPress plugin that integrates with WooCommerce Checkout Blocks.&lt;/p&gt;

&lt;p&gt;It handles gateway configuration, checkout integration, authenticated communication with the backend, and WooCommerce order operations.&lt;/p&gt;

&lt;p&gt;It isn't intended to store raw card numbers, CVV, or merchant PayPal Client Secrets.&lt;/p&gt;

&lt;h3&gt;
  
  
  Private SaaS Payment Core
&lt;/h3&gt;

&lt;p&gt;A Node.js and TypeScript backend responsible for sensitive payment operations.&lt;/p&gt;

&lt;p&gt;Its responsibilities include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating PayPal Orders.&lt;/li&gt;
&lt;li&gt;Coordinating and verifying Captures.&lt;/li&gt;
&lt;li&gt;Idempotency and duplicate-capture safeguards.&lt;/li&gt;
&lt;li&gt;Durable payment records and recovery.&lt;/li&gt;
&lt;li&gt;Merchant and store authorization.&lt;/li&gt;
&lt;li&gt;Subscription access enforcement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The server coordinates financial operations rather than trusting the browser to declare an order paid.&lt;/p&gt;

&lt;h3&gt;
  
  
  Merchant Dashboard
&lt;/h3&gt;

&lt;p&gt;A React-based application where merchants can manage onboarding and payment configuration.&lt;/p&gt;

&lt;p&gt;This includes store provisioning, domain verification, Connector credentials, PayPal Sandbox and Live connections, and service-access status.&lt;/p&gt;

&lt;p&gt;Separating these responsibilities makes the payment boundaries clearer and allows the WooCommerce Connector to remain relatively small.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Why Server-Verified Capture Matters
&lt;/h2&gt;

&lt;p&gt;Imagine a customer approves a payment, but the next network request times out.&lt;/p&gt;

&lt;p&gt;Did the payment fail? Did PayPal complete the Capture before the connection disappeared?&lt;/p&gt;

&lt;p&gt;The browser alone cannot reliably answer those questions.&lt;/p&gt;

&lt;p&gt;In GPCB Pay, the backend is responsible for verifying the provider's Capture outcome before WooCommerce can complete the order.&lt;/p&gt;

&lt;p&gt;There are several safeguards around that process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Idempotency:&lt;/strong&gt; Repeated requests associated with the same payment attempt should not automatically create repeated financial effects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Duplicate-Capture protection:&lt;/strong&gt; The system must prevent an already captured payment from being captured again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Durable state:&lt;/strong&gt; Payment evidence must survive a request ending or an application restart.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Recovery and reconciliation:&lt;/strong&gt; When an operation has an uncertain outcome, the original attempt needs verification before another financial action is considered.&lt;/p&gt;

&lt;p&gt;One of the biggest lessons I learned is that handling an uncertain outcome is just as important as handling a successful one.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Guest Card vs. Advanced Card
&lt;/h2&gt;

&lt;p&gt;GPCB Pay supports two explicitly configured payment experiences through eligible PayPal services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Guest Card&lt;/strong&gt; can provide a debit or credit card payment option through PayPal, depending on the merchant and checkout context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advanced Card&lt;/strong&gt; uses PayPal-hosted card fields within the WooCommerce checkout where the merchant has the required capabilities and approval.&lt;/p&gt;

&lt;p&gt;Both experiences depend on PayPal eligibility, supported countries, merchant configuration, and checkout conditions.&lt;/p&gt;

&lt;p&gt;Connecting PayPal successfully does not guarantee that every card payment option will be available.&lt;/p&gt;

&lt;p&gt;Version 0.1.0 is designed for &lt;strong&gt;WooCommerce Checkout Blocks&lt;/strong&gt;, not Classic Checkout. Automatic switching between Guest and Advanced modes is not implemented.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Merchant Onboarding Is Also a Security Problem
&lt;/h2&gt;

&lt;p&gt;Another challenge was connecting the correct WooCommerce website to the correct merchant account.&lt;/p&gt;

&lt;p&gt;The setup process includes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Merchant registration and email verification.&lt;/li&gt;
&lt;li&gt;Creating a WooCommerce store in the Merchant Dashboard.&lt;/li&gt;
&lt;li&gt;Issuing a Connector Key ID and Signing Secret.&lt;/li&gt;
&lt;li&gt;Verifying domain ownership using a DNS TXT record.&lt;/li&gt;
&lt;li&gt;Proving Connector credential possession through an authenticated request.&lt;/li&gt;
&lt;li&gt;Completing the authorized store activation workflow.&lt;/li&gt;
&lt;li&gt;Configuring PayPal Sandbox and Live credentials.&lt;/li&gt;
&lt;li&gt;Testing connectivity and confirming payment readiness.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These checks serve different purposes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DNS verification proves domain control. Connector proof demonstrates possession of the configured credentials. Neither one, by itself, authorizes payment processing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This separation helped me think more carefully about trust boundaries throughout the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Full WooCommerce Setup Tutorial
&lt;/h2&gt;

&lt;p&gt;I've also published an English tutorial showing the actual GPCB Pay interfaces and onboarding process.&lt;/p&gt;

&lt;p&gt;It covers plugin installation, merchant registration, DNS verification, Connector configuration, PayPal Sandbox and Live setup, subscription access, and the eligible card checkout experiences.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/NWdg48OdxGM" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;The video is based on real product interfaces. Actual payment-method availability can differ depending on each merchant's PayPal eligibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. The Project Is Now Available on WordPress.org
&lt;/h2&gt;

&lt;p&gt;GPCB Pay's WooCommerce Connector is free and open-source under GPLv2 or later.&lt;/p&gt;

&lt;p&gt;The operational SaaS Payment Core is a separate external service with an eligible trial or paid subscription. PayPal processing fees are separate.&lt;/p&gt;

&lt;p&gt;If you're interested in exploring the project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;WordPress Plugin:&lt;/strong&gt; &lt;a href="https://wordpress.org/plugins/gpcb-pay-card-payments-for-woocommerce/" rel="noopener noreferrer"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Official Website:&lt;/strong&gt; &lt;a href="https://gpcbpay.com/" rel="noopener noreferrer"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Setup Documentation:&lt;/strong&gt; &lt;a href="https://gpcbpay.com/documentation/" rel="noopener noreferrer"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GPCB Pay is independently developed and is not affiliated with, sponsored by, or endorsed by PayPal or WooCommerce.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. What I Learned Building This Independently
&lt;/h2&gt;

&lt;p&gt;Building a payment integration pushed me to think beyond the user interface.&lt;/p&gt;

&lt;p&gt;A successful checkout isn't just a nice-looking payment form. It needs verified financial outcomes, carefully managed authorization boundaries, persistent state, and deliberate recovery behavior.&lt;/p&gt;

&lt;p&gt;I'm still learning and improving the engineering behind the project, and sharing that process is part of why I built it publicly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For developers who have worked with WooCommerce or payment APIs: what's the most difficult payment edge case you've encountered?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I'd genuinely like to hear your experiences and feedback.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flo3poa71efngflzz32aw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flo3poa71efngflzz32aw.png" alt=" " width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>woocommerce</category>
      <category>wordpress</category>
      <category>webdev</category>
      <category>security</category>
    </item>
  </channel>
</rss>
