views:

30

answers:

1

Ok. This is getting a little frustrating. I am trying to create a custom payment module for Magento. The purpose is to use Authorize.net's CIM so that we don't have to worry so much about PCI compliance. The issue I am having is that the users need to be able to access their previous credit cards and use those for purchasing. I have the previous cards being stored in the database. They are also being displayed in the form in the checkout process.

My issue comes when I click continue after selecting the payment method. How do I get the values I submitted in the form? Specifically, the value of the radio button the saved code is attached to?

I am not sure what if any code is needed for me to post, so let me know if you need anything in particular.

Thanks.

A: 

Looking at the onepage checkout, payment data is retrieved from the payment[] form elements on the checkout page like this:

$data = $this->getRequest()->getPost('payment', array());
$result = $this->getOnepage()->savePayment($data);

That info gets saved into an actual payment using:

$payment->importData($data);

That means that fields imported this way should be available to your module's authorize() method, at which point you can go retrieve the right information to do the auth.

I hope that made sense. If not, post the HTML for the form as well as your authorize() method in the module.

Thanks, Joe

Joseph Mastey