Check Transaction Status with myPOS iOS SDK

This guide shows you how to check the status of a payment or refund in your iOS app using the myPOS SDK. Follow the steps below to easily track your transactions.

What You Need:

  • Order ID – The unique identifier for the transaction
  • Transaction Type – Specify if it’s a Purchase or a Refund

How to Check Transaction Status

Use the getOrderStatusFor method to retrieve:

  • The status of the transaction
  • The transaction reference

Swift

Swift
MobilePaymentSDK.getOrderStatusFor(orderId,
                                   transactionType: type,
                                   completed: { (status, reference) in
                                    self.showAlertWithText("Order \(orderId). " +
                                                           "Status - \(status) | " +
                                                           "Reference - \(reference)")
},
                                   failed: { (error) in
                                    self.showAlertWithText("Error while getting order status: " +
                                                           "\(error.message)")
})

Objective-C

Objective-C
[MobilePaymentSDK getOrderStatusFor:_orderId
                    transactionType:_transactionType
                          completed:^(NSInteger status, NSString * _Nonnull paymentRef) {
                              [self showAlertWithText:[NSString stringWithFormat:
                                                      @"Order %@. Status - %ld | Reference - %@",
                                                      orderId, status, paymentRef]];
                           } failed:^(MobilePaymentSDKError * _Nonnull error) {
                              [self showAlertWithText:[NSString stringWithFormat:
                                                      @"Error while getting order status: %ld", status]];
                           }];

Pro Tip

Always check both the status and the transaction reference to accurately track payments or refunds in your system!