Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Member mikaelsnavy's Avatar
    Join Date
    Jun 2005
    Location
    Oregon
    Posts
    48
    Member #
    10358
    Hello, Could someone help me convert this VBScript into php?
    Here's the script:


    set objXML=createobject("MSXML2.XMLHTTP")

    objXML.Open "POST", "https://paytrace.com/api/default.pay", false
    objXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"


    posteddata="parmList=un~demo|pswd~demo|method~proc esstranx|tranxtype~sale|terms~Y|test~Y|"
    posteddata=posteddata & "CC~4012881888818888|expmnth~12|expyr~03|amount~1. 00|baddress~1234 Main#3|"


    objXML.Send posteddata

    str = objXML.ResponseText


    set objXML = nothing



    MsgBox str



    Thanks A Lot,
    Mikael

  2.  

  3. #2
    Senior Member Fallout's Avatar
    Join Date
    Aug 2003
    Location
    Richmond, Virginia
    Posts
    543
    Member #
    2748
    Could you tell us what it is supposed to do for those of us who don't know VB but do know PHP?

  4. #3
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,657
    Member #
    1234
    Liked
    137 times
    What is PayTrace? - PayTrace is a payment processing service provider that relays credit card transactions from our merchants to their customer's credit card issuers. Our payment processing software was built by payment industry experts to accomodate our merchant's needs with three core concepts in mind...
    Based upon that and reading the code, I'd say it takes CC payment info and sends it somewhere.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  5. #4
    Junior Member
    Join Date
    Sep 2005
    Posts
    3
    Member #
    11292
    PHP Code Sample of PayTrace API implementation

    Hi Mikael -

    Please try the following code sample that is written in PHP. This code sample may be found on page 69 of the PayTrace API XML user manual.

    ----------------------

    <?php

    $parmlist = "parmList=un~demo|pswd~demo|method~processtranx|tr anxtype~sale|terms~Y|test~Y|";
    $parmlist .= "CC~4012881888818888|expmnth~12|expyr~03|amount~1. 00|baddress~1234 Main#3|";
    $header = array("MIME-Version: 1.0","Content-type: application/x-www-form-urlencoded","Contenttransfer-
    encoding: text");
    $url = "https://paytrace.com/api/default.pay";
    $ch = curl_init();
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $myHeader);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $parmlist);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    // grab URL and pass it to the browser
    $response = curl_exec($ch);
    // close curl resource, and free up system resources
    curl_close($ch);
    $responseArr = explode('|', $response);
    foreach ($responseArr as $pair ){
    $tmp = explode('~',$pair);
    $vars[$tmp[0]] = $tmp[1];
    }
    print "Response:<br><table border=1>";
    foreach($vars as $key => $value){
    print "<tr><td>$key</td><td>$value</td></tr>";
    }
    print "</table>";

    ?>

    ----------------------


    Quote Originally Posted by mikaelsnavy
    Hello, Could someone help me convert this VBScript into php?
    Here's the script:


    set objXML=createobject("MSXML2.XMLHTTP")

    objXML.Open "POST", "https://paytrace.com/api/default.pay", false
    objXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"


    posteddata="parmList=un~demo|pswd~demo|method~proc esstranx|tranxtype~sale|terms~Y|test~Y|"
    posteddata=posteddata & "CC~4012881888818888|expmnth~12|expyr~03|amount~1. 00|baddress~1234 Main#3|"


    objXML.Send posteddata

    str = objXML.ResponseText


    set objXML = nothing



    MsgBox str



    Thanks A Lot,
    Mikael

  6. #5
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Welcome onboard PayTrace.

    I assume you are one of the team that wrote, or supports, that particular package?

    It's great for the forum to have folks here with your sort of specialist knowledge :-)

    Sean

  7. #6
    Junior Member
    Join Date
    Sep 2005
    Posts
    3
    Member #
    11292
    What is PayTrace?

    It is great to be onboard, and I appreciate your kind welcome.

    PayTrace is payment processing software that helps developers and merchants add credit card processing functionality to their software applications.

    We offer a virtual terminal with recurring billing and import/upload functionality, a standard shopping cart, and an API that is the most powerful processing method for merchants and developers with software development experience. The API has method such as ProcessTransaction, EmailReceipt, CreateCustomer, ModifyCustomer, CalculateShipping, etc. that help add e-Commerce functionality to your applications.

    The code sample provided originally in VBScript and then is PHP illustrates how to process a test transaction through the PayTrace API.

    If you would like more information about PayTrace, please visit https://PayTrace.com or send a message to Support@PayTrace.com

    Regards,
    PayTrace Support

  8. #7
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Advertising for commercial gain, is strictly prohibited here!

    However, if you care to stay and share your knowledge, you most heartily welcome!
    S. Rosland

  9. #8
    Junior Member
    Join Date
    Sep 2005
    Posts
    3
    Member #
    11292
    The intention of the my last post was not for commercial gain. The explaination of PayTrace's services and function of the code sample was in response to the posts left by Wired and Fallout.

    My apologies if it was interpreted as a commercial.

    PayTrace Support

    Quote Originally Posted by rosland
    Advertising for commercial gain, is strictly prohibited here!

    However, if you care to stay and share your knowledge, you most heartily welcome!

  10. #9
    Member mikaelsnavy's Avatar
    Join Date
    Jun 2005
    Location
    Oregon
    Posts
    48
    Member #
    10358
    Wow, thanks, I got the Wrong manual verson, mine only has 48 Pages.
    Thanks SOOOOOOOOOOOOOO mich for your help,
    Mikael


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:10 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com