Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
use Win32::OLE; ################################################################### # Create a SecureTrading Object using Win32::OLE $stm = Win32::OLE->new ("SecureTrading.STMerchant") || die "CreateObje +ct: $!"; # create ST object my %Result; # SecureTrading Response Codes $Result{authorised} = 1; # ... $Result{declined} = 2; # ... $Result{error} = 3; # ... $Result{other} = 4; # ... $stroot = "."; # Path to certificate files ################################################################### # SecureTrading merchant reference for this site $stm->{SiteReference} = "T16002"; ################################################################### # SecureTrading certificate files $stm->{CertificateFile} = "$stroot/pem/xyzcotestcert.pem"; $stm->{PrivateKeyFile} = "$stroot/pem/xyzcotestkey.pem"; $stm->{ServerCAFile} = "$stroot/pem/testserverca.pem"; $stm->{GatewaysFile} = "$stroot/testgateways.txt"; ################################################################### # Open Connection $stm->Open(); ################################################################### # Transaction information $stm->{TransactionType} = "AUTHORIZE"; $stm->{CardType} = "VISA"; # Use this number for rejection = "4242 4242 4242 4242" $stm->{CardNumber} = "4111 1111 1111 1111"; $stm->{ExpiryDate} = "02/99"; $stm->{IssueNumber} = "0"; $stm->{Amount} = "1500"; $stm->{Currency} = "GPB"; ################################################################### # Settlement Information $stm->{SettleNow} = 1; ################################################################### # CardHolder Information $stm->{CardHolderPresent} = 1; $stm->{CardHolderEmail} = "test\@test.com"; $stm->{CardHolderCountry} = "UK"; $stm->{CardHolderAddress} = "A test address; somewhere; here;"; $stm->{CardHolderTelephone} = "01233 456 789"; $stm->{CardHolderName} = "Ted tester"; ################################################################### # Internet information about card holder $stm->{CardHolderIp} = $ENV{'REMOTE_IP'}; $stm->{CardHolderBrowser} = $ENV{'BROWSER'}; ################################################################### # Merchant information about order $stm->{MerchantOrderReference} = "TEST-0001#a"; $stm->{MerchantOrderInfo} = "A test transaction"; ################################################################### # Create the STMerchant details print "Creating Transation...\n"; $stm->Create(); ################################################################### # Send Transaction print "Sending Transation...\n"; $stm->Send(); print "Transaction Sent.\n\n"; ################################################################### # Display results print "**** RESULT ****\n"; print "Reference Number: ", $stm->{ReferenceNumber}, "\n"; if ($stm->{result} == $Result{authorised}) { print "Transaction: Authorized\n"; print "Auth Code: ", $stm->{AuthCode}, "\n"; print "Confidence Rating: ", $stm->{ConfidenceRating}, "\n" +; } elsif ($stm->{result} == $Result{declined}) { print "Transaction: Declined\n"; } elsif ($stm->{result} == $Result{error}) { print "There was an error in authorizing the transaction\n"; print "Error : ", $stm->{Error}, "\n"; } else { print "There was an unknown error!!\n"; } ################################################################### # Close the connection to the SecureTrading Module $stm->Close($stm);

In reply to SecureTrading COM by $code or die

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (15)
    As of 2015-07-29 12:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (263 votes), past polls