הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 14-07-09, 14:39   # 1
Hezi & BomBas
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: May 2008
הודעות: 325
שלח הודעה באמצעות ICO אל Hezi & BomBas שלח הודעה באמצעות MSN אל Hezi & BomBas

Hezi & BomBas לא מחובר  

שאלה | PAYPAL

היי, אני כרגע בונה מערכת קטנה המשלבת תשלום ישיר באמצעות PAYPAL.
את התשלום כבר בניתי והכל בסדר, הגדרתי גם כתובת חזרה לאחר התשלום. השאלה שלי - איך אני מוודא שהמשתמש אכן שילם ולא סתם נכנס לכתובת המתבקשת? תודה.

זה הקוד שלי:
PHP קוד:
    require "config.php";

    
    
$req 'cmd=_notify-synch';
    
    
$tx_token $_GET['tx'];
    
$req .= "&tx=$tx_token";
    
    
// post back to PayPal system to validate the payment.
    
    
$header "POST /cgi-bin/webscr HTTP/1.0\r\n";
    
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    
$header .= "Content-Length: " strlen($req) . "\r\n\r\n";
    
$fp fsockopen ('www.paypal.com'80$errno$errstr30);
    
    if ( ! 
$fp )
    {
        
$output 'Error opening PayPal';
    }
    else
    {
        
fputs ($fp$header $req);
        
// Read the body data .
        
$res '';
        
$headerdone false;
        while ( ! 
feof($fp) )
        {
            
$line fgets ($fp1024);
            if (
strcmp($line"\r\n") == 0) {
            
// Read the header.
            
$headerdone true;
            }
            else if (
$headerdone)
            {
                
$res .= $line;
            }
        }
        
        
// Parse the data.
        
$lines explode("\n"$res);
        
$keyarray = array();
        if ( 
strcmp ($lines[0], "SUCCESS") == )
        {
            for (
$i=1$i<count($lines);$i++)
            {
            list(
$key,$val) = explode("="$lines[$i]);
            
$keyarrayurldecode($key) ] = urldecode$val );
            }
            
// Check if the payment_status has been Completed.
            // check that the receiver_email is your Primary PayPal email.
            // check that payment_amount/payment_currency are correct.
            // Process payment.
            
            
$output $_GET['item_name'];
        
        }
        else
        {
            
$output 'error';
        }
    }
    
    print 
$output
אחרי הקנייה הוא מדפיס "error".
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 01:28.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ