Location: PHPKode > scripts > paypal php > mcfedr-paypal-php-e907080/docs/paypal-php/libpaypal/Paypal.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Paypal</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Paypal</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">For accessing the paypal api  See the test file for examples of usage</p>
<p class="description"><p>This program is free software: you can redistribute it and/or modify  it under the terms of the GNU General Public License as published by  the Free Software Foundation, either version 3 of the License, or  (at your option) any later version.</p><p>This program is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License for more details.</p><p>You should have received a copy of the GNU General Public License  along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Fred Cox &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</li>
				<li><span class="field">copyright:</span> Copyright Fred Cox, 2011</li>
				<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/gpl.html">GNU GENERAL PUBLIC LICENSE</a></li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_lib---libpaypal.php.html">/lib/libpaypal.php</a> (line <span class="field">25</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																				
												<div class="method-definition">
											<span class="method-result">Paypal</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
											(<span class="var-type">PaypalAuthentication</span>&nbsp;<span class="var-name">$authentication</span>, [<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalSettings.html">PaypalSettings</a></span>&nbsp;<span class="var-name">$settings</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getButton" title="details" class="method-name">getButton</a>
											(<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalProduct.html">PaypalProduct</a>|array</span>&nbsp;<span class="var-name">$products</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$paidURL</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$cancelURL</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$notifyURL</span> = <span class="var-default">null</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$invoiceId</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$custom</span> = <span class="var-default">null</span>], [<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalBuyer.html">PaypalBuyer</a></span>&nbsp;<span class="var-name">$buyer</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$label</span> = <span class="var-default">&quot;Checkout&quot;</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getButtonAction" title="details" class="method-name">getButtonAction</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#getButtonParams" title="details" class="method-name">getButtonParams</a>
											(<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalProduct.html">PaypalProduct</a>|array</span>&nbsp;<span class="var-name">$products</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$paidURL</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$cancelURL</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$notifyURL</span> = <span class="var-default">null</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$invoiceId</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$custom</span> = <span class="var-default">null</span>], [<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalBuyer.html">PaypalBuyer</a></span>&nbsp;<span class="var-name">$buyer</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getLastError" title="details" class="method-name">getLastError</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result"><a href="../../paypal-php/libpaypal/PaypalNotification.html">PaypalNotification</a></span>
										<a href="#handleNotification" title="details" class="method-name">handleNotification</a>
											([<span class="var-type">array</span>&nbsp;<span class="var-name">$vars</span> = <span class="var-default">null</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#refundPayment" title="details" class="method-name">refundPayment</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$transactionId</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$invoiceId</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">'Full'</span>])
									</div>
																<div class="method-definition">
											<span class="method-result">bool</span>
										<a href="#sendPayment" title="details" class="method-name">sendPayment</a>
											(<span class="var-type">string|array</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string|array</span>&nbsp;<span class="var-name">$amount</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">''</span>], [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$note</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$subject</span> = <span class="var-default">null</span>])
									</div>
								</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>

<a name="method__construct" id="__construct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">51</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Create a new paypal object</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Paypal</span>
		<span class="method-name">
			__construct
		</span>
					(<span class="var-type">PaypalAuthentication</span>&nbsp;<span class="var-name">$authentication</span>, [<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalSettings.html">PaypalSettings</a></span>&nbsp;<span class="var-name">$settings</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">PaypalAuthentication</span>
				<span class="var-name">$authentication</span>			</li>
					<li>
				<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalSettings.html">PaypalSettings</a></span>
				<span class="var-name">$settings</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetButton" id="getButton"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getButton</span> (line <span class="line-number">73</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get a button as html  Use getButtonParams and getButtonAction if you need to customise</p>
	<ul class="tags">
				<li><span class="field">return:</span> html form with a button</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getButton
		</span>
					(<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalProduct.html">PaypalProduct</a>|array</span>&nbsp;<span class="var-name">$products</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$paidURL</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$cancelURL</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$notifyURL</span> = <span class="var-default">null</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$invoiceId</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$custom</span> = <span class="var-default">null</span>], [<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalBuyer.html">PaypalBuyer</a></span>&nbsp;<span class="var-name">$buyer</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$label</span> = <span class="var-default">&quot;Checkout&quot;</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalProduct.html">PaypalProduct</a>|array</span>
				<span class="var-name">$products</span><span class="var-description">: <a href="../../paypal-php/libpaypal/PaypalProduct.html">PaypalProduct</a></span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$paidURL</span><span class="var-description">: URL paypal returns user to when completed</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$cancelURL</span><span class="var-description">: URL to return to if user cancels payment</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$notifyURL</span><span class="var-description">: URL for instant notifications</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$invoiceId</span><span class="var-description">: Your id for this payment, must be unique</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$custom</span><span class="var-description">: Custom data that will be in any notifications</span>			</li>
					<li>
				<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalBuyer.html">PaypalBuyer</a></span>
				<span class="var-name">$buyer</span><span class="var-description">: Info about the buyer to autofill in</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$label</span><span class="var-description">: label Label for the button</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetButtonAction" id="getButtonAction"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getButtonAction</span> (line <span class="line-number">170</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get form action to go with the params from getButtonParams</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getButtonAction
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetButtonParams" id="getButtonParams"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getButtonParams</span> (line <span class="line-number">100</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get paypal button params for this payment</p>
<p class="description"><p>Should be posted to url getButtonAction  use &lt;input type=&quot;hidden&quot; name=&quot;$key&quot; value=&quot;$value&quot; /&gt;  for each element of the array returned</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> of string</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			getButtonParams
		</span>
					(<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalProduct.html">PaypalProduct</a>|array</span>&nbsp;<span class="var-name">$products</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$paidURL</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$cancelURL</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$notifyURL</span> = <span class="var-default">null</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$invoiceId</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$custom</span> = <span class="var-default">null</span>], [<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalBuyer.html">PaypalBuyer</a></span>&nbsp;<span class="var-name">$buyer</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalProduct.html">PaypalProduct</a>|array</span>
				<span class="var-name">$products</span><span class="var-description">: <a href="../../paypal-php/libpaypal/PaypalProduct.html">PaypalProduct</a></span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$paidURL</span><span class="var-description">: URL paypal returns user to when completed</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$cancelURL</span><span class="var-description">: URL to return to if user cancels payment</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$notifyURL</span><span class="var-description">: URL for instant notifications</span>			</li>
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$invoiceId</span><span class="var-description">: Your id for this payment, must be unique</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$custom</span><span class="var-description">: Custom data that will be in any notifications</span>			</li>
					<li>
				<span class="var-type"><a href="../../paypal-php/libpaypal/PaypalBuyer.html">PaypalBuyer</a></span>
				<span class="var-name">$buyer</span><span class="var-description">: Info about the buyer to autofill in</span>			</li>
				</ul>
		
			
	</div>
<a name="methodgetLastError" id="getLastError"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getLastError</span> (line <span class="line-number">756</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the message for the last error</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getLastError
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodhandleNotification" id="handleNotification"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">handleNotification</span> (line <span class="line-number">257</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Call this function on your instant notification url (IN)  And success url to use payment data transfer (PDT)</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../../paypal-php/libpaypal/PaypalNotification.html">PaypalNotification</a></span>
		<span class="method-name">
			handleNotification
		</span>
					([<span class="var-type">array</span>&nbsp;<span class="var-name">$vars</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$vars</span><span class="var-description">: variables to use, normally $_POST</span>			</li>
				</ul>
		
			
	</div>
<a name="methodrefundPayment" id="refundPayment"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">refundPayment</span> (line <span class="line-number">621</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Refund the payment</p>
	<ul class="tags">
				<li><span class="field">return:</span> successful</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			refundPayment
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$transactionId</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$invoiceId</span> = <span class="var-default">null</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$type</span> = <span class="var-default">'Full'</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$transactionId</span><span class="var-description">: id</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$invoiceId</span><span class="var-description">: optional internal payment id</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$type</span><span class="var-description">: currently only Full is supported</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsendPayment" id="sendPayment"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">sendPayment</span> (line <span class="line-number">544</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Send a payment to an email address</p>
<p class="description"><p>Users MassPayments API  Warning, this works straight away, no confirming or anything  Money is sent instantly</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> whether succesful or not</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool</span>
		<span class="method-name">
			sendPayment
		</span>
					(<span class="var-type">string|array</span>&nbsp;<span class="var-name">$email</span>, <span class="var-type">string|array</span>&nbsp;<span class="var-name">$amount</span>, [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$id</span> = <span class="var-default">''</span>], [<span class="var-type">string|array</span>&nbsp;<span class="var-name">$note</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$subject</span> = <span class="var-default">null</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$email</span><span class="var-description">: one or more email addresses to send payment to</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$amount</span><span class="var-description">: amount to send to each address</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$id</span><span class="var-description">: unique id for the payment</span>			</li>
					<li>
				<span class="var-type">string|array</span>
				<span class="var-name">$note</span><span class="var-description">: note to the user</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$subject</span><span class="var-description">: subject for email</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Sun, 26 Jun 2011 00:44:57 +0300 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>
Return current item: paypal php