Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8480307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:15:36+00:00 2026-06-10T19:15:36+00:00

How do I create an HTML form to allow the user to change their

  • 0

How do I create an HTML form to allow the user to change their iTransact (itransact.com) subscription settings?

Eg: 1) Opt out of automatic subscription renewal:

  • the form needs to change the ‘recur_reps’ value to 0

Eg: 2) Change their subscription type:

  • the form needs to change the values of ‘recur_total’ and ‘recur_desc’

(ie: what is the URL to post the form to and what form fields do I need to post to it?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:15:38+00:00Added an answer on June 10, 2026 at 7:15 pm

    According to an iTransact support technician there is no way to create an HTML form to allow the user to change their iTransact (itransact.com) subscription settings. However, there is an XML API that allows this to be done.

    Since the code to send an XML request to iTransact’s XML API is not simple and intuitive, I decided to post a working sample program to Stack Overflow since it might be useful as a reference to others, especially since their is no example like it in the iTransact.com documentation.

    The following sample program sends a request to get the details of an existing transaction.

    <?php
    
    define('ITRANSACT_API_UPDATE_URL', 'https://secure.itransact.com/cgi-bin/rc/xmltrans2.cgi');
    define('ITRANSACT_API_GATEWAY', '12345'); // vendor account number
    define('ITRANSACT_API_USERNAME', 'fdfsdfksafdsafdsafdsafdsafdsa'); // vendor API username
    define('ITRANSACT_API_KEY', 'fdsfdsafdsafdsfdsfdsfds'); // vendor API key
    
    /**
     * iTransact's XML API requires us to encrypt the XML command with a 
     * special key known only to us and iTransact. This is to ensure that the 
     * request cannot be modified after leaving our server. 
     *
     * A keyed hash value is generated using the HMAC-SHA1 algorithm and then 
     * encoded with base-64 MIME.
     *
     * @param string $strXMLCmd: xml for the command operation
     *
     * @returns string: the base64-encrypted HASH_SHA1 payload Signature 
     *                  for the command
     */
    function getITransactPayloadSignagureForCommand($strXMLCmd){
    
      $key = ITRANSACT_API_KEY;
    
      #Using built in PHP5 functions:
      $digest = hash_hmac('sha1', $strXMLCmd, $key, true);
      $strPayLoadSignature = base64_encode($digest);
    
      #Using PEAR module:
      #require_once 'Crypt/HMAC.php';
      #$hmac = new Crypt_HMAC($key,"sha1");
      #$digest = pack("H40", $hmac->hash(trim($payload)));
      #$actual_signature = base64_encode($digest);
    
      return $strPayLoadSignature;
    }
    
    /** 
     * Constructs the XML request in the iTransact format for the request
     * including login credentials
     *
     * @param string $strXMLCmd: specific xml for the operation command
     */
    function construct_itransact_xml($strXMLCmd){
    
      $strPayLoadSignature = getITransactPayloadSignagureForCommand($strXMLCmd);
    
      $strXML  = '<?xml version="1.0"?>';
      $strXML .= '<GatewayInterface>';
    
      // Login credentials:
    
      $strXML .=   '<APICredentials>';
      $strXML .=     '<Username>'.ITRANSACT_API_USERNAME.'</Username>';
      $strXML .=     '<PayloadSignature>'.$strPayLoadSignature.'</PayloadSignature>';
      $strXML .=     '<TargetGateway>'.ITRANSACT_API_GATEWAY.'</TargetGateway>';
      $strXML .=   '</APICredentials>';
    
      $strXML .=   $strXMLCmd; // Unique part of every command
    
      $strXML .= '</GatewayInterface>';
    
      return $strXML;
    }
    
    /**
     * Sends an XML request to iTransact.
     *
     * @param string $xml: the XML to send to iTransact
     *
     * @returns string: the XML responde from iTransact
     */
    function post_xml_to_iTransact($xml) {
    
      $url = ITRANSACT_API_UPDATE_URL;
    
      $ch = curl_init();
    
      curl_setopt($ch, CURLOPT_URL, $url);
      curl_setopt($ch, CURLOPT_HEADER, true);
      curl_setopt($ch, CURLINFO_HEADER_OUT, true);
      curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml; charset=utf-8"));
      curl_setopt($ch, CURLOPT_POST, 0);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    
      $result = curl_exec($ch);
      $info = curl_getinfo($ch);
    
      curl_close($ch);
    
      return $result;
    }
    
    // *** MAIN ***
    
    // construct XML command:
    
    $strXID = '12345'; // transaction_id we wish to get details of
    $strXMLCmd = '<RecurDetails><OperationXID>'.$strXID.'</OperationXID></RecurDetails>'; // command we wish to send
    $strXML = construct_itransact_xml($strXMLCmd); 
    
    // send XML command:
    
    $strReturnedXML = post_xml_to_iTransact($strXML); // send request and fetch result
    echo 'Response XML from iTransact: '.var_export(htmlspecialchars($strReturnedXML), TRUE);
    
    ?>
    

    Note: Requests to update/cancel an existing recurring subscription would have a similar format but would use the “recurUpdate” command instead of the “recurDetails” command (for full details of all possible commands see: http://www.itransact.com/downloads/PCDeveloperGuide.pdf)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a multiple select HTML form input to allow a user to pick
I want to create a web form which will allow the user to upload
For my html form, it seems that I'm unable to create cross browser hover
How can I create a helper like the Html.Form helper, which closes the tag
I'd like to be able to create a javascript object from my html form
i have create a form (so it's PHP and HTML hybrid-code). it has ability
I think its easy to create form via only html and do not use
I'm trying to create a web application that will allow a user to post
I am attempting to allow the user to press a button create a new
this is the code: def create(request, form_class=MapForm, template_name=maps/create.html): map_form = form_class(request.POST or None) if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.