Forums

Custom code and php

paulsmithx 03 Feb, 2012
Hi there,
In my payment processor I'm trying to have it execute some code on success as per the stub in authorize.net

As I couldn't get this working the way I expected it to I've added some new sections to the ctp to allow execution there by copying the code from the custom actions ctp and modifying the names and then writing the code as follows in the php:

// ####################
if ($this->events['declined'] === 1)
{
echo $params->get('ondeclined');
}
// ####################

The problem is that any php in ondeclined seems to be removed from the output.

Is this by design or am I missing something.

Are these kinds of things covered in the cookbook?
Thanks
Paul
GreyHead 03 Feb, 2012
Hi Paul,

Starting at the end, no it's not in the CookBook :-( That predates CFv4 and this kind of action.

I'm not quite clear what you are doing here - or what you are trying to achieve. If you want to send me your action I'll take a look and may be able to give a more useful answer.

Can you do 'it' by dragging a Custom Code action into the On Declined event?

Bob
paulsmithx 06 Feb, 2012
Hi Bob,
I had a flash of inspiration and resolved most every problem I was having, by doing just what you had suggested i.e. dragging the handler to onDeclined.

However the problem persists.

Here is the entire code:


<p> Your transaction was declined. The response from our payment processor is:</p>

<?php
if ($this->events['declined'] === 1)
{
echo $params->get('ondeclined');
}
?>


I set the events array to declined on declined response from the bank, and set the params value to the actual response received.
Regards,
Paul
This topic is locked and no more replies can be posted.