BTPayPalCheckoutRequest
@objcMembers
public class BTPayPalCheckoutRequest : NSObject, BTPayPalRequest
Options for the PayPal Checkout flow.
-
init(amount:enablePayPalAppSwitch: userAuthenticationEmail: intent: userAction: offerPayLater: currencyCode: requestBillingAgreement: contactPreference: offerCredit: ) 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
amountRequired: 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.
enablePayPalAppSwitchRequired: Used to determine if the customer will use the PayPal app switch flow.
userAuthenticationEmailOptional: User email to initiate a quicker authentication flow in cases where the user has a PayPal Account with the same email.
intentOptional: Payment intent. Defaults to
.authorize. Only applies to PayPal Checkout.userActionOptional: Changes the call-to-action in the PayPal Checkout flow. Defaults to
.none.offerPayLaterOptional: Offers PayPal Pay Later if the customer qualifies. Defaults to
false. Only available with PayPal Checkout.currencyCodeOptional: 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.
requestBillingAgreementOptional: 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 tofalse.contactPreferenceOptional: Preference for the contact information section within the payment flow. Defaults to
.noneif not set.offerCreditOptional: Offers PayPal Credit if the customer qualifies. Defaults to
false. -
init(amount:intent: userAction: offerPayLater: amountBreakdown: billingAgreementDescription: contactInformation: contactPreference: currencyCode: displayName: enablePayPalAppSwitch: isShippingAddressEditable: isShippingAddressRequired: landingPageType: lineItems: localeCode: merchantAccountID: recurringBillingDetails: recurringBillingPlanType: requestBillingAgreement: riskCorrelationID: shippingAddressOverride: shippingCallbackURL: shopperSessionID: userAuthenticationEmail: userPhoneNumber: offerCredit: ) 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
amountRequired. 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.
intentOptional: Payment intent. Defaults to
.authorize. Only applies to PayPal Checkout.userActionOptional: Changes the call-to-action in the PayPal Checkout flow. Defaults to
.none.offerPayLaterOptional: Offers PayPal Pay Later if the customer qualifies. Defaults to
false. Only available with PayPal Checkout.amountBreakdownOptional: Breakdown of items associated to the total cost.
billingAgreementDescriptionOptional: Display a custom description to the user for a billing agreement. For Checkout with Vault flows, you must also set.
contactInformationOptional: Contact information of the recipient for the order.
contactPreferenceOptional: Preference for the contact information section within the payment flow. Defaults to
.noneif not set.currencyCodeOptional: 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.
displayNameOptional: The merchant name displayed inside of the PayPal flow; defaults to the company name on your Braintree account.
enablePayPalAppSwitchRequired: 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.isShippingAddressEditableDefaults to false. Set to true to enable user editing of the shipping address.
isShippingAddressRequiredDefaults to false. When set to true, the shipping address selector will be displayed.
landingPageTypeOptional: Landing page type. Defaults to
.none.lineItemsOptional: The line items for this transaction. It can include up to 249 line items.
localeCodeOptional: A locale code to use for the transaction.
merchantAccountIDOptional: A non-default merchant account to use for tokenization.
recurringBillingDetailsOptional: Recurring billing product details.
recurringBillingPlanTypeOptional: Recurring billing plan type, or charge pattern.
requestBillingAgreementOptional: 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 tofalse.riskCorrelationIDOptional: A risk correlation ID created with Set Transaction Context on your server.
shippingAddressOverrideOptional: A valid shipping address to be displayed in the transaction flow. An error will occur if this address is not valid.
shippingCallbackURLOptional: 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.
shopperSessionIDOptional: The shopper session ID returned from your shopper insights server SDK integration.
userAuthenticationEmailOptional: User email to initiate a quicker authentication flow in cases where the user has a PayPal Account with the same email.
userPhoneNumberOptional: 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.
offerCreditOptional: Offers PayPal Credit if the customer qualifies. Defaults to
false.
View on GitHub