I use webform as my return URL from Amazon Payments to collect additional order data from customer once their payment is pre-authorized. Once user fills out webform, I am trying to redirect them to a page according to a payment status code that I received back from Amazon Payments site. Payment status is filling in properly to a field named "payment_status" using get from Amazon URL querystring. The payment stauts field is a hidden field with a system name of "payment_status".
Once user completes form and submits, I am having trouble creating a variable redirect URL that appends the payment status code to the end of the URL.
I am using a two letter code "PR" as an example below that points to a page on my site "../payments/pr". This way, I can take user to a different page for every possible payment code received from Amazon. I am not a coder, but have placed the following snippet in the additional processing window.
<?php
$status = $form_values['submitted_tree']['payment_status'];
$node->webform['confirmation'] = url('payments/', array('query' => 'var=' . $status, 'absolute' => TRUE));
?>
I have tested the code with a manually entered field value also, but URL is still missing variable. What am I doing wrong?
Comments
Comment #1
mdayton CreditAttribution: mdayton commentedI originally posted this to an older issue that was related, but was an older post left active. http://drupal.org/node/343929
Comment #2
mdayton CreditAttribution: mdayton commentedanyone?...anyone?...Bueller?....anyone?...
Comment #3
marcus_gbs CreditAttribution: marcus_gbs commentedI needed to do something similar and it took a bit of hacking around to find something that worked. I could not find any way to reference form data within the redirect section. I also had issues accessing form data in the additional processing section. I finally could find something that worked from additional validation.
I use a fully-qualified url (http://xxx.xxx.com/content/page-name) that is generated using the $base_url global and appending a path to it.
In additional validation, try something like:
Then, in the redirect URL section:
Comment #4
quicksketchSupport for writing custom code is no longer provided in the Webform issue queue.