Question Nạp thẻ cào cho xenforo tích hợp [bd] bank

Thảo luận trong 'Add-on Quesions' bắt đầu bởi 4uandme, 6/7/14.

1votes
5/5, 1 vote

  1. 4uandme

    4uandme New Member

    Bài viết:
    13
    Likes :
    1
    Chào các lão làng
    Hiện em đang tích hợp thẻ cào cho xenforo bằng bd bank
    Đây là đoạn code tích hợp thẻ cào bằng Credit của brivium
    demo: http://4uandme.us/napthe
    PHP:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="author" content="TMDVN" />
        <title>Transaction API</title>
    </head>
    <body>
    <table width="100%" height="470">
        <tr height="20%" background="images/bg-navigation.png" valign="top">
            <td align="center">
                <font color="white"><b>Thông tin giao dịch</b></font>
            </td>
        </tr>
        <tr height="auto" valign="top" algin="center">
            <td>
            <div style="width:100%; height:auto; color:#555; line-heigh:25px; display:table; padding:10px 0px; text-align:center; font-size:16px; font-family:tahoma;">
    <?php
        $username
    =$_REQUEST['UserName'];
        
    $cardid=$_REQUEST['cardid'];
        
    $pin=$_REQUEST['pin'];
        
    $serial=$_REQUEST['serial'];
        
    $timedk date("Y-m-d H:i:s");
        include(
    'class/BKTransactionAPI.php');

        
    $bk = new BKTransactionAPI("https://www.baokim.vn/the-cao/saleCard/wsdl");
        
    //$bk = new BKTransactionAPI("http://sandbox.baokim.vn/services/transaction_api/init?wsdl");

        //var_dump($bk);
        
    $transaction_id time();

        if(
    $username == "") {
            echo 
    "Bạn vui lòng nhập tên tài khoản bạn nạp Tiền tại Diễn Đàn!";
        }
        else if(
    $pin == "") {
            echo 
    "Bạn vui lòng nhập Mã Số của thẻ cào !";
        }
        else if(
    $serial == ""){
            echo 
    "Bạn vui lòng nhập số serial của thẻ cào !'";
        }
        else
        {
            
    $info_topup = new TopupToMerchantRequest();
            
    $info_topup->api_password 'AAAA';
            
    $info_topup->api_username 'BBBB';
            
    $info_topup->card_id $cardid//'92';
            
    $info_topup->merchant_id 'CCCC';           
            
    $info_topup->pin_field $pin;
            
    $info_topup->seri_field $serial;
            
    $secure_pass 'DDDD';           
            
    $info_topup->transaction_id $transaction_id;
           
           
            
    $data_sign_array = (array)$info_topup;
            
    ksort($data_sign_array);
           
           
            
    $data_sign md5($secure_pass implode(''$data_sign_array));
            
    $info_topup->data_sign $data_sign;
           
            
    $test $bk->DoTopupToMerchant($info_topup);
           
            
    $sotien$test->info_card;
            
    //var_dump($test);
           
            
    if ($test->error_code == 0)
            {
               
                if (
    $test->info_card==10000){$xu1000;} 
                else  if (
    $test->info_card==20000) {$xu=2000;}
                else  if (
    $test->info_card==50000) {$xu=5000;}
                else  if (
    $test->info_card==100000) {$xu=10000;}
                else  if (
    $test->info_card==200000) {$xu=20000;}
                else  if (
    $test->info_card==500000) {$xu=50000;}
               
                    
    $connect mysql_connect("Hostname","Usedb","passdb") or die("Error connect database !");
                    
    mysql_select_db("dbname",$connect) or die ("Die select database: ".mysql_error());
                    
    mysql_query("update xf_user set credits=credits+".$xu." where username='".$username."'");                               
                    echo 
    "<center>Nạp Tiền thành công cho user ".$username." với số tiền ".$xu." !<br/></center>";
            }   
           
            else
            {
           
                   
                    
    //$myStrSQL1 = "insert into oc_customer_reward VALUES ('','".$usernameolder."','0','".$napthe."','".$xu."','".$serial."')";
                    //mysql_query($myStrSQL1);
                    
    echo  "<center>Bạn vui lòng kiểm tra lại Mã Số hoặc serial của thẻ cào !<br/></center>";
                
    //echo "<center>".$test->error_message."</center>";
                //echo "<center>".$test->error_code."</center>";
            
    }
        }
    ?>
            </div>
            </td>
        </tr>
       
        <tr >
            <td align="center" style=" text-align:center;">
               
            </td>
        </tr>
    </table>
    </body>
    </html>

    Bây giờ em muốn dùng [bd] bank cho đoạn code trên thì phải thay đổi những thông số nào ạ !
    Xin các tiền bối cho em ví dụ cụ thể nha ! Thanks !
     
    Đang tải...
  2. 4uandme

    4uandme New Member

    Bài viết:
    13
    Likes :
    1
    đã làm đc rồi ! xin mod close topic !
     
comments powered by Disqus

Chia sẻ trang này

Đang tải...