PayPal

From NSB App Studio
Jump to: navigation, search

PayPal.jpg

Description

The PayPal control allows you to collect money from PayPal for sales, subscriptions and donations. PayPal is available in many countries. It’s much easier to set up and use than a credit card.

First, set yourself up as a PayPal Merchant. Assuming you already have a PayPal account, go to the Merchant Services tab on the main screen. On the left, you will see a tab called “Website Payments Standard”. Click on that and follow the instructions.

Once you are set up as a merchant, you will need to set up your product. The easiest way to do that is on the Merchant Services page: Choose the “Buy Now button” option. Enter a number of fields, including item name, item ID (a reference number for your own use), price, currency (21 choices!), shipping and tax info. Once complete, click on ‘Create Button’.

It will go to a new page, showing the code for the button. You’re interested in the string just after “value=”. In this case, it is “ZB9QQKBKK7XYE”. Copy into hostedButtonID in the control’s properties.

PayPalDesc.jpg

At runtime, the PayPal button will open the PayPal web page (replacing your app) and get the payment information from the customer. When the transaction is complete, PayPal will open the Return URL page that you specified when you set up the PayPal button on their system. If you give the pathname to your app, it will be opened. Check the location value to get the query string in the PayPal open page command.

Properties

hostedButtonID The ID number assigned by PayPal.
image Location of image, if other than default. Do not add files to /nsb.
TransactionType Buy, Donate, Subscribe or Unsubscribe. Kind of PayPal transaction. Determines which icon appears.
addField(field,value) Additional fields to send to PayPal. Both are strings Examples of fields are “item_name”, “item_number”,”custom”, where "custom" is a valid PayPal user defined field that is ultimately passed to the Instant Payment Notification server script. This is a runtime function.

Events

Standard events are supported.

Example

PayPal1.addField("custom","my custom string")

Output

(the PayPal payment screen appears)

Related Items

AdSense