The project is straightforward, I need someone who can rewrite and test this script from PHP into Classic ASP. This script is needed on my website to create a payment with this 3rd party payment service provider. They don't have this pluging-code script available in classic ASP so I need someone who can write this for me. The rest of the project I can do myself. This PHP script is a 100% working script (I have tested myself), but because of security reasons I have hidden the API key and email address in this stage. When accepting this project please let me know that you have read this by using the word `apple` in your response. It cannot cost more than $100 as it will me no more work than 2 hours for an experienced programmer. Thank you.
<?php
$api = new PayProApi('YOU-GET-THIS-KEY-AFTER-ACCEPTING-PROJECT'); // The real API key you will get after we agreed about the project
$api->command = 'create_product_payment';
$api->set_param('product_id', '88340');
$api->set_param('consumer_email', 'type-here-a-real-email-address');
$api->set_param('psp_code', '0021');
$api->set_param('test_mode', 'true'); // Remove this when testing is done!
$returned = $api->execute();
echo $returned['return']['payment_url'];
header('Location: ' . $returned['return']['payment_url']);
class PayProApi {
var $command;
var $params = array();
var $apikey;
function __construct($apikey, $command=null, $params=null) {
$this->apikey = $apikey;
$this->command = $command;
if (is_array($params)) {
$this->params = $params;
}
}
function execute() {
$data_to_post = array(
"apikey" => $this->apikey,
"command" => $this->command,
"params" => json_encode($this->params)
);
$url = '[login to view URL]';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_to_post);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
$params = array();
return $response;
}
function set_param($param, $value) {
$this->params[$param] = $value;
}
}
?>