I need help in developing an external payment method module.
I have so far already managed to get the method to appear correctly on the admin, and on the checkout page. The next step is to send some of the values gathered in the form through a POST method that I have already set up on a redirect page, after "Place Order"
And this is where I have a problem.
I don't know how to call the values gathered on the form so I can send them on my redirect page to their destination.
That's my current problem. The problem I will have next is setting up a response page that gathers the information received by the external service and acts accordingly.
If I can't bother you to check out all of my code which I link bellow, I'll try to summarize here. I have made a mix of a couple of payment method tutorials, and the default Cc payment method, so there may be a few extra lines I am not requiring. I'm using the exact same form that Cc uses, since I need the exact same values, with the exact same validation (minus a few card types). (I probably should have extended the Cc method, right? I just realized while writing this...)
Form is the same as Cc, so a card number field looks like this:
<label for="<?php echo $_code ?>_cc_number" class="required"><em>*</em><?php echo $this->__('Credit Card Number') ?></label>
<div class="input-box">
<input type="text" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo $this->__('Credit Card Number') ?>" class="input-text validate-cc-number validate-cc-type" value="" />
</div>
The model gathers the data in a method called assign data like this:
public function assignData($data)
{
if (!($data instanceof Varien_Object)) {
$data = new Varien_Object($data);
}
$info = $this->getInfoInstance();
$info->setCcType($data->getCcType())
->setCcOwner($data->getCcOwner())
->setCcLast4(substr($data->getCcNumber(), -4))
->setCcNumber($data->getCcNumber())
->setCcCid($data->getCcCid())
->setCcExpMonth($data->getCcExpMonth())
->setCcExpYear($data->getCcExpYear())
->setCcSsIssue($data->getCcSsIssue())
->setCcSsStartMonth($data->getCcSsStartMonth())
->setCcSsStartYear($data->getCcSsStartYear())
;
return $this;
}
And my redirect method, (which is already being properly called, but with default values) is a bunch of these:
<input type="hidden" value="5111111111111118" name="Card">
I need to be able to take the data from the form and place it in the values on my redirect. I have some ideas gathered from here and there, which involve using checkout session variables, but I'm open to anything.
https://dl.dropbox.com/u/17685301/app.rar
I'm copying my code in this dropbox link if you can be bothered. I am aware I'm mixing from a lot of places here but I think it's mostly ok since Magento tends to die if just one piece is missing from the puzzle.
Yes, I'm a noob, but I'm really trying hard to get the hang of Magento. Thanks in advance.