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:

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.