Im trying to get live with my webshop and do the steps necessary. I tried to ask the same question in the merchant support but it have taken over 10 days for them not to respond so I try here instead.
It says in the Going live Checklist: - Make sure your PayPal API calls are directed at PayPal's production environment. So where am I gonna put this https://api-3t.paypal.com/nvp ? In the code where the buttons are created or in the PDT which is called? Those are the only placces I can think of that would do any difference
It also says: - Get your live API credentials and use them wherever you call PayPal API operations. I have generated them but where to use them? In my PDT which I redirect my customers to after a purchase or in the buttons? Should the https://api-3t.paypal.com/nvp ? be somewhere there as well?
A final question. Do I have to "register" my "app" too? I tried to read but didnt understand. I have a website which Im gonna use your buttons in. Do I need to register that as well? How do I do this?
This is some of my pdt.php-code:
<?php
/*
update: 06/27/2011
- updated to use cURL for better security, assumes PHP version 5.3
*/
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-synch';
$tx_token = $_GET['tx'];
$pp_hostname = "www.sandbox.paypal.com";
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-synch';
$tx_token = $_GET['tx'];
$auth_token = "xxxxxxxxxxxxxxxxxxxxxxxxxx";
// real xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
$req .= "&tx=$tx_token&at=$auth_token";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://$pp_hostname/cgi-bin/webscr");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
//set cacert.pem verisign certificate path in curl using 'CURLOPT_CAINFO' field here,
//if your server does not bundled with default verisign certificates.
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Host: $pp_hostname"));
$res = curl_exec($ch);
curl_close($ch);
You're looking at a checklist for going live with PayPal API calls -- you're using PayPal buttons, so you don't need to worry about that.
For you, the only things you need to change are:
- The $pp_hostname for your PDT script
- The $pp_hostname for your IPN script (if you use it)
- The "action" part of your button (from https://www.sandbox.paypal.com/cgi-bin/webscr to https://www.paypal.com/cgi-bin/webscr)