Skip to content

Payment Gateways

Payment gateways are how your customers pay for orders. Shop Craft supports four payment methods out of the box: Razorpay, Stripe, PayPal, and Cash on Delivery. You can enable one or more gateways depending on your needs.

Go to Admin > Settings and select the Payment tab.

Important

At least one payment gateway must be enabled for customers to place orders. If no gateway is enabled, the checkout process will not work.

Razorpay

Razorpay is a popular payment gateway in India that supports UPI, cards, wallets, and net banking.

Setup Steps

  1. Sign up at razorpay.com and complete your business verification
  2. Go to your Razorpay Dashboard > Settings > API Keys
  3. Generate a new API key pair
  4. In Shop Craft, go to Admin > Settings > Payment
  5. Find the Razorpay section and enter:
FieldWhere to Find It
Key IDRazorpay Dashboard > Settings > API Keys (starts with rzp_live_ or rzp_test_)
Key SecretShown once when you generate the API key — save it securely
  1. Toggle the gateway to Enabled
  2. Click Save

Webhook Configuration

Webhooks are essential for Razorpay to notify your store about successful payments. Without webhooks, online payments may not be properly recorded.

  1. Go to your Razorpay Dashboard > Settings > Webhooks
  2. Click Add New Webhook
  3. Enter the webhook URL:
https://yourdomain.com/webhooks/razorpay
  1. Select the events to listen for (at minimum: payment.captured, payment.failed)
  2. Set a webhook secret (optional but recommended)
  3. Click Create Webhook

WARNING

The webhook URL must use HTTPS and must be publicly accessible. If you are testing locally, webhooks will not work — use Razorpay's test mode for development.

Test Mode vs. Live Mode

  • Test mode keys start with rzp_test_ — use these for testing without real money
  • Live mode keys start with rzp_live_ — use these when your store is ready for real customers

Make sure you switch to live keys before launching your store.


Stripe

Stripe is a widely used global payment gateway that supports credit cards, debit cards, and various local payment methods.

Setup Steps

  1. Sign up at stripe.com and complete your account setup
  2. Go to your Stripe Dashboard > Developers > API keys
  3. In Shop Craft, go to Admin > Settings > Payment
  4. Find the Stripe section and enter:
FieldWhere to Find It
Publishable KeyStripe Dashboard > Developers > API keys (starts with pk_live_ or pk_test_)
Secret KeyStripe Dashboard > Developers > API keys (starts with sk_live_ or sk_test_)
Webhook Signing SecretCreated when you set up your webhook endpoint (starts with whsec_)
  1. Toggle the gateway to Enabled
  2. Click Save

Webhook Configuration

  1. Go to your Stripe Dashboard > Developers > Webhooks
  2. Click Add endpoint
  3. Enter the webhook URL:
https://yourdomain.com/webhooks/stripe
  1. Select events to listen for:
    • checkout.session.completed
    • payment_intent.succeeded
    • payment_intent.payment_failed
  2. Click Add endpoint
  3. After creating the endpoint, click on it and find the Signing secret — copy this value
  4. Enter the signing secret in Shop Craft's Stripe settings as the Webhook Signing Secret

Critical Step

The Webhook Signing Secret is essential for security. It verifies that webhook notifications are genuinely from Stripe and not from a malicious third party. Never skip this step.

Test Mode vs. Live Mode

  • Test mode keys start with pk_test_ and sk_test_
  • Live mode keys start with pk_live_ and sk_live_

Stripe has a built-in test mode toggle in the dashboard — use it to switch between test and live environments.


PayPal

PayPal lets customers pay using their PayPal account or credit/debit cards.

Setup Steps

  1. Sign up for a PayPal Business account at paypal.com
  2. Go to the PayPal Developer Dashboard
  3. Create a new app in My Apps & Credentials
  4. In Shop Craft, go to Admin > Settings > Payment
  5. Find the PayPal section and enter:
FieldWhere to Find It
Client IDPayPal Developer Dashboard > Your App > Client ID
Client SecretPayPal Developer Dashboard > Your App > Secret (click "Show")
  1. Toggle the gateway to Enabled
  2. Click Save

Webhook Configuration

  1. Go to the PayPal Developer Dashboard > My Apps & Credentials
  2. Select your app
  3. Scroll down to Webhooks and click Add Webhook
  4. Enter the webhook URL:
https://yourdomain.com/webhooks/paypal
  1. Select the event types to subscribe to (payment-related events)
  2. Click Save

Sandbox vs. Live Mode

PayPal has separate sandbox and live environments:

  • Sandbox — Use sandbox credentials from the Developer Dashboard for testing
  • Live — Use live credentials from your actual PayPal business account for real transactions

Cash on Delivery (COD)

Cash on Delivery allows customers to pay when they receive their order. No API keys or configuration are needed.

Setup

  1. Go to Admin > Settings > Payment
  2. Find the Cash on Delivery section
  3. Toggle it to Enabled
  4. Click Save

That is it! COD is the simplest payment method to set up.

TIP

COD orders are automatically set to Confirmed status when placed, since no online payment verification is needed. The customer pays the delivery person when the package arrives.

When to Use COD

COD is popular in markets where:

  • Customers prefer to see the product before paying
  • Credit/debit card usage is less common
  • Building trust with new customers

WARNING

COD carries a higher risk of order cancellations and returns compared to online payments. Consider whether COD is appropriate for your business before enabling it.


Webhook Summary

Here is a quick reference for all webhook URLs:

GatewayWebhook URL
Razorpayhttps://yourdomain.com/webhooks/razorpay
Stripehttps://yourdomain.com/webhooks/stripe
PayPalhttps://yourdomain.com/webhooks/paypal

Replace yourdomain.com with your actual domain name.

DANGER

Webhooks are critical for online payment processing. Without properly configured webhooks:

  • Payments may not be recorded in your store
  • Orders may remain stuck in "Pending" status
  • Customers may not receive order confirmation emails

Always verify your webhooks are working after setup. Most payment gateways have a "Test webhook" feature in their dashboards.

Troubleshooting

Payments are not being recorded

  • Verify your API keys are correct and not expired
  • Check that webhook URLs are configured in your payment gateway dashboard
  • Ensure your website uses HTTPS (webhooks require SSL)
  • Check storage/logs/laravel.log for error messages

"No payment methods available" at checkout

  • Make sure at least one payment gateway is enabled in Settings
  • Verify the gateway credentials are filled in correctly

Test payments work but live payments fail

  • Make sure you have switched from test/sandbox keys to live keys
  • Verify your payment gateway account is fully activated and verified

Next Steps

Shop Craft Documentation