GuyiGooG Posted April 14, 2012 Posted April 14, 2012 hello, i want to add a new payment option of this site: http://www.paymentwall.com/ a phone payment to the donator how can i do it ? Quote
Lithium Posted April 15, 2012 Posted April 15, 2012 Check their API for payment transactions, they ought to have something on their website... Quote
rulerofzu Posted April 15, 2012 Posted April 15, 2012 Looks fairly simple if you look at their API sample script. <?phpdefine('SECRET', 'd9bee051cfe5613c6a2ddb513ad52fd9'); 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); // check if IP is in whitelist and if signature matches if (in_array($_SERVER['REMOTE_ADDR'], $ipsWhitelist) && ($signature == $signatureCalculated)) { $result = true; if ($type == CREDIT_TYPE_CHARGEBACK) { // Deduct credits from user // This is optional, but we recommend this type of crediting to be implemented as well // Note that currency amount sent for chargeback is negative, e.g. -5, so be caferul about the sign // Don’t deduct negative number, otherwise user will get credits instead of losing them } else { // Give credits to user } } } if ($result) { echo 'OK'; } function generateSignature($params, $secret) { $str = ''; foreach ($params as $k=>$v) { $str .= "$k=$v"; } $str .= $secret; return md5($str); } Quote
GuyiGooG Posted April 15, 2012 Author Posted April 15, 2012 Looks fairly simple if you look at their API sample script. <?phpdefine('SECRET', 'd9bee051cfe5613c6a2ddb513ad52fd9'); 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); // check if IP is in whitelist and if signature matches if (in_array($_SERVER['REMOTE_ADDR'], $ipsWhitelist) && ($signature == $signatureCalculated)) { $result = true; if ($type == CREDIT_TYPE_CHARGEBACK) { // Deduct credits from user // This is optional, but we recommend this type of crediting to be implemented as well // Note that currency amount sent for chargeback is negative, e.g. -5, so be caferul about the sign // Don’t deduct negative number, otherwise user will get credits instead of losing them } else { // Give credits to user } } } if ($result) { echo 'OK'; } function generateSignature($params, $secret) { $str = ''; foreach ($params as $k=>$v) { $str .= "$k=$v"; } $str .= $secret; return md5($str); } But who i do it ? Quote
rulerofzu Posted April 15, 2012 Posted April 15, 2012 Well sorry but not going to do it for you. If you wish to pay for it to be done ill charge $50. Quote
GuyiGooG Posted April 15, 2012 Author Posted April 15, 2012 Well sorry but not going to do it for you. If you wish to pay for it to be done ill charge $50. Sorry, can not pay. Would love if you add more information and an explanation of how to do it, I will work out. Quote
Jordan Palmer Posted April 15, 2012 Posted April 15, 2012 Sorry, can not pay. Would love if you add more information and an explanation of how to do it, I will work out. http://developers.fortumo.com/pay-by-mobile/making-a-payment Quote
GuyiGooG Posted April 15, 2012 Author Posted April 15, 2012 http://developers.fortumo.com/pay-by-mobile/making-a-payment who i do its will give the donator pack when i pay? Quote
Dave Posted April 15, 2012 Posted April 15, 2012 who i do its will give the donator pack when i pay? I doubt anyone around here is going to spoon feed you the exact script you'll need to make this function correctly. I suggest you read through all the documentation and links been given and attempt it yourself, people will more likely help when you get stuck rather then just creating it for you. Quote
JakeB Posted April 16, 2012 Posted April 16, 2012 So, let me understand this. You want to make money off of your game, but are unable to pay to pay for anything for it.. seems legit. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.