Jump to content
  • 0

can i know how to get account ID number?


Question

Posted

Hi rAthena users and experts,

I wonder how can i get the account ID number when the user login to the page?

since i want to use Paymentwall for my ragnarok donation site.

here is my payment widget code box.

<iframe src="http://wallapi.com/api/ps/?key=ab6d1a924fb8ee2202518c0ee251b815&uid=[uSER_ID]&widget=p1_1" width="750" height="800" frameborder="0"></iframe>

Note :

In HTML code please replace [uSER_ID] placeholder with id of end-user who is viewing the widget

and also, i wonder what is ping back means?

6 answers to this question

Recommended Posts

Posted

Assuming player is already logged in

<?php echo $session->account->account_id; ?>

how to link the paymentwall with my flux CP's Donation Credits

No idea. You're on your own here. But why don't you just use PayPal, which is supported out of the box in FluxCP?

Posted

haha, i wanted to use paymentwall since it got many donation option. you can donate by using cellphone, bank transfer, paypall and many more methods

Posted

Payment Wall Ping Back Example for Virtual Currency

<?php
define('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);
}

Payment wall ping back example for subscription

<?php
define('SECRET', 'ab896ebbfc0bc708defd01928b25eff6');
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;
$goodsId = isset($_GET['goodsid']) ? $_GET['goodsid'] : null;
$length = isset($_GET['slength']) ? $_GET['slength'] : null;
$period = isset($_GET['speriod']) ? $_GET['speriod'] : 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($goodsId) && isset($type) && !empty($refId) && !empty($signature)) {
$signatureParams = array(
 'uid' => $userId,
 'goodsid' => $goodsId,
 'slength' => $length,
 'speriod' => $period,
 '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) {

  // Take membership from user
  // This is optional, but we recommend this type of crediting to be implemented as well

 }
 else {
  // Give membership to user
 }
}
}
if ($result) {
echo 'OK';
}
/**
* Generates signature using given parameters array and secret
*
* @param array $params
* @param string $secret
* @return string
*/
function generateSignature($params, $secret) {
$str = '';
foreach ($params as $k=>$v) {
 $str .= "$k=$v";
}
$str .= $secret;
return md5($str);
}

$userid = $params->get('userid);

<iframe src="http://wallapi.com/api/ps/?key=ab6d1a924fb8ee2202518c0ee251b815&uid=$userid&widget=p1_1" width="620" height="800" frameborder="0"></iframe>

i think this fix it?

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...