CreatePreApproval Method
Sets up a preapproval transaction with PayPal.
Syntax
adaptivepreapproval.createPreApproval([callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
Use this method to set up a preapprovals for a specific maximum amount over a specific period of time and, optionally, by any of the following constraints: the number of payments, a maximum per-payment amount, a specific day of the week or the month, and whether or not a PIN is required for each payment request.
To set up a preapproval request, you must specify values for the following required properties (in addition to your PayPal credentials):
StartingDate | First date for which the preapproval is valid. It cannot be before today's date or after the EndingDate. |
EndingDate | Last date for which the preapproval is valid. It cannot be later than one year from the StartingDate. |
MaxTotalPaymentAmount | The preapproved maximum total amount of all payments. It cannot exceed $2,000 USD or its equivalent in other currencies. |
CurrencyCode | The code for the currency in which the payment is made. You can specify only one currency, regardless of the number of recipients. |
CancelURL | URL to redirect the sender's browser to in the event he cancels the preapproval. |
ReturnURL | URL to redirect the sender's browser to after the sender has logged into PayPal and confirmed the preapproval. |
ClientDetails | Information about the sender to whom the preapproval will be sent. |