BTPayPalCheckoutRequest
@objcMembers
open class BTPayPalCheckoutRequest : BTPayPalRequest
Options for the PayPal Checkout flow.
-
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.
Declaration
Swift
public var amount: String
-
Optional: Payment intent. Defaults to
.authorize
. Only applies to PayPal Checkout.Declaration
Swift
public var intent: BTPayPalRequestIntent
-
Optional: Changes the call-to-action in the PayPal Checkout flow. Defaults to
.none
.Declaration
Swift
public var userAction: BTPayPalRequestUserAction
-
Optional: Offers PayPal Pay Later if the customer qualifies. Defaults to
false
. Only available with PayPal Checkout.Declaration
Swift
public var offerPayLater: Bool
-
Optional: A three-character ISO-4217 ISO currency code to use for the transaction. Defaults to merchant currency code if not set.
Note
See https://developer.paypal.com/docs/api/reference/currency-codes/ for a list of supported currency codes.Declaration
Swift
public var currencyCode: String?
-
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 tofalse
.Declaration
Swift
public var requestBillingAgreement: Bool
-
Optional: Contact information of the recipient for the order
Declaration
Swift
public var contactInformation: BTContactInformation?
-
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.
Declaration
Swift
public var shippingCallbackURL: URL?
-
Optional: Preference for the contact information section within the payment flow. Defaults to
BTContactPreference.noContactInformation
if not set.Declaration
Swift
public var contactPreference: BTContactPreference
-
init(userAuthenticationEmail:
enablePayPalAppSwitch: amount: intent: userAction: offerPayLater: currencyCode: requestBillingAgreement: contactPreference: ) 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( userAuthenticationEmail: String, enablePayPalAppSwitch: Bool, amount: String, intent: BTPayPalRequestIntent = .authorize, userAction: BTPayPalRequestUserAction = .none, offerPayLater: Bool = false, currencyCode: String? = nil, requestBillingAgreement: Bool = false, contactPreference: BTContactPreference = .none )
Parameters
userAuthenticationEmail
Required: User email to initiate a quicker authentication flow in cases where the user has a PayPal Account with the same email.
enablePayPalAppSwitch
Required: Used to determine if the customer will use the PayPal app switch flow.
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.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 tofalse
. -
init(amount:
intent: userAction: offerPayLater: currencyCode: requestBillingAgreement: shippingCallbackURL: userAuthenticationEmail: ) Initializes a PayPal Native Checkout request
Declaration
Swift
public init( amount: String, intent: BTPayPalRequestIntent = .authorize, userAction: BTPayPalRequestUserAction = .none, offerPayLater: Bool = false, currencyCode: String? = nil, requestBillingAgreement: Bool = false, shippingCallbackURL: URL? = nil, userAuthenticationEmail: String? = nil )
Parameters
amount
Used for a one-time payment. Amount must be greater than or equal to zero, may optionally contain exactly 2 decimal places separated by ‘.’
intent
Optional: Payment intent. Defaults to
.authorize
. Only applies to PayPal Checkout. and is limited to 7 digits before the decimal point.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 tofalse
.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.
userAuthenticationEmail
Optional: User email to initiate a quicker authentication flow in cases where the user has a PayPal Account with the same email.