BTPayPalCheckoutRequest

@objcMembers
public class BTPayPalCheckoutRequest : NSObject, BTPayPalRequest

Options for the PayPal Checkout flow.

Initializer

  • Initializes a PayPal Checkout request for the PayPal App Switch flow

    Warning

    This initializer should be used for merchants using the PayPal App Switch flow. This feature is currently in beta and may change or be removed in future releases.

    Note

    The PayPal App Switch flow currently only supports the production environment.

    Declaration

    Swift

    public convenience init(
        amount: String,
        enablePayPalAppSwitch: Bool,
        userAuthenticationEmail: String? = nil,
        intent: BTPayPalRequestIntent = .authorize,
        userAction: BTPayPalRequestUserAction = .none,
        offerPayLater: Bool = false,
        currencyCode: String? = nil,
        requestBillingAgreement: Bool = false,
        contactPreference: BTContactPreference = .none,
        offerCredit: Bool = false
    )

    Parameters

    amount

    Required: Used for a one-time payment. Amount must be greater than or equal to zero, may optionally contain exactly 2 decimal places separated by ‘.’ and is limited to 7 digits before the decimal point.

    enablePayPalAppSwitch

    Required: Used to determine if the customer will use the PayPal app switch flow.

    userAuthenticationEmail

    Optional: User email to initiate a quicker authentication flow in cases where the user has a PayPal Account with the same email.

    intent

    Optional: Payment intent. Defaults to .authorize. Only applies to PayPal Checkout.

    userAction

    Optional: Changes the call-to-action in the PayPal Checkout flow. Defaults to .none.

    offerPayLater

    Optional: Offers PayPal Pay Later if the customer qualifies. Defaults to false. Only available with PayPal Checkout.

    currencyCode

    Optional: A three-character ISO-4217 ISO currency code to use for the transaction. Defaults to merchant currency code if not set. See https://developer.paypal.com/docs/api/reference/currency-codes/ for a list of supported currency codes.

    requestBillingAgreement

    Optional: If set to true, this enables the Checkout with Vault flow, where the customer will be prompted to consent to a billing agreement during checkout. Defaults to false.

    contactPreference

    Optional: Preference for the contact information section within the payment flow. Defaults to .none if not set.

    offerCredit

    Optional: Offers PayPal Credit if the customer qualifies. Defaults to false.

  • Initializes a PayPal Checkout request

    Declaration

    Swift

    public init(
        amount: String,
        intent: BTPayPalRequestIntent = .authorize,
        userAction: BTPayPalRequestUserAction = .none,
        offerPayLater: Bool = false,
        amountBreakdown: BTAmountBreakdown? = nil,
        billingAgreementDescription: String? = nil,
        contactInformation: BTContactInformation? = nil,
        contactPreference: BTContactPreference = .none,
        currencyCode: String? = nil,
        displayName: String? = nil,
        enablePayPalAppSwitch: Bool = false,
        isShippingAddressEditable: Bool = false,
        isShippingAddressRequired: Bool = false,
        landingPageType: BTPayPalRequestLandingPageType = .none,
        lineItems: [BTPayPalLineItem]? = nil,
        localeCode: BTPayPalLocaleCode = .none,
        merchantAccountID: String? = nil,
        recurringBillingDetails: BTPayPalRecurringBillingDetails? = nil,
        recurringBillingPlanType: BTPayPalRecurringBillingPlanType? = nil,
        requestBillingAgreement: Bool = false,
        riskCorrelationID: String? = nil,
        shippingAddressOverride: BTPostalAddress? = nil,
        shippingCallbackURL: URL? = nil,
        shopperSessionID: String? = nil,
        userAuthenticationEmail: String? = nil,
        userPhoneNumber: BTPayPalPhoneNumber? = nil,
        offerCredit: Bool = false
    )

    Parameters

    amount

    Required. Used for a one-time payment. Amount must be greater than or equal to zero, may optionally contain exactly 2 decimal places separated by ‘.’ and is limited to 7 digits before the decimal point.

    intent

    Optional: Payment intent. Defaults to .authorize. Only applies to PayPal Checkout.

    userAction

    Optional: Changes the call-to-action in the PayPal Checkout flow. Defaults to .none.

    offerPayLater

    Optional: Offers PayPal Pay Later if the customer qualifies. Defaults to false. Only available with PayPal Checkout.

    amountBreakdown

    Optional: Breakdown of items associated to the total cost.

    billingAgreementDescription

    Optional: Display a custom description to the user for a billing agreement. For Checkout with Vault flows, you must also set.

    contactInformation

    Optional: Contact information of the recipient for the order.

    contactPreference

    Optional: Preference for the contact information section within the payment flow. Defaults to .none if not set.

    currencyCode

    Optional: A three-character ISO-4217 ISO currency code to use for the transaction. Defaults to merchant currency code if not set. See https://developer.paypal.com/docs/api/reference/currency-codes/ for a list of supported currency codes.

    displayName

    Optional: The merchant name displayed inside of the PayPal flow; defaults to the company name on your Braintree account.

    enablePayPalAppSwitch

    Required: Used to determine if the customer will use the PayPal app switch flow. Defaults to false. This property is currently in beta and may change or be removed in future releases.

    isShippingAddressEditable

    Defaults to false. Set to true to enable user editing of the shipping address.

    isShippingAddressRequired

    Defaults to false. When set to true, the shipping address selector will be displayed.

    landingPageType

    Optional: Landing page type. Defaults to .none.

    lineItems

    Optional: The line items for this transaction. It can include up to 249 line items.

    localeCode

    Optional: A locale code to use for the transaction.

    merchantAccountID

    Optional: A non-default merchant account to use for tokenization.

    recurringBillingDetails

    Optional: Recurring billing product details.

    recurringBillingPlanType

    Optional: Recurring billing plan type, or charge pattern.

    requestBillingAgreement

    Optional: If set to true, this enables the Checkout with Vault flow, where the customer will be prompted to consent to a billing agreement during checkout. Defaults to false.

    riskCorrelationID

    Optional: A risk correlation ID created with Set Transaction Context on your server.

    shippingAddressOverride

    Optional: A valid shipping address to be displayed in the transaction flow. An error will occur if this address is not valid.

    shippingCallbackURL

    Optional: Server side shipping callback URL to be notified when a customer updates their shipping address or options. A callback request will be sent to the merchant server at this URL.

    shopperSessionID

    Optional: The shopper session ID returned from your shopper insights server SDK integration.

    userAuthenticationEmail

    Optional: User email to initiate a quicker authentication flow in cases where the user has a PayPal Account with the same email.

    userPhoneNumber

    Optional: A user’s phone number to initiate a quicker authentication flow in the scenario where the user has a PayPal account identified with the same phone number.

    offerCredit

    Optional: Offers PayPal Credit if the customer qualifies. Defaults to false.