Ti.Paypal Module
Description
The paypal module gives you access to payments via paypal for goods and services.
Note that Apple does not accept payment through any means other than the in-app
purchasing store for extensions and subscriptions for your app.
Accessing the Ti.Paypal Module
To access this module from JavaScript, you would do the following:
Titanium.Paypal = Ti.Paypal = require("ti.paypal");
Functions
Ti.Paypal.createPaypalButton({...})
Creates and returns a Ti.Paypal.PaypalButton object, which is a view. Note that the view's
size determines the amount of space on the screen it takes up, not the size of
the PayPal button, which is determined by a constant.
Takes one argument, a dictionary containing the following properties:
- appID[string]: The appID issued by Paypal for your application
- buttonStyle[int]: A constant indicating the style & size of the button
- paypalEnvironment[int]: A constant indicating the environment the button runs in
- feePaidByReceiver[boolean]: For PERSONAL transactions, whether or not the PayPal fees are paid by the receiver
- transactionType[int]: A constant indicating the type of payment made
- enableShipping[boolean]: Whether or not to select/include shipping information
- payment[dictionary]: A dictionary describing the parameters of the payment. Properties are:
- amount[double]: The amount of the payment
- tax[double]: Tax on the payment
- shipping[double]: Shipping cost for the transaction (only for HARD_GOODS)
- currency[string]: An identifier for the currency the transaction uses.
- recipient[string]: The PayPal user who receives the payment.
- itemDescription[string]: The description of the item.
- merchantName[string]: The name of the merchant the recipient represents.
- senderEmailOrPhone[string]: The email or phone number of the sender.
NOTE: Once set on a button, payment information CANNOT be changed.
Properties
Ti.Paypal.PAYMENT_TYPE_HARD_GOODS[int] (read-only)
Constant which denotes the sale of physical goods.
Ti.Paypal.PAYMENT_TYPE_SERVICE[int] (read-only)
Constant which denotes the sale of a service.
Ti.Paypal.PAYMENT_TYPE_PERSONAL[int] (read-only)
Constant which denotes a personal payment.
Ti.Paypal.BUTTON_152x33[int] (read-only)
A paypal button sized for a 152x33 pixel view.
Ti.Paypal.BUTTON_194x37[int] (read-only)
A paypal button sized for a 194x37 pixel view.
Ti.Paypal.BUTTON_278x43[int] (read-only)
A paypal button sized for a 278x43 pixel view.
Ti.Paypal.BUTTON_294x43[int] (read-only)
A paypal button sized for a 294x43 pixel view.
Ti.Paypal.PAYPAL_ENV_LIVE[int] (read-only)
Sets paypal to use the production servers for processing payments.
Payments are actual transactions.
Ti.Paypal.PAYPAL_ENV_SANDBOX[int] (read-only)
Sets paypal to use the testing servers for processing payments.
Payments use testing funds in the development sandbox.
Ti.Paypal.PAYPAL_ENV_NONE[int] (read-only)
Sets paypal to use internal demonstration data for payments and server operations.
Usage
See example.
Author
Stephen Tramer stramer@appcelerator.com, Appcelerator Inc.
License
Copyright(c) 2010 by Appcelerator, Inc. All Rights Reserved. Please see the LICENSE file included in the distribution for further details.