Paypal-paymentwall

02/17/2015 20:38 rosoares#1
Hello everyone, can someone please explain me how to creat automatic silks charge?
02/17/2015 21:01 ​Exo#2
Google Paypal/Payment wall WebShop Scripts
02/17/2015 23:57 magicanoo#3
1) Create a paymentwall account.
2) Create an application there and name it as you like
3) in the application, set up the rates and currency etc
4) Find a pingback script and put it on your host (pingback's function is to add silks based on the request from paymentwall servers) and put your Secret there
5) Test the pingback on paymentwall itself, if succeeded proceed to the next step
6) Put the widget in your donation page (You'll be given a widget URL to paste inside the webpage code).
7)Profit $$$
02/18/2015 01:17 Aaron*#4
here is the ping back from theta website.

Quote:
<?php
define('SECRET', '676af79b11889ae7614c67b2a2ae54da');
define('CREDIT_TYPE_CHARGEBACK', 2);
$ipsWhitelist = array(
'174.36.92.186',
'174.36.96.66',
'174.36.92.187',
'174.36.92.192',
'174.37.14.28'
);
$userId = isset($_GET['uid']) ? $_GET['uid'] : null;
$credits = isset($_GET['currency']) ? $_GET['currency'] : null;
$type = isset($_GET['type']) ? $_GET['type'] : null;
$refId = isset($_GET['ref']) ? $_GET['ref'] : null;
$signature = isset($_GET['sig']) ? $_GET['sig'] : null;
$result = false;
if (!empty($userId) && !empty($credits) && isset($type) && !empty($refId) && !empty($signature)) {
$signatureParams = array(
'uid' => $userId,
'currency' => $credits,
'type' => $type,
'ref' => $refId
);
$signatureCalculated = generateSignature($signatureParams, SECRET);
if (in_array($_SERVER['REMOTE_ADDR'], $ipsWhitelist) && ($signature == $signatureCalculated)) {
$result = true;
include('../_incl/config.php');
if ($type == CREDIT_TYPE_CHARGEBACK) {
$query = $sql->Query("UPDATE SK_Silk SET silk_own = silk_own + $credits WHERE JID = '$userId'");
$username = $sql->fetcharray($sql->Query("SELECT StrUserID FROM TB_User WHERE JID ='$userId'"));
$username = $username[0];
$query1 = $sql->Query("INSERT INTO _Silk_Log VALUES('$username','$credits',GETDATE())");
} else {
$is_exist = $sql->Query("SELECT * FROM SK_Silk WHERE JID = '$userId'");
$num = $sql->rowcount($is_exist);
if (!$num) {
$query = $sql->Query("INSERT INTO SK_Silk (JID,silk_own,silk_gift,silk_point) VALUES ($userId,$credits,0,0)");
$username = $sql->fetcharray($sql->Query("SELECT StrUserID FROM TB_User WHERE JID ='$userId'"));
$username = $username[0];
$query1 = $sql->Query("INSERT INTO _Silk_Log VALUES('$username','$credits',GETDATE())");
} else {
$query = $sql->Query("UPDATE SK_Silk SET silk_own = silk_own + $credits WHERE JID = '$userId'");
$username = $sql->fetcharray($sql->Query("SELECT StrUserID FROM TB_User WHERE JID ='$userId'"));
$username = $username[0];
$query1 = $sql->Query("INSERT INTO _Silk_Log VALUES('$username','$credits',GETDATE())");
}
}
}
}
if ($result) {
echo 'OK';
}
function generateSignature($params, $secret)
{
$str = '';
foreach ($params as $k => $v) {
$str .= "$k=$v";
}
$str .= $secret;
return md5($str);
}
?>
02/18/2015 21:44 Snow*#5
Better ask someone with PHP knowledge to do it for you. There is a lot of people offering PHP service in here.
02/18/2015 21:53 Aaron*#6
Quote:
Originally Posted by SnowStorm1 View Post
Better ask someone with PHP knowledge to do it for you. There is a lot of people offering PHP service in here.
some ppl are too poor to pay for a php code :D
02/18/2015 22:40 Snow*#7
Quote:
Originally Posted by Aeron* View Post
some ppl are too poor to pay for a php code :D
Better than fuck everything and add a wrong value. Then you will regret that later. I asked a friend of mine to do the pingback and the query in there as well.