CreateOrderAction

@objc(PPCCreateOrderAction)
@objcMembers
class CreateOrderAction
extension CreateOrderAction : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Equatable, Hashable, NSObjectProtocol

CreateOrderAction object to be passed in CreateOrderCallback, allowing merchants options to create order and obtain EC-Token (or Pay-Token or Order ID), either by their own means or using built in functions in the SDK.

  • In case your request to create order fails, call this function instead of set(orderId:) in order to close the Paysheet.

    Declaration

    Swift

    func cancel()
  • Request the SDK to create an order and get an order ID with PayPal Orders API. Once completed, payToken is set with the order ID requested from Orders API to be used internally in the SDK. Documentation on Orders API: https://developer.paypal.com/docs/api/orders/v2/#orders_create

    Declaration

    Swift

    func create(order: OrderRequest, completion: @escaping (String?) -> Void = { _ in })

    Parameters

    order

    an OrderRequest object representing the order

    completion

    a closure with the order ID once the SDK finishes creating order

  • Interface to provide the SDK with a Billing Agreement token. This will trigger a fallback to a web experience for a user to log in and complete the agreement.

    Note

    To generate a billing agreement token using your server implementation, see our documentation on reference transactions

    Declaration

    Swift

    func set(billingAgreementToken: String)

    Parameters

    billingAgreementToken

    Billing agreement token

  • Set payToken to be used internally in the SDK if you have an order ID/pay token/EC token

    Declaration

    Swift

    func set(orderId: String)

    Parameters

    orderId

    an order ID/pay token/EC token

  • Interface to provide the SDK with a Vault approval session ID to let user add a funding instrument to vault to be used for future transactions.

    Note

    To generate a vault approval session ID using your server implementation, see our documentation on reference transactions

    Declaration

    Swift

    func set(vaultApprovalSessionID: String)

    Parameters

    vaultApprovalSessionID

    Vault approval session ID