ShippingChangeAction
@objc(PPCShippingChangeAction)
@objcMembers
class ShippingChangeAction
extension ShippingChangeAction : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Equatable, Hashable, NSObjectProtocol
Undocumented
-
This should only be used if not using the ‘patch’ function to update your order. If you are using the
reject
action you will need to resolve toapprove
in cases where you want to remove the error message. This will be set automatically if using the patch order request.Declaration
Swift
func approve()
-
Makes a request to the PayPal API to update an order.
Note
- Only compatible with orders generated by the PayPal
v2
API that are one time payment transactions. - Can only be applied to orders with the
CREATED
orAPPROVED
status. You cannot update an order with theCOMPLETED
status. - You will need to handle any errors vended on the order request as part of the patch function.
- You do not need to invoke
approve()
orrejected()
when patching an order. These actions will be updated based on the result of the patch request by the SDK.
Declaration
Swift
@available(*, deprecated, message: " This function will be removed in a future version. Calling this client side function will continue to work as expected, however we will soon only support server side integrations. ") func patch(request: PatchRequest, onComplete: @escaping (PatchActionSuccess?, Error?) -> Void)
Parameters
request
The request to update the order with.
- Currently supports the following:
shippingName
- add, replaceshippingAddress
- add, replaceshippingOptions
- add, replaceamount
- replace
onComplete
Closure invoked when the patch request has resolved. Asynchronously vends either a
PatchActionSuccess
or anError
object. - Only compatible with orders generated by the PayPal
-
Makes a request to the SDK to refresh the UI with an error message. This should be used in cases where you want to display an error message under the shipping address and redirect the user to select another address before continuing the checkout flow. This will be set automatically if using the patch order request.
Declaration
Swift
func reject()