ASP.NET Web Application
Posted: April 27th, 2014, 8:17 pm
Hello and Thank you for this wonderful tool that is Phalanger. My project is in Webforms and I have some php code I want to use with C#. I installed Phalanger with the setup, created a phalanger library class named PayPlugLibrary which content is :
I referenced the ddl in my project, imported the namespaces in my code
When I try to create an object
I need those functions to process information for a third party website. I have had a hard time trying to rewrite these functions in C#, I couldn't. I am not familiar with PHP.
May be I am doing this wrong ? I need to send information to those functions and get returned values. Please Help !
- Code: Select all
<?php
namespace PayPlugLibrary {
class PayPlug {
public function __construct() {
}
public function PayPlug()
{
}
function build_data_params($amount, $currency, $ipn_url)
{
$params = array('amount'=>$amount, 'currency'=>$currency, 'ipn_url'=>$ipn_url);
$data_params = http_build_query($params);
return $data_params;
}
function generate_signature($value, $private_key)
{
$privatekey = openssl_pkey_get_private($private_key);
openssl_sign($url_params, $signature, $privatekey, OPENSSL_ALGO_SHA1);
$signature = urlencode(base64_encode($signature));
return $signature;
}
}
}
?>
I referenced the ddl in my project, imported the namespaces in my code
- Code: Select all
using PHP.Core;
using PHP.Library;
using PayPlugLibrary;
When I try to create an object
- Code: Select all
PayPlug PP = new PayPlug();
I need those functions to process information for a third party website. I have had a hard time trying to rewrite these functions in C#, I couldn't. I am not familiar with PHP.
May be I am doing this wrong ? I need to send information to those functions and get returned values. Please Help !