Is there a way to pass a custom variable and value to the payment gateway, (in my case AuthorizeNet), which is then passed back to the order_final page when the payment is complete? I'd like to have users purchase memberships, and upon successful payment, the users ID is identified and I can have the order_final page update the database, so I'd like to be able to recieve the userID of the new member on successful payment.
Last modified: 7 Feb 2007 3:56 PM
dancingPaul
25 Jan 2007 9:43 PM
... to ammend on that statement above...I found out where I can pass custom variables in the payment systems => parameters list, so now my only questions left is where would I edit the code so that the value of some of those parameters is determined by some script that I write (perhaps reading a session variable or getting a value from a a database)
charleshays
26 Jan 2007 7:55 AM
I'll try and tackle this but a CSR maybe more appropriate to answer this.
In your custom Payment System there is a field called "Payment URL *" name this like my_payment_script.php or whatever. It will look for this script in /payments.
Now you can add to that script this to start with:
--------------------------------------------------------------------
<?
foreach ($payment_parameters as $parameter_name => $parameter_value)
{
if(isset($pass_parameters[$parameter_name]) && $pass_parameters[$parameter_name] == 1)
{
$pass_data[$parameter_name] = trim($parameter_value);
echo '<LI>'.$parameter_name.'='.$parameter_value
}
}
That will crete the associated array $pass_data and you can verify all the variables being sent to that script. Write whatever checking and error handling you need there. Might look at some of the other payment scripts in the /payment directory for how things work as there really isn't any docs on this.
Anjula
31 Jan 2007 1:12 PM
Hi,
If you use Authorize.net SIM method integration then you can add your code into 'payments/authorize_check.php' script. For Authorize.net AIM method you need to create a similar to the above script and add it to 'Final Checkout Settings' of this payment system.
If a user was logged in while submitting an order then the information about his id can be obtain from the session by using the following code get_session("session_user_id")
Regards,
ViArt Support Team
dancingPaul
7 Feb 2007 3:56 PM
Thanks Anjula, that almost worked for me, but it put me on the right path to find a solution. For the sake of archival purposes, I'll post what I did that worked.
in payment.php, I found a array named "$variables", I added all of the custom variables I wanted to pass through the store to this array. and since it's a php page, I could use any sort of logic I wanted to get values for these variables.
then, in the shopping cart admin under payment systems => authorize.net => payment systems, I added those same variables I added to payment.php to the parameters list, with a parameter type of "variable"
this allowed my custom variables to be passed into the payment gateway with an order, and sent back upon successful payment completion. yay.