Skip to main content

Payments

The Payments section lets you configure the payment gateways available to customers at checkout and view a log of all payment transactions. SnapCart supports PayPal, Razorpay, PayTM, and Cash on Delivery out of the box.

Payments Gateway List Payment gateway configuration page showing all four gateways with their activation status


Accessing Payments

Click Payments in the left sidebar.

:::info Permissions required

ActionPermission
View payment settingspayment.view
Edit gateway credentialspayment.edit
:::

Payment Gateways Overview

GatewayBest ForSupports
PayPalInternational customersCredit/debit cards, PayPal wallet
RazorpayIndian customersUPI, net banking, cards, wallets, EMI
PayTMIndian customersPayTM wallet, UPI, cards
Cash on DeliveryAll customersNo online payment — pay on delivery

You can enable multiple gateways simultaneously. Customers see all active gateways at checkout and choose their preferred one.


Configuring PayPal

PayPal Configuration PayPal gateway settings page showing Client ID, Secret, and Mode fields

  1. Go to Payments → PayPal.
  2. Log in to developer.paypal.com and create an application to get your credentials.
  3. Enter the credentials in SnapCart:
FieldWhere to Find It
Client IDPayPal Developer Dashboard → My Apps & Credentials → your app
Client SecretSame location as Client ID
ModeSandbox for testing, Live for production
  1. Toggle Status to Active.
  2. Click Save.

Testing PayPal

In Sandbox mode, use PayPal sandbox buyer accounts to simulate payments:

  1. Log in to developer.paypal.com
  2. Go to Sandbox → Accounts and note the test buyer email and password
  3. Place a test order on your storefront and complete payment using the sandbox buyer account

Going Live with PayPal

  1. Change Mode to Live
  2. Replace Sandbox credentials with your Live credentials from the PayPal Developer Dashboard
  3. Place a small real test transaction to confirm it works before advertising

Configuring Razorpay

Razorpay Configuration Razorpay settings showing Key ID, Key Secret, and mode toggle

Razorpay is the recommended gateway for Indian stores. It supports the widest range of Indian payment methods.

  1. Go to Payments → Razorpay.
  2. Log in to your Razorpay Dashboard.
  3. Go to Settings → API Keys and generate a key pair.
  4. Enter in SnapCart:
FieldDescription
Key IDStarts with rzp_test_ (test) or rzp_live_ (production)
Key SecretGenerated alongside the Key ID — copy immediately, it's shown only once
ModeTest or Live
Webhook SecretOptional — for verifying Razorpay webhook payloads
  1. Toggle Status to Active.
  2. Click Save.

Testing Razorpay

In Test mode, use these test card details:

FieldValue
Card Number4111 1111 1111 1111
ExpiryAny future date (e.g., 12/28)
CVVAny 3 digits (e.g., 123)
OTP1234 (shown on the Razorpay test checkout)

For UPI testing: use success@razorpay as the UPI ID.

Configure Razorpay webhooks so that your store is notified of payment events even if the customer closes the browser mid-payment:

  1. In Razorpay Dashboard → Settings → Webhooks → Add New Webhook
  2. Set the endpoint URL to: https://yourdomain.com/api/v1/webhooks/razorpay
  3. Select events: payment.captured, payment.failed, refund.created
  4. Copy the webhook secret and paste it into SnapCart's Razorpay settings

Configuring PayTM

PayTM Configuration PayTM settings page showing Merchant ID, Merchant Key, and environment selection

  1. Go to Payments → PayTM.
  2. Log in to business.paytm.com and go to Developer Settings → API Keys.
  3. Enter in SnapCart:
FieldDescription
Merchant IDYour PayTM merchant identifier (MID)
Merchant KeyYour PayTM secret key
Industry TypeSelect your business category (e.g., Retail)
ModeStaging or Production
  1. Toggle Status to Active.
  2. Click Save.

Testing PayTM

In Staging mode, PayTM provides test credentials from their developer portal. Use the staging merchant ID and key for testing — real transactions will not be processed.


Cash on Delivery (COD)

COD requires no API credentials or external accounts.

COD Settings COD settings showing status toggle and optional COD surcharge field

  1. Go to Payments → Cash on Delivery.
  2. Toggle Status to Active.
  3. Optionally set a COD Surcharge — a fixed amount added to orders paid by COD (e.g., ₹50 handling fee).
  4. Set a Minimum Order Amount below which COD is not available (optional).
  5. Click Save.

:::tip When to use COD COD is popular in markets with low credit card penetration or low online payment trust. However, it increases the risk of failed deliveries and returns. Consider offering COD only above a minimum order value. :::


Transaction Logs

Go to Payments → Transactions to see a detailed log of every payment attempt.

Transaction Logs Transaction log showing order number, gateway, transaction ID, amount, status, and date

ColumnDescription
Order #The order this payment belongs to — click to open the order detail
GatewayPayment provider used
Transaction IDGateway-issued reference identifier
AmountAmount charged in the order's currency
StatusSuccess, Failed, or Pending
DateTimestamp of the payment attempt

Viewing the Full Gateway Response

Click any transaction row to see the raw JSON payload returned by the payment gateway. This is useful for debugging payment failures — the error_description field in the response usually explains exactly why a payment failed.

Common Failure Reasons

ErrorLikely Cause
card_declinedCustomer's bank declined the card — customer should try another card or contact their bank
insufficient_fundsCard has insufficient balance
invalid_cvvCustomer entered the wrong CVV
authentication_failed3D Secure / OTP verification failed
gateway_timeoutTemporary connectivity issue — customer can retry
payment_cancelledCustomer closed the payment modal without completing

Refunds

SnapCart records refund status but does not initiate refunds directly. Refunds must be issued through each gateway's dashboard:

GatewayWhere to Issue Refunds
PayPalPayPal Merchant Dashboard → Activity → Find transaction → Refund
RazorpayRazorpay Dashboard → Transactions → Find transaction → Refund
PayTMPayTM Business Dashboard → Payments → Find transaction → Refund
CODBank transfer or store credit (manual process)

After issuing a refund in the gateway dashboard, update the order status in SnapCart to Refunded so the customer receives a confirmation email.


Switching Between Test and Live Mode

:::warning Always verify before going live Before switching any gateway to Live mode:

  1. Confirm all credentials are the Live (not Sandbox/Test) credentials
  2. Place a small real test transaction
  3. Verify the money appears in your gateway account
  4. Set the status back to Active and notify customers :::

Switching from test to live requires updating the credentials in each gateway's settings page in SnapCart.