PSD-Tutorials.de
Forum für Design, Fotografie & Bildbearbeitung
Tutkit
Agentur
Hilfe
Kontakt
Start
Forum
Aktuelles
Besonderer Inhalt
Foren durchsuchen
Tutorials
News
Anmelden
Kostenlos registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Menü
Anmelden
Kostenlos registrieren
App installieren
Installieren
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden.
Du solltest ein Upgrade durchführen oder einen
alternativen Browser
verwenden.
Antworten auf deine Fragen:
Neues Thema erstellen
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
[php] Paypal- API
Beitrag
<blockquote data-quote="Espressolia" data-source="post: 1966038" data-attributes="member: 368444"><p>Hallo,</p><p>ich bin noch ein absoluter Anfänger bei den Thema Paypal API mit Php und hoffe das ihr mir weiterhelfen könnt.</p><p>Also das geht:</p><p>[PHP]</p><p><?php</p><p>echo "<div style='display:none'></p><p> <form name='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'></p><p> <input type='hidden' name='add' value='1'></p><p> <input type='hidden' name='cmd' value='_cart'></p><p> <input type='hidden' id='business' name='business' value='xxx'></p><p> <input type='hidden' id='item_name' name='item_name' value='$user - Ballonfahrt Goehler'></p><p> <input type='hidden' id='amount' name='amount' value='$preis'></p><p> <input type='hidden' id='pp_return' name='return' value='$url'></p><p> <input type='hidden' id='pp_rm' name='rm' value='2'></p><p> <input type='hidden' id='pp_cancelReturn' name='cancel_return' value='$url_cancel'></p><p> <input type='hidden' name='no_shipping' value='2'></p><p> <input type='hidden' name='no_note' value='1'></p><p> <input type='hidden' name='currency_code' value='EUR'></p><p> <input type='hidden' name='lc' value='DE'></p><p> <input type='hidden' name='bn' value='PP-ShopCartBF'></p><p> <input type='submit' value='Jetzt mit PayPal bezahlen' tabindex='1' class='button'></p><p> </form></div></p><p> <script type='text/javascript'></p><p> document.paypal.submit();</p><p> </script>";</p><p>[/PHP]</p><p>Doch in disen Code wird per Javascript das Formular automatisch verschickt.</p><p>doch jetzt möchte ich sowas per PHP verschicken.</p><p>[PHP]</p><p><?php</p><p> $host = "www.paypal.com";</p><p> $path = "/cgi-bin/webscr";</p><p> $data = 'cmd=_card';</p><p> $data .= '&business=XXX';</p><p> $data .= '&item_name=test';</p><p> $data .= '&amount=0.51';</p><p> $data .= '&no_shipping=1';</p><p> $data .= '&no_note=1';</p><p> $data .= '&currency_code=EUR';</p><p> $data .= '&lc=DE';</p><p> $data .= '&bn=PP-ShopCartBF';</p><p> $fp = fsockopen($host, 80, $errno, $errstr, 30);</p><p> if (!$fp) {</p><p> $buffer .= "$errstr ($errno)<br />\n";</p><p> } else {</p><p> $out = "POST ".$path." HTTPS/1.1\r\n";</p><p> $out .= "Host: ".$host."\r\n";</p><p> $out .= "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n";</p><p> $out .= "Content-Length: ".strlen($data)."\r\n";</p><p> $out .= "Connection: Close\r\n\r\n";</p><p> $out .= $data;</p><p> fwrite($fp, $out);</p><p> while (!feof($fp)) {</p><p> $buffer .= fgets($fp, 128);</p><p> }</p><p> fclose($fp);</p><p> }</p><p> echo "a : $buffer";</p><p>[/PHP]</p><p>leider geht das nicht so ganz<img src="/styles/default/xenforo/smilies/uhm.gif" class="smilie" loading="lazy" alt=":(" title="Frown :(" data-shortname=":(" /> Ich dachte er leitet mich somit zur Paypal- Seite (Warenkorb), um meine Bezahlung durchzuführen.</p><p>Wenn ich den buffer ausgebe kommt nur</p><p>[CODE]</p><p>HTTP/1.1 301 Moved Permanently Date: Fri, 11 May 2012 17:06:05 GMT Server: Apache X-Frame-Options: SAMEORIGIN Set-Cookie: cwrClyrK4LoCV1fydGbAxiNL6iG=%7cloeu8x-YdtedgSFjriD7hZhqPTllYYyk8DQWhlBOSTzVVrU-SP1j6dPskK8h7H1mjUhz9W%7ctgvpiPTceYjCqujZ5pRNYN3HLBKkFHrNNNqCV6vpcunTsSROfsOBn1sqdiq9FxfMKS-Fp0%7c; domain=.paypal.com; path=/; HttpOnly Set-Cookie: cookie_check=yes; expires=Mon, 09-May-2022 17:06:05 GMT; domain=.paypal.com; path=/; HttpOnly Location: [URL]https://www.paypal.com/cgi-bin/webscr?cmd=_card&business=xxx&item_name=test&amount=0.51&no_shipping=1&no_note=1¤cy_code=EUR&lc=DE&bn=PP-ShopCartBF[/URL] Vary: Accept-Encoding Connection: close Content-Type: text/html </p><p>[/CODE]</p><p>Kann mir jemand helfen oder gibt es ein deutsches Paypal- API Tutorial?</p><p>Danke im vorraus</p><p>PCGamer</p></blockquote><p></p>
[QUOTE="Espressolia, post: 1966038, member: 368444"] Hallo, ich bin noch ein absoluter Anfänger bei den Thema Paypal API mit Php und hoffe das ihr mir weiterhelfen könnt. Also das geht: [PHP] <?php echo "<div style='display:none'> <form name='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'> <input type='hidden' name='add' value='1'> <input type='hidden' name='cmd' value='_cart'> <input type='hidden' id='business' name='business' value='xxx'> <input type='hidden' id='item_name' name='item_name' value='$user - Ballonfahrt Goehler'> <input type='hidden' id='amount' name='amount' value='$preis'> <input type='hidden' id='pp_return' name='return' value='$url'> <input type='hidden' id='pp_rm' name='rm' value='2'> <input type='hidden' id='pp_cancelReturn' name='cancel_return' value='$url_cancel'> <input type='hidden' name='no_shipping' value='2'> <input type='hidden' name='no_note' value='1'> <input type='hidden' name='currency_code' value='EUR'> <input type='hidden' name='lc' value='DE'> <input type='hidden' name='bn' value='PP-ShopCartBF'> <input type='submit' value='Jetzt mit PayPal bezahlen' tabindex='1' class='button'> </form></div> <script type='text/javascript'> document.paypal.submit(); </script>"; [/PHP] Doch in disen Code wird per Javascript das Formular automatisch verschickt. doch jetzt möchte ich sowas per PHP verschicken. [PHP] <?php $host = "www.paypal.com"; $path = "/cgi-bin/webscr"; $data = 'cmd=_card'; $data .= '&business=XXX'; $data .= '&item_name=test'; $data .= '&amount=0.51'; $data .= '&no_shipping=1'; $data .= '&no_note=1'; $data .= '¤cy_code=EUR'; $data .= '&lc=DE'; $data .= '&bn=PP-ShopCartBF'; $fp = fsockopen($host, 80, $errno, $errstr, 30); if (!$fp) { $buffer .= "$errstr ($errno)<br />\n"; } else { $out = "POST ".$path." HTTPS/1.1\r\n"; $out .= "Host: ".$host."\r\n"; $out .= "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n"; $out .= "Content-Length: ".strlen($data)."\r\n"; $out .= "Connection: Close\r\n\r\n"; $out .= $data; fwrite($fp, $out); while (!feof($fp)) { $buffer .= fgets($fp, 128); } fclose($fp); } echo "a : $buffer"; [/PHP] leider geht das nicht so ganz:( Ich dachte er leitet mich somit zur Paypal- Seite (Warenkorb), um meine Bezahlung durchzuführen. Wenn ich den buffer ausgebe kommt nur [CODE] HTTP/1.1 301 Moved Permanently Date: Fri, 11 May 2012 17:06:05 GMT Server: Apache X-Frame-Options: SAMEORIGIN Set-Cookie: cwrClyrK4LoCV1fydGbAxiNL6iG=%7cloeu8x-YdtedgSFjriD7hZhqPTllYYyk8DQWhlBOSTzVVrU-SP1j6dPskK8h7H1mjUhz9W%7ctgvpiPTceYjCqujZ5pRNYN3HLBKkFHrNNNqCV6vpcunTsSROfsOBn1sqdiq9FxfMKS-Fp0%7c; domain=.paypal.com; path=/; HttpOnly Set-Cookie: cookie_check=yes; expires=Mon, 09-May-2022 17:06:05 GMT; domain=.paypal.com; path=/; HttpOnly Location: [URL]https://www.paypal.com/cgi-bin/webscr?cmd=_card&business=xxx&item_name=test&amount=0.51&no_shipping=1&no_note=1¤cy_code=EUR&lc=DE&bn=PP-ShopCartBF[/URL] Vary: Accept-Encoding Connection: close Content-Type: text/html [/CODE] Kann mir jemand helfen oder gibt es ein deutsches Paypal- API Tutorial? Danke im vorraus PCGamer [/QUOTE]
Bilder bitte
hier hochladen
und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Zitate einfügen…
Authentifizierung
Wenn ▲ = 7, ▼ = 3, ◇ = 2 und die Summe von ▲ und ▼ durch ◇ geteilt wird, was ist das Ergebnis?
Antworten
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
[php] Paypal- API
Oben