Announcement

Collapse
No announcement yet.

A big ask

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    A big ask

    I need to add three lines of code to the Perlscript file for our local PSP, which causes the PSP to route back to my second website when either an approval or declined transaction happens, and this overides their internal setting at the PSP. I do not know aything about Perl scripts, and am asking if there is anybody who could assist in the correct syntax.

    The lines that I need to add are as follows:-
    os Commerce=Y
    osApprovedUrl=http://www.cartridgesonline.co.za/cgi-bin/os000001.pl
    osDeclinedUrl=http://www.cartridgesonline.co.za/cgi-bin/os000001.pl

    And the portion of the .pl file that they need to be added to is (I can post the complete .pl if needed:-

    # Required VCS fields
    #
    AddPostValues ('?', 'p1', $sMerchantID, $ALWAYS, $NOENCODE); # TerminalID
    AddPostValues ('&', 'p2', $::sOrderNumber, $ALWAYS, $NOENCODE); # we use ordernumber as Unique Transaction Reference Number
    AddPostValues ('&', 'p3', $$::g_pSetupBlob{COMPANY_NAME}, $ALWAYS, $NOENCODE); # Description of Goods = Company name
    #
    # Calculate the conversion factor for the currency
    #
    my $nFactor = 100;
    my $nNumDigits = $::PriceFormatBlob{"ICURRDIGITS"}; # read the currency format values
    if(defined $nNumDigits)
    {
    $nFactor = (10 ** $nNumDigits);
    }
    my $sCurrencyFormat = sprintf('%%d.%%0%dd', $nNumDigits);
    my $sAmount = sprintf($sCurrencyFormat, $::nOrderTotal / $nFactor,
    $::nOrderTotal % $nFactor);
    AddPostValues ('&', 'p4', $sAmount, $ALWAYS, $NOENCODE); # Transaction Amount
    AddPostValues ('&', 'p5', $::PriceFormatBlob{SINTLSYMBOLS}, $ALWAYS, $NOENCODE); # Currency code
    my $sCancelURL = $::sCallBackURLBack;
    $sCancelURL =~ s/&$//;
    AddPostValues ('&', 'p10', $sCancelURL, $ALWAYS, $NOENCODE); # URL for Cancelled Transactions
    AddPostValues ('&', 'p12', 'y', $ALWAYS, $NOENCODE); # Delayed Settlement requested
    # "I removed this line and replaced it with the one above for delayed settlement" AddPostValues ('&', 'p12', $bAuthorize ? 'N' : 'Y', $ALWAYS, $NOENCODE); # Y->Pre Authorize, N->Immediate Payment
    #
    # Put other paramaters, to be able to create the proper call RecordAuthorisation at the Auhtorisation callback
    #
    AddPostValues ('&', 'm_1', $::sOrderNumber, $ALWAYS, $NOENCODE); # Order number
    AddPostValues ('&', 'm_2', $bTestMode ? '1' : '0', $ALWAYS, $NOENCODE); # Test mode
    AddPostValues ('&', 'm_3', $::sCallBackURLAuth, $ALWAYS, $ENCODE); # Auth URL
    AddPostValues ('&', 'm_4', $::sCallBackURLUser, $ALWAYS, $ENCODE); # Receipt URL
    AddPostValues ('&', 'm_5', md5_hex($sPAM), $ALWAYS, $NOENCODE); # MD% hash of Merchant PAM
    AddPostValues ('&', 'm_6', 'VCSCALL', $ALWAYS, $NOENCODE); # Magic word for identify VCS call
    AddPostValues ('&', 'm_7', $::sCallBackURLBack, $ALWAYS, $ENCODE); # URL for Cancelled Transactions
    AddPostValues ('&', 'm_8', $nFactor, $ALWAYS, $NOENCODE); # URL for Cancelled Transactions
    AddPostValues ('&', 'm_9', $bAuthorize ? 'N' : 'Y', $ALWAYS, $NOENCODE); # Y->Pre Authorize, N->Immediate Payment
    #
    # The previous params must be added in order
    # The hash must be the last param to be added
    Adrian Boshoff
    http://www.servatech.co.za
Working...
X