brauche Webseite ideal für Vereine und Firmen
- Ad -
php-resource



Zurück   PHP-Scripte PHP-Tutorials PHP-Jobs und vieles mehr > Jobs und Projekte > Projekthilfe
 

Login

 
eingeloggt bleiben
star Jetzt registrieren   star Passwort vergessen
 

 

 

 


Projekthilfe Hier könnt Ihr eine Art Projekthilfe anfordern. Unter Projekthilfe verstehen wir Angebote bei denen KEIN Geld gezahlt werden kann.

Antwort
 
LinkBack Themen-Optionen Thema bewerten
  #1 (permalink)  
Alt 28-09-2011, 11:28
Larry_Lou
 Registrierter Benutzer
Links : Onlinestatus : Larry_Lou ist offline
Registriert seit: Sep 2011
Beiträge: 2
Larry_Lou befindet sich auf einem aufstrebenden Ast
Red face PayPal Sandbox usw.

Hallo,
Ich versuche einen Script zu modifizieren um monatliche Spenden über PayPal abzuwickeln. Leider kriege ich es nicht hin den Script über den Sandbox testen zu können.
Nach Rücksprache mit PayPal, liegt das Problem daran, dass meinem Script nicht auf den Sandbox sondern auf den normal PayPal-Portal weiterleitet. Beim PP Tech-Support habe ich die geniale Antwort bekommen "Leider weiss ich auch nicht, warum die Weiterleitung auf die Sandbox Testumgebung nicht erfolgt. Ihrem Code zu entnehmen, scheint alles richtig zu sein $paypal["url"] = "https://www.sandbox.paypal.com/cgi-bin/webscr";"

Und hier nun der Script (verkürzt - ich hoffe ich habe nichts wichtiges gelöscht):

PHP-Code:
<?php
require_once('class.paypal.php');
$p = new paypal_class();
$cmd "xclick-subscriptions";
$paypal["url"] = "https://www.sandbox.paypal.com/cgi-bin/webscr";
$this_script 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$p->add_field('business','seller_1317109593_biz@variation-design.de');
if (!empty(
$_REQUEST['formSubmit'])) $_GET['action'] = 'process';  
if(!empty(
$_GET['payment_status'])) $_GET['action'] = 'success';
switch (
$_GET['action']) {
   
   case 
'process':      
      
     
      
$p->add_field('item_name''TeachBeyond Online Donation');
      
$p->add_field('amount'str_replace('$','',$_REQUEST['value']));      
      
$p->add_field('first_name',$_REQUEST['name']);
      
$p->add_field('last_name','');
      
$p->add_field('address1',$_REQUEST['address']);
      
$p->add_field('address2',$_REQUEST['address2']);
      
$p->add_field('city',$_REQUEST['city']);
      
$p->add_field('state',$_REQUEST['state']);
      
$p->add_field('zip',$_REQUEST['zip_code']);
      
$p->add_field('email',$_REQUEST['email']);
      
$p->add_field('telephone',$_REQUEST['telephone']);
      
$p->add_field('return'$this_script.'?action=success');
      
$p->add_field('cancel_return'$this_script.'?action=cancel');
      
$p->add_field('notify_url'$this_script.'?action=ipn');
      
$p->add_field('cpp_headerback_color','FFFFFF');
      
$p->add_field('cpp_headerborder_color','FFFFFF');
      
$p->add_field('cpp_payflow_color','FFFFFF');     
      
$p-     
      
/*
      ===============================================
      ! Do not change/delete these variables     ===============================================
      */
      
$p->add_field('on0',$_REQUEST['on0']);
      
$p->add_field('os0',$_REQUEST['os0']);
      
$p->add_field('cs','1'); 
      
$p->add_field('address_override','1');
      
$send_email_to 'seller_1317109593_biz@variation-design.de';
      
$send_email_from 'seller_1317109593_biz@variation-design.de';
      
$email_subject_line 'TeachBeyond Online Monthly Donation Form';
      
$message 'The online monthly donation form has been submitted 
for a US donation. Please verify that payment has been completed by 
checking your paypal account.'
."\r\n\r\n"
        
."Their information is listed below.\r\n\r\n";

      
$headers 'From: TeachBeyond<'.$send_email_from.'>' "\r\n" .
       
'Reply-To: '.$send_email_from.'' "\r\n" .
       
'X-Mailer: PHP/' phpversion();

      
// ! Nothing else should need to be adjusted to send a successful email.
        
$used 0;
        foreach(
$_REQUEST as $k=>$v):
            if(
in_array($k,array('on0','os0','value','formSubmit')) || $v == ''){
            continue;
            }
            
            if(
$k == 'designated' || $k == 'designated_other'){
            
$val .= "\r\nI would like my donation to go towards: ".stripslashes($v)."\r\n";
            }elseif(
in_array($k,array('other_1','other_2','other_3','other_4','other_5','other_6'))){
            
$val .= "\r\nSaid Yes To: ".stripslashes($v)."\r\n";
            }elseif(!
strstr($k'memory')){
            
$val .= ucwords(str_replace('_',' ',$k)).": ".stripslashes($v)."\r\n";
            }
        endforeach;
        
$message $message.$val;
        
mail($send_email_to,$email_subject_line,$message,$headers);

          echo 
$p->submit_paypal_post();  
      exit;
   break;
      
   case 
'success':      
      exit;
   break;
      
   case 
'cancel':       
 
      
header('location: http://www.teachbeyond.org/index.php?option=com_content&view=article&id=77');
      exit;
   break;
      
   case 
'ipn':          
      
      if (
$p->validate_ipn()) {
        
      var 
$send_email_to$email_subject_line$message$headers

      $send_email_to 
'seller_1317109593_biz@variation-design.de';
      
$send_email_from 'seller_1317109593_biz@variation-design.de';
      
$email_subject_line 'TeachBeyond Online Donation - PayPal Notification - Received Payment';
      
$message =  "An instant payment notification was successfully received\n"
          
."from ".$p->ipn_data['payer_email']." on ".date('r')
          .
" at ".date('g:i A')."\n\nDetails:\n";
      
      
$headers 'From: TeachBeyond<'.$send_email_from.'>' "\r\n" .
       
'Reply-To: '.$send_email_from.'' "\r\n" .
       
'X-Mailer: PHP/' phpversion();
       
      
$overlook_keys = array('on0','os0','value','formSubmit');
     
      foreach(
$p->ipn_data as $k=>$v):
         if(
in_array($k,$overlook_keys) || $v == ''){
            continue;
         }
        
         if(
$k == 'designated' || $k == 'designated_other'){
            
$val .= "\r\nI would like my donation to go towards: ".stripslashes($v)."\r\n";
         }elseif(
in_array($k,array('other_1','other_2','other_3','other_4','other_5','other_6'))){
            
$val .= "\r\nSaid Yes To: ".stripslashes($v)."\r\n";
         }elseif(!
strstr($k'memory')){
            
$val .= ucwords(str_replace('_',' ',$k)).": ".stripslashes($v)."\r\n";
         }
      endforeach;
      
      
$message $message.$val;
      
     
      
mail($send_email_to$email_subject_line,$message,$headers);
      }
      exit;
   break;
 }     

?>
<html>
<head>
    
    
    <script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js" type="text/javascript"></script>
    <script src="js/validation/validation.js" type="text/javascript"></script>
    <link href="js/validation/style.css" rel="stylesheet" type="text/css" />

     
</head>

<body>


                                    
<div class="blog" style="width:95%">
          
          
          <form action="http://<?php echo $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?action=process';?>" method="get" id="donateForm">
              <fieldset><legend>Address</legend>
                <p><label for="name">Name: </label><input type="text" name="name" id="name" value="" class="required" /></p>
                
            
            <fieldset><legend>Monthly Donation Amount</legend>
                <p class="no_p_bot">I would like to begin a monthly donation of:</p>
                <p><label for="amount_20" class="auto">$20: </label>
<input type="radio" name="amount" id="amount_20" value="20" 
onBlur="changeAmount('amount_20'); empty('amount_other');" />
                <label for="amount_25" class="auto">$25: </label>
<input type="radio" name="amount" id="amount_25" value="25" 
onBlur="changeAmount('amount_25'); empty('amount_other');" />
                    
                    
                <p>&nbsp;</p>
                <p class="no_p_bot">I would like my donation to go towards: </p><br/>
                <p>
                    
                    <label for="designated_missionary" style="width:190px;">TeachBeyond Missionary: </label>
                    <input type="text" name="designated_missionary" 
id="designated_missionary" value="Missionary Name" 
onBlur="changeOption('designated_missionary',true);" 
onFocus="setTrue('designated_missionary');" /><br/><br/>
                    
                </p>
            </fieldset>
            
            
            
            
          <!-- 
          ==============================================
          ! These are overriden using javascript. They do not need to be 
              changed or deleted.
          ===============================================
          -->  
          <input type="hidden" name="on0" id="option_name_0" value="I would like my donation to go towards" />
          <input type="hidden" name="os0" id="option_value_0" value="" />
          <input type="hidden" name="value" id="paypal_amount" value="" />
          <input type="hidden" name="action" id="form_action" value="process" />
         
          <input type="submit" name="formSubmit" value="Begin monthly donations" />
          <br/>
          Thank you for your monthly donation!
  </form>
          
          <script type="text/javascript">
    /**
    ====================================================================
    ! Javascript for the form elements above
    ====================================================================
    **/
    function changeOption(ID,other){
        if(other){
        var a = document.getElementsByName('designated');
        
        for(x = 0;x<a.length;x++){
            a[x].checked = false;
        }
        }else{
        document.getElementById('designated_other').value = '';
        }
        
        document.getElementById('option_value_0').value = document.getElementById(ID).value;
    }
    
    function changeShow(on,ID){
        if(on){
        document.getElementById(ID).style.display = 'block';
        }else{
        document.getElementById(ID).style.display = 'none';
        }
    }
    
    function changeAmount(ID,other){
    //console.log('check');
        if(other){
        var a = document.getElementsByName('amount');
        
        for(x = 0;x<a.length;x++){
            a[x].checked = false;
        }
        }else{
        document.getElementById('amount_other').value = '';
        }
        document.getElementById('paypal_amount').value = document.getElementById(ID).value;
    }
    
    function empty(ID){
    document.getElementById(ID).value = '';
    }
    
    function setTrue(ID){
    document.getElementById(ID).checked = true;
    }
    var valid3 = new Validation('donateForm');
    
     
    
    </script>
    
   </div>


</body>
</html>
Millionen Dank!
Mit Zitat antworten
  #2 (permalink)  
Alt 28-09-2011, 15:52
Larry_Lou
 Registrierter Benutzer
Links : Onlinestatus : Larry_Lou ist offline
Registriert seit: Sep 2011
Beiträge: 2
Larry_Lou befindet sich auf einem aufstrebenden Ast
Standard

Ich habe jetzt anderswo Hilfe bekommen. Danke trotzdem.
Mit Zitat antworten
Antwort

Lesezeichen


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
PayPal integrieren... bweichel Jobgesuche 0 11-05-2006 10:53
PayPal bweichel PHP Developer Forum 7 08-05-2006 15:02
X in Array schreiben, ausgeben, X+1 in Array... usw. usw... schwarzfahrer PHP Developer Forum 3 19-12-2004 18:52
[jsscript + PHP] Neues Fenster ohne Balken usw usw quicksilver HTML, JavaScript, AJAX und CSS 43 15-11-2004 16:15
PHP-Code in einer Sandbox ausführen Nezzar PHP Developer Forum 8 11-05-2003 14:06

Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an


PHP News

MariaDB 5.5 veröffentlicht
MariaDB 5.5 veröffentlichtDie freie MySQL-Alternative MariaDB wurde in der stabilen Version 5.5.23 veröffentlicht und soll einige Verbesserungen gegenüber Oracles Communityversion von MySQL mitbringen.

16.04.2012 | Berni

Deutsche Yii Framework Community
Deutsche Yii Framework CommunitySeit dem 19.03.2012 gibt es für die Yii PHP Framework Community ein deutsches Zuhause.

20.03.2012 | dhcomputer

 

Aktuelle PHP Scripte

EM 2012 Tipp-Spiel ansehen EM 2012 Tipp-Spiel

Online Tipp-Spiel zur Fussball Europameisterschaft 2012, basierend auf php-Script mit hinterlegter mySql-Datenbank

27.05.2012 tippimnetz | Kategorie: PHP/ Spiele
Advanced Login ansehen Advanced Login

Login-System und Kundenverwaltung, die sich spielend leicht in bestehende Webseiten einbauen lässt und einen enormen Funktionsumfang bietet. Ihre eigene Webseite muss mit Advanced Login nicht umständlich an ein fertiges System angepasst werden.

25.05.2012 Madden | Kategorie: PHP/ Kundenverwaltung
BROM CMS/BelCal 3 ansehen BROM CMS/BelCal 3

Spezielles CMS für Betreiber von Ferienwohnungen. Komplette Seitenerstellung online, Verwaltung mehrerer Objekte, Reservierungssystem mit sofortigem Abgleich im Belegungskalender und vieles mehr bietet dieses Content Management System.

25.05.2012 belcal2 | Kategorie: PHP/ CMS
 Alle PHP Scripte anzeigen

Alle Zeitangaben in WEZ +2. Es ist jetzt 13:17 Uhr.