Let us add a link on this page to make payment via PayPal. The
following code does this:
if ($orderObj->Save())
{
echo "
Order Placed!";
echo $orderObj;
echo "
Your order is placed.
";
echo "
id."\"
>Pay via Paypal!
";
$_SESSION["orderInfo"] = null;
}
2. Next, we create a payment.inc.php page, and add it to $validActions
array in index.php.
Making Money via Mobile Devices
[ 142 ]
3. We have combined the constants.php and CallerService.php files of the
PayPal PHP SDK into a single file that we will use: paypal.lib.php. This
will make it easier for us to integrate later. Note that we need cURL extension
of PHP installed to use this SDK. The following code shows the structure of
paypal.lib.php:
if($sandbox)
{
// sandbox (testing) authentication information
define('API_USERNAME', 'sdk-three_api1.sdk.com');
define('API_PASSWORD', 'QFZCWN5HZM8VBG7Q');
define('API_SIGNATURE',
'A-IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU');
define('API_ENDPOINT', 'https://api-3t.sandbox.paypal.com/nvp');
define('PAYPAL_URL', 'https://www.sandbox.
Pages:
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190