global $gCms; $config = &$gCms->GetConfig(); $type = ($params['type'] != '') ? $params['type'] : "cart"; $name = $params['name']; $price = $params['price']; $id = $params['id']; $extra = $params['extra']; $weight = $params['weight']; $email = "YOUR PAYPAL EMAIL ADDRESS"; $buttondata = array( "business" => $email, "item_name" => $name, "amount" => $price, "no_shipping" => 2, // shipping required "return" => $config['root_url']."/", "cancel_return" => $config['root_url']."/", "currency_code" => "USD", "bn" => "PP-BuyNowBF", ); if ($id != '') $buttondata['item_number'] = $id; if ($weight != '') { $buttondata['weight'] = $weight; $buttondata['weight_unit'] = 'lbs'; } if ($type == "cart") { $buttondata['cmd'] = "_cart"; $buttondata['add'] = "1"; } elseif ($type == "buy") $buttondata['cmd'] = "_xclick"; elseif ($type == "donate") $buttondata['cmd'] = "_donations"; elseif ($type == "subscribe") $buttondata['cmd'] = "_subscribe"; else { echo "Bad button type $type."; return; } include "PATH TO FORBIDDEN DIRECTORY/paypal_encrypt.php" if ($extra != "") $ret = encrypt_paypal_button($buttondata, $type, "paypal_button", $extra); else $ret = encrypt_paypal_button($buttondata, $type, "paypal_button"); if ($ret[0] === true) echo $ret[1]; else echo "

Error:  {$ret[1]}

";