Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5934077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:03:48+00:00 2026-05-22T15:03:48+00:00

How to get customers data so i can pass it to a gateway payment.

  • 0

How to get customers data so i can pass it to a gateway payment.

Here is my model:

public function getStandardCheckoutFormFields() {
        $orderIncrementId = $this->getCheckout()->getLastRealOrderId();
        $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
        //$order = $this->get_sale_order($orderIncrementId);
        echo Mage::getModel('customer/customer')->load($orderIncrementId);

        $productArray = array();

        foreach ($order->getAllItems() as $item) {
            $productArray[] = array(
                "product_name"  => $item->getName(),
                "product_qty"   => $item->getQtyOrdered(),
                "product_price" => $item->getPrice(),
            );
        }
        return $productArray;
    }

here is my controller:

public function redirectAction(){
        $session = Mage::getSingleton('checkout/session');
        $session->setAsurepayCustompayQuoteId($session->getQuoteId());
        $this->getResponse()->setBody($this->getLayout()->createBlock('custompay/redirect')->toHtml());
        $session->unsQuoteId();
        $session->unsRedirectUrl();
    }

This are running perfectly running, the problem is i can’t get customer details such as customer name, address and etc.

I already tried this code

Mage::getSingleton(customer/customer)->getData();

There was a result but not printing.

In the checkout page success (onepage). When customer redirected here, There is no email will be send to the customer and the order was not update as completed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:03:48+00:00Added an answer on May 22, 2026 at 3:03 pm

    You’re trying to load a customer with an id that belongs to the order. This obviously doesn’t work! You need to extract the customer_id from the order and load the customer model based on that.

    $order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
    $customer = Mage::getModel('customer/customer')->load($order->getCustomerId());
    

    You’re also using Mage::getSingleton which is the wrong call. You want a new instance tailored to a specific customer, not the single permissible instance of the class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can not get logs from some customers, can I use Google Urchin in
I'd like to get a better idea of what domains my customers are using.
How can I get all products from customers1 and customers2 include their customer names?
I am trying to get do this: <?php $good_customer = 0; $q = mysql_query(SELECT
public class Address { public string ZipCode {get; set;} } public class Customer {
Ok, I usually do this in reverse, post a specific data set, then expect
Under a tight deadline and I know I can figure this out eventually but
I have tried many ways of executing this but its not happening .. here
This may be a doozy, but does anyone have an idea how to: Pass
I have implemented an application to get the data from local mobile SQLite db

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.