Magento process credit card with PayPal without redirect to PayPal

Magento process credit card with PayPal without redirect to PayPal

September 28, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento process credit card with PayPal without redirect to PayPal

Processing Credit Card Payments with PayPal Pro: A Direct Integration Guide

In today’s e-commerce landscape, providing a seamless checkout experience is crucial for converting visitors into customers. One common requirement is to process credit card payments directly on your store without redirecting users to the payment gateway itself. In this post, we’ll guide you through integrating PayPal Pro with Magento 1.4.2 to achieve exactly that.

Understanding Direct Credit Card Processing

Before diving into the technical implementation, let’s clarify what direct credit card processing entails. Essentially, you’re capturing sensitive card data directly on your website using a secure payment form. The form then communicates this information securely to PayPal Pro via API calls, and the response is displayed back to the user without requiring them to leave your site.

PayPal Pro: A Brief Overview

PayPal Pro (also known as Express Checkout) offers a variety of integration options, including the ability to process payments directly on your website. It supports both card-not-present transactions (using PayPal’s Smart Buttons) and direct credit card processing via API calls.

Key Features:

  • Supports all major credit cards
  • Provides fraud protection through PayPal’s risk management systems
  • Offers a unified checkout experience across various devices

Integrating PayPal Pro with Magento 1.4.2: Step-by-Step Guide

To integrate PayPal Pro directly into your Magento store, you’ll need to follow these steps:

Step 1: Enable the PayPal Payment Method

  1. Log in to your Magento admin panel.
  2. Navigate to System > Configuration.
  3. Under the Sales section, select Payment Methods.
  4. Find PayPal Standard, and click on Configure.
  5. Set Enable PayPal Standard to Yes.
  6. Fill in your PayPal API credentials (you can obtain these from your PayPal account).

Step 2: Customize the Checkout Process

To process payments directly without redirection, you’ll need to make some modifications to Magento’s checkout process.

  1. Open your theme files located at app/design/frontend/[package]/[theme]/template/checkout/onepage/payment.phtml.
  2. Find the section where the payment methods are rendered and replace it with a custom form that captures credit card information securely using HTTPS.
  3. Create an AJAX endpoint (e.g., /paypal-pro-direct-processing) to handle the API calls.

Step 3: Implement the PayPal Pro API Calls

For the direct processing, you’ll use PayPal’s NVP (Name-Value Pair) API. You can find detailed documentation and examples in the PayPal Developer Center.

Here’s a simplified example of how to initiate a transaction using cURL:

$paypal_url = "https://api-3t.paypal.com/nvp";
$paypal_api_username = "your_paypal_api_username";
$paypal_api_password = "your_paypal_api_password";
$paypal_api_signature = "your_paypal_api_signature";

$request = array(
    'USER' => $paypal_api_username,
    'PWD' => $paypal_api_password,
    'SIGNATURE' => $paypal_api_signature,
    'VERSION' => '94.0',
    'METHOD' => 'DoDirectPayment',
    'PAYMENTACTION' => 'SALE',
    'AMT' => '10.00',
    'CREDITCARDTYPE' => 'Visa',
    'ACCT' => '4111111111111111',
    'EXPDATE' => '2025-12',
    'CVVNUM' => '123456789',
);

// Initialize cURL
$ch = curl_init();

// Set the URL and options
curl_setopt($ch, CURLOPT_URL, $paypal_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($request));

// Execute the request
$response = curl_exec($ch);

// Check for errors
if (curl_errno($ch)) {
    error_log('Error: ' . curl_error($ch));
}

// Close cURL
curl_close($ch);

Security Considerations

When processing credit card data directly on your website, it’s crucial to follow all security best practices:

  1. Use HTTPS: All communication between your server and the client should be encrypted via SSL/TLS.
  2. Tokenize Sensitive Data: Whenever possible, use tokenization services provided by PayPal or other third-party vendors to avoid storing raw credit card data on your servers.
  3. Comply with PCI-DSS Standards: Ensure your system adheres to all Payment Card Industry Data Security Standard requirements.

Conclusion

Directly processing credit card payments using PayPal Pro in Magento 1.4.2 is indeed possible, but it requires a solid understanding of both Magento’s checkout process and PayPal’s API.

Remember that implementing this functionality correctly involves handling sensitive data securely and complying with all relevant regulations, including PCI-DSS and local data protection laws.

At Laravel Company, we specialize in helping businesses like yours optimize their e-commerce workflows. If you find the process too complex or need additional support, don’t hesitate to reach out to our team of experts for a consultation.

With the right implementation, you can provide your customers with a seamless, secure, and convenient checkout experience that keeps them engaged within your brand throughout the purchasing process.

Magento 1 Checkout API Themes

Our network