SQRDMoney

@interface SQRDMoney : NSObject <NSCopying>

Represents an amount of money.

  • Create a new SQRDMoney instance.

    The currency is set automatically based on the currency of the authorized location at the time of checkout.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAmount:(NSInteger)amount;

    Swift

    init(amount: Int)

    Parameters

    amount

    The monetary amount, specified as a non-negative integer in the smallest currency denomination of the authorized location. For example, when the location’s currency is USD, the amount is in cents.

  • Create a new SQRDMoney instance.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithAmount:(NSInteger)amount
                              currencyCode:(SQRDCurrencyCode)currencyCode;

    Swift

    init(amount: Int, currencyCode: SQRDCurrencyCode)

    Parameters

    amount

    The monetary amount, specified as a non-negative integer in the smallest currency denomination of the authorized location. For example, when the currencyCode is .usd, the amount is in cents.

    currencyCode

    The currency code (for example, the currency code for the US Dollar is .usd).

  • The amount of money in the smallest denomination of the currency.

    For example, when currencyCode is .usd, the amount is in cents.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSInteger amount;

    Swift

    var amount: Int { get }
  • The currency code.

    Declaration

    Objective-C

    @property (readonly, nonatomic) SQRDCurrencyCode currencyCode;

    Swift

    var currencyCode: SQRDCurrencyCode { get }