Jump to content

Search the Community

Showing results for tags 'whmcs'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. I had successfully set up and integrated a third party payment integration system on WHMCS. Inorder to Validate callback authenticity, the gateway provides a method of verifying that a callback originated from them as shown in code below: $mertid ='secretmerchantID'; $amt = '10000'; $tranxid = 'gtPay130958397220820'; $hashkey ='secretclientkey'; $hash = hash('sha512', $mertid . $tranxid . $hashkey); $url = 'https://ibank.gtbank.com/GTPayService/gettransactionstatus.xml?mertid='.$mertid.'&amount='.$amt.'&tranxid='.$tranxid.'&hash='.$hash; $xmlString = file_get_contents($url); if($xmlString === false) { echo "Response Description: GTPAY Verification service failed to open. } else { $xml = simplexml_load_string($xmlString ); var_dump($xml); } I am using the file_get_contents function to read the API response into a string, then simplexml_load_string function to Interprets the string of XML into an object with properties containing the data held within the xml string. On each successful transaction run $xml=simplexml_load_string($jString), returns FALSE. However when I call this code in a file directly in a browser on WAMP using the same transaction values, then $xml=simplexml_load_string($jString), returns the string of XML into an object as expected. Also when I place the file on a different remote host and call it in browser, it also returns the string of XML into an object. Strangely, when I place this code in a file within the WHMCS root folder and I attempt to call directly in a browser using the same successful transaction values used above, then $xml=simplexml_load_string($jString), returns FALSE again. What may be restricting this call to the Third party API call within the WHMCS install? Thanks.
  2. I wish to redirect to a custom page following the failure in payment as returned by payment gateway. To this end, I am using the ShoppingCartCheckoutCompletePage hook to check this using the variable $vars['ispaid']. When payment is successful, $vars['ispaid'] is true and the redirect to the thankyou page works. add_hook('ShoppingCartCheckoutCompletePage', 1, function ($vars) { # Will be true if the order has been paid if($vars['ispaid'] == true) { #redirect to thank you page header('location:'.thankYouPage); die; } else { header('location:'.transactionFailedPage); die; } } However the else statement is not executing when payment obviously fails, rather the viewinvoice.php page is loaded and payment status set to 'unpaid' Am I missing something? How can I redirect to the transaction failed page?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.