paypal-api-0.2: PayPal API, currently supporting "ButtonManager"

Safe HaskellSafe-Infered

Network.PayPal.ButtonManager

Contents

Synopsis

Requests

data CreateButton buttonCode buttonType Source

Constructors

CreateButton 

Fields

cbVariables :: Variables buttonType
 
cbButtonSubtype :: Maybe ButtonSubtype
 
cbOptions :: Options
 
cbButtonImage :: Maybe (Either ButtonImageType ByteString)

Either the button image type, or the button image URL.

cbButtonText :: ButtonText buttonType
 
cbCountry :: Maybe ByteString
 
cbLanguage :: Maybe ByteString
 
cbExtras :: [(ByteString, ByteString)]
 

Instances

Show (PayPalResponse (CreateButton (NONHOSTED bc) bt)) 
Show (PayPalResponse (CreateButton HOSTED bt)) 
(Show (Variables buttonType), Show (ButtonText buttonType)) => Show (CreateButton buttonCode buttonType) 
(ToText (NONHOSTED buttonCode), ButtonType bt) => PayPalRequest (CreateButton (NONHOSTED buttonCode) bt) 
ButtonType bt => PayPalRequest (CreateButton HOSTED bt) 
(ToText (NONHOSTED buttonCode), ButtonType bt) => ToVariables (CreateButton (NONHOSTED buttonCode) bt) 
ButtonType bt => ToVariables (CreateButton HOSTED bt) 

Responses

Button codes

data ENCRYPTED Source

Button code value

data CLEARTEXT Source

Button code value

data TOKEN Source

Button code value

Instances

Button types

data BUYNOW Source

Button type value

data CART Source

Button type value

data DONATE Source

Button type value

data VIEWCART Source

Button type value

Variables profiles

data Item bt Source

Constructors

Item 

Fields

itAmount :: Amount bt

The price or amount of the item. Required for Add to Cart buttons. May not be used when a dropdown with price (L_OPTION0PRICEn) is defined. Limitations: Value must be a positive number. No currency symbol. Must have two decimal places, decimal separator must be a period (.), and the optional thousands separator must be a comma (,).

itItemName :: Maybe Text

Description of item. If omitted, payers enter their own name at the time of payment.

itBusiness :: Maybe ByteString

Secure Merchant ID or Email Address. When omitted, defaults to the secure merchant ID of the merchant. If an email address is specified then it the following requirements apply: A merchant or 3rd Party calling the API directly may specify an unregistered email and create an unencrypted button only. A 3rd Party calling the API on behalf of a registered merchant must specify an email address associated with the merchant account. Character length and limitations: 127 single-byte characters.

itItemNumber :: Maybe ByteString

Item number or ID. Character length and limitations: 127 single-byte alphanumeric characters.

itQuantity :: Maybe Int

Number of items. If profile-based shipping rates are configured with a basis of quantity, the sum of quantity values is used to calculate the shipping charges for the transaction. PayPal appends a sequence number to uniquely identify the item in the PayPal Shopping Cart (e.g., quantity1, quantity2). Note: The value for quantity must be a positive integer. Null, zero, or negative numbers are not allowed.

itShipping :: Shipping bt

The cost of shipping this item. If you specify shipping and shipping2 is not defined, this flat amount is charged regardless of the quantity of items purchased. This use of the shipping variable is valid only for Buy Now and Add to Cart buttons. Default - If profile-based shipping rates are configured, buyers are charged an amount according to the shipping methods they choose.

itShipping2 :: Shipping bt

The cost of shipping each additional unit of this item. If omitted and profile-based shipping rates are configured, buyers are charged an amount according to the shipping methods they choose. Valid only for Buy Now and Add to Cart buttons.

itTax :: Maybe Rational

Transaction-based tax override variable. Set this to a flat tax amount to apply to the transaction regardless of the buyer's location. This value overrides any tax settings set in your account profile. Valid only for Buy Now and Add to Cart buttons. Default - Profile tax settings, if any, apply.

itTaxRate :: Maybe Double

Transaction-based tax override variable. Set this to a percentage that will be applied to amount multiplied the quantity selected during checkout. This value overrides any tax settings set in your account profile. Allowable values are numbers 0.001 through 100. Valid only for Buy Now and Add to Cart buttons. Default - Profile tax settings, if any, apply.

itUndefinedQuantity :: UndefinedQuantity bt

True = allows buyers to specify the quantity.

itWeight :: Maybe (Double, WeightUnit)

Weight of items. If profile-based shipping rates are configured with a basis of weight, the sum of weight values is used to calculate the shipping charges for the transaction.

Instances

data Subscription Source

Constructors

Subscription 

Fields

suBusiness :: ByteString

Your PayPal ID or an email address associated with your PayPal account. Email addresses must be confirmed.

suItemName :: Maybe ByteString

Description of item being sold (maximum 127 characters). If you are collecting aggregate payments, this can include a summary of all items purchased, tracking numbers, or generic terms such as subscription. If omitted, customer will see a field in which they have the option of entering an Item Name

suCurrencyCode :: Maybe ByteString

The currency of prices for trial periods and the subscription. The default is USD.

suTrialPeriod :: Maybe (PeriodicPrice, Maybe PeriodicPrice)

Trial period 1 price. For a free trial period, specify 0. Trial period 2 price. Can be specified only if you also specify a1.

suRegularPrice :: PeriodicPrice
 
suRecurring :: Maybe (Int, Bool)

Nothing = Subscription payments do not recur. Just (times, reattempt) = Subscription payments recur. times = Number of times that subscription payments recur. Specify an integer above 1. reattempt: false = do not reattempt failed recurring payments true = reattempt failed recurring payments before canceling

suCustom :: Maybe ByteString

User-defined field which will be passed through the system and returned in your merchant payment notification email. This field will not be shown to your subscribers. Default - No variable is passed back to you.

suInvoice :: Maybe ByteString

User-defined field which must be unique with each subscription. The invoice number will be shown to subscribers with the other details of their transactions

suModification :: Int

Modification behavior. Allowable values:

  • 0 - allows subscribers to only create new subscriptions
  • 1 - allows subscribers to modify their current subscriptions or sign up for new ones
  • 2 - allows subscribers to only modify their current subscriptions

The default value is 0.

suUserManage :: Bool

Set to 1 to have PayPal generate usernames and initial passwords for subscribers.

data Payment Source

Constructors

Payment 

Fields

payAddressOverride :: Maybe Bool

True: The address specified in prepopulation variables overrides the PayPal member's stored address. The payer is shown the passed-in address but cannot edit it. No address is shown if the address is not valid, such as missing required fields like country, or is not included at all.

payCurrencyCode :: Maybe ByteString

The currency of the payment. The default is USD. (3 chars)

payCustom :: Maybe ByteString

Passthrough variable never presented to the payer. Default - No variable is passed back to you.

payHandling :: Maybe Rational

Handling charges. This is not quantity-specific. The same handling cost applies, regardless of the number of items on the order. Default - No handling charges are included. (256 chars)

payInvoice :: Maybe ByteString

Passthrough variable you can use to identify your invoice number for this purchase. (127 chars) Default - No variable is passed back to you.

payTaxCart :: Maybe Rational

Cart-wide tax, overriding any individual item tax_x value

payWeight :: Maybe (Double, WeightUnit)

If profile-based shipping rates are configured with a basis of weight, PayPal uses this value to calculate the shipping charges for the transaction. This value overrides the weight values of individual items.

data ShoppingCart Source

Constructors

ShoppingCart 

Fields

caAction :: CartAction

Add an item to the PayPal Shopping Cart, OR, Display the contents of the PayPal Shopping Cart to the buyer, OR, Upload the contents of a third party shopping cart or a custom shopping cart.

caHandlingCart :: Maybe Rational

Single handling fee to be charged cart-wide. If handling_cart is used in multiple Add to Cart buttons, the handling_cart value of the first item is used.

caPaymentAction :: PaymentAction

Indicates whether the transaction is payment on a final sale or an authorization for a final sale, to be captured later. The default value is sale.

Set the value to authorization to place a hold on the PayPal account for the authorized amount. Set the value to order to authorize the transaction without placing a hold on the PayPal account.

Important: If you set paymentaction to order, you must use the Authorization & Capture API to authorize and capture the transaction payments. The merchant tools on the PayPal websitel let you capture payments only for authorizations, not for orders.

caShoppingURL :: Maybe ByteString

The URL of the page on the merchant website that buyers return to when they click the Continue Shopping button on the PayPal Shopping Cart page.

NOTE: If you use this, and the URL contains characters like % then PayPal will mangle them. Also, shopping_url doesn't work for the View Cart button. However, if you don't use this, PayPal seems to use the referrer URL, so it shouldn't be necessary to use this broken feature.

Supporting types

data Duration Source

Constructors

D 
W 
M 
Y 

data CartAction Source

Constructors

Add 
Display 
Upload 

Instances

data PeriodicPrice Source

Constructors

PeriodicPrice 

Fields

ppPrice :: Rational

a3 Price of subscription. Must be specified for Subscribe buttons. Value must be a positive number. No currency symbol. Must have two decimal places, decimal separator must be a period (.), and the optional thousands separator must be a comma (,).

ppCycle :: Int

p3 Regular billing cycle. Must be specified for Subscribe buttons. Limitations: Must be a positive integer greater than 0 and less than or equal to 30

ppCycleUnits :: Duration

t3 Regular billing cycle units. Must be specified for Subscribe buttons.

Instances

data ButtonImageType Source

Constructors

REG

Regular (default)

SML

Small

CC

small button image with credit card logos; not applicable for Unsubscribe or View Cart buttons

data BuyNowText Source

Constructors

BUYNOW_TEXT

Button text is Buy Now (default)

PAYNOW_TEXT

Button text is Pay Now

data UpdateButton buttonCode buttonType Source

Constructors

UpdateButton 

Fields

ubButtonID :: HostedButtonID
 
ubDetails :: CreateButton buttonCode buttonType
 

Instances

(Show (Variables buttonType), Show (ButtonText buttonType)) => Show (UpdateButton buttonCode buttonType) 

Options

data Option rank Source

Note: In PayPal naming, 'option' and 'select' are swapped around from the HTML naming.

Constructors

Option 

Fields

opName :: Text
 
opSelects :: [Select rank]
 

Instances

Show (RankPrice rank) => Show (Option rank) 

data Select rank Source

Constructors

Select 

Fields

seName :: Text
 
sePrice :: RankPrice rank
 

Instances

Show (RankPrice rank) => Show (Select rank) 

class Rank r whereSource

Associated Types

type RankPrice r :: *Source

Instances

data FIRST Source

Instances

data NONFIRST Source

Instances

Re-exports