PatchRequest
@objc(PPCPatchRequest)
@objcMembers
class PatchRequest
extension PatchRequest : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Equatable, Hashable, NSObjectProtocol
Represents each operation and their accepted path, as well as the paths accepted value for each type. Patch Order Documentation
Note
- To make an update, you may optionally provide a
reference_id
. If you omit areference_id
, PayPal defaults to areference_id
ofdefault
.
-
Adds a
shippingAddress
to the order request.Declaration
Swift
func add(shippingAddress: OrderAddress, referenceId: String? = nil)
Parameters
shippingAddress
The address of the person to whom to ship the items.
referenceId
The API caller-provided external ID for the purchase unit if more than one purchase unit was provided.
-
Adds a
shippingName
to the order request.Declaration
Swift
func add(shippingName: PurchaseUnit.ShippingName, referenceId: String? = nil)
Parameters
shippingName
The name of the person to whom to ship the items. Supports only the
full_name
property.referenceId
The API caller-provided external ID for the purchase unit if more than one purchase unit was provided.
-
Adds
shippingOptions
to the order requestDeclaration
Swift
func add(shippingOptions: [ShippingMethod], referenceId: String? = nil)
Parameters
shippingOptions
A list of shipping options for the order.
referenceId
The API caller-provided external ID for the purchase unit if more than one purchase unit was provided.
-
Replaces the
amount
of the order request.Declaration
Swift
func replace(amount: PurchaseUnit.Amount, referenceId: String? = nil)
Parameters
amount
The total order amount with an optional breakdown that provides details, such as the total item amount, total tax amount, shipping, handling, insurance, and discounts, if any.
referenceId
The API caller-provided external ID for the purchase unit if more than one purchase unit was provided.
-
Replaces the
shippingAddress
of the order request.Declaration
Swift
func replace(shippingAddress: OrderAddress, referenceId: String? = nil)
Parameters
shippingAddress
The address of the person to whom to ship the items.
referenceId
The API caller-provided external ID for the purchase unit if more than one purchase unit was provided.
-
Replaces the
shippingName
of the order request.Declaration
Swift
func replace(shippingName: PurchaseUnit.ShippingName, referenceId: String? = nil)
Parameters
shippingName
The name of the person to whom to ship the items. Supports only the
full_name
property.referenceId
The API caller-provided external ID for the purchase unit if more than one purchase unit was provided.
-
Replaces the
shippingOptions
of the order request.Declaration
Swift
func replace(shippingOptions: [ShippingMethod], referenceId: String? = nil)
Parameters
shippingOptions
A list of shipping options for the order.
referenceId
The API caller-provided external ID for the purchase unit if more than one purchase unit was provided.