Skip to main content

WPCraftEngineer – Build Fast, Secure & High-Performance WordPress Websites

How to Accept Card Payments in WooCommerce with PayPal

A shopper has picked a product, entered their delivery address, and reached the payment section. At that point, they usually want one thing: to pay and get on with their day. If you already use PayPal for your business and want to offer customers a visible credit or debit card option, you can add PayPal-hosted card fields directly to your WooCommerce checkout.

Craftengineer Card Gateway for PayPal is an independent WooCommerce plugin that adds a Credit / Debit Card payment option. It works with the classic checkout and the WooCommerce Checkout Block, so you can use it with whichever of those two checkout setups your store already has.

What does the customer see?

When a customer selects Credit / Debit Card, the checkout shows fields for the card number, expiry date, security code and cardholder name. They enter the details and select Place Order from the same checkout page.

PayPal hosts the card fields. The card details entered there go directly to PayPal, while WooCommerce keeps the order record. Your store still has one place to check what the customer bought, whether the order is paid and what needs to happen next.

How to set it up

You’ll need WooCommerce, an HTTPS-enabled store, PHP Sodium and a PayPal merchant account eligible for hosted card payments.

  1. Install and activate Craftengineer Card Gateway for PayPal.
  2. Go to WooCommerce → Settings → Payments and open the gateway settings.
  3. Enter your PayPal REST app’s Sandbox Client ID and Secret Key in the Sandbox account section, then select Save & Verify.
  4. Select Sandbox as the environment, enable the gateway and save your changes.
  5. Open checkout as a shopper and place an order using a PayPal Sandbox test card.

Save & Verify checks the API credentials. The test order checks what matters to a shopper: that the card fields appear, the payment goes through and the order confirmation page opens.

If you’re testing on a staging copy, use the checkout checks in our WooCommerce 11.3 update guide to cover shipping, tax and coupons alongside the card payment.

What should happen after a payment?

Open the test order in WooCommerce and check it against the transaction in PayPal Sandbox. Make sure the amount and currency match and the WooCommerce order shows Processing after a successful capture.

For example, if you sell a product that your team needs to pack, Processing tells them payment has been received and the order is ready for fulfilment. They can mark it Completed once they’ve finished the work. The current gateway build applies that same initial status to paid virtual and downloadable orders as well.

If the order is paid but the customer hasn’t received their confirmation email, check the notification settings and delivery logs using our WordPress email troubleshooting guide.

What if the card fields don’t appear?

Start by checking that the gateway is enabled and that the credentials match the active environment. If you’re testing in Sandbox, both the Client ID and Secret Key should come from the Sandbox app. Then try checkout in a private window to see what a new customer sees.

If the credentials are verified and the fields still don’t load, check whether PayPal has enabled hosted card payments for that merchant account and whether the checkout currency is supported. It’s worth doing this before changing your checkout theme or rebuilding the payment section.

Moving from Sandbox to Live

Once a Sandbox order works from checkout through order confirmation, enter the Live credentials in their own section, select Live and save. If refunds are part of your day-to-day workflow, test a refund in Sandbox first so you know how it appears in both WooCommerce and PayPal. The gateway supports full and partial refunds from WooCommerce.

A successful test should leave you with three things you can check: a customer-facing order confirmation, a WooCommerce order in Processing, and a matching transaction in PayPal.

If you’re still seeing failed payments or checkout errors on a live store, our WooCommerce support and maintenance service can help investigate the payment flow.