Merchant key error

This topic contains 14 replies, has 3 voices, and was last updated by  Kiran 6 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #377353

    Miguel Carneiro
    Free User
    Post count: 34

    Hi,

    I keep getting merchant key error (sandbox mode) since the core plugin update.
    And signature error (live) since the update of the core plugin.
    I double checked and my plugins are still current versions.

    How can I fix this, This is really time sensitive..

    #377359

    Miguel Carneiro
    Free User
    Post count: 34

    if I use the standard settings for testing “sbtm02@payfast.co.za ” in sandbox its perfect.
    Not in live, it gives merchant_key invalid.

    When I switch to any one of my accounts then the MerchantKey error happens in test and signature error in live

    #377360

    Miguel Carneiro
    Free User
    Post count: 34
    This reply has been marked as private.
    #377367

    Miguel Carneiro
    Free User
    Post count: 34
    This reply has been marked as private.
    #377368

    Miguel Carneiro
    Free User
    Post count: 34

    also , fix spelling on line 112 … If you have a pass phrase set in your PyaFast

    #377384

    Miguel Carneiro
    Free User
    Post count: 34
    This reply has been marked as private.
    #377436

    Paolo
    Site Admin
    Post count: 31206

    hi,

    I alerted the developers.

    Thanks for your patience…

    #377537

    Miguel Carneiro
    Free User
    Post count: 34

    Found another error in your output string..

    …..pid%3D914¬ify_url=http%3A%2F%2Fwww……..

    &notify_url != ¬ify_url

    Md5 signature will fail in the array as its calculating falsely

    This sample is echoed out at line 300 after

    $data['signature'] = md5( $getString );
    #377546

    Miguel Carneiro
    Free User
    Post count: 34

    error confirmed at line 289

    $pfOutput .= $key .'='. urlencode( trim( $val ) ) .'&';

    “&not” is being replaced with “¬”

    separating the functions didn’t help and gave same results…

    I then remembered that in some browsers the html parser needs proper validation.

    Please change lines 284 – 295 with my updated code

    OLD:

    
    
       $pfOutput ='';
        foreach( $data as $key => $val )
        {
            if(!empty($val))
            {
                $pfOutput .= $key .'='. urlencode( trim( $val ) ) .'&';
            }
        }
        // Remove last ampersand
        $getString = substr( $pfOutput, 0, -1 );

    With this new code:

    
    
       $pfOutput ='';
        foreach( $data as $key => $val )
        {
            if(!empty($val))
            {
                $pfOutput .= $key .'='. urlencode( trim( $val ) ) .'&amp';
            }
        }
        
        // Remove last ampersand
        $getString = substr( $pfOutput, 0, -4 );

    Now I’ll work on this Merchant_key issue …

    #377550

    Kiran
    Moderator
    Post count: 7069

    Hi Miguel,

    I have tested your live PayFast account details in my live test site & localhost site. At both places it successfully takes me to the login page at PayFast without “signature” problem.

    Please check Pass Phrase value at PayFast account. If at PayFast site Pass Phrase is empty then no worry, but if you have set Pass Phrase then it must be saved at GeoDirectory PayFast plugin settings.

    Let us provide FTP details we can look into more.

    Thanks,
    Kiran

    #377557

    Miguel Carneiro
    Free User
    Post count: 34
    This reply has been marked as private.
    #377563

    Miguel Carneiro
    Free User
    Post count: 34

    double confirmed, if I comment out the md5 you are producing then I can transact normally.
    it is an optional variable, hence the test working
    ..

    oops , I see someone is on.. I’ll stop editing..

    I just reverted my edits for you

    #377568

    Kiran
    Moderator
    Post count: 7069

    Hi Miguel,

    Please check and let us know.
    FYI: Currently your live PayFast account details set at GeoDirectory PayFast plugin payment settings.

    Thanks,
    Kiran

    #377577

    Miguel Carneiro
    Free User
    Post count: 34

    confirmed..

    may I ask, what was wrong ?
    I see the code is different but haven’t gone into it.

    #377584

    Kiran
    Moderator
    Post count: 7069

    There are few changes at line no. 312, 428 & 498 related to CURL & PayFast pass phrase.

    Kiran

Viewing 15 posts - 1 through 15 (of 15 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket