PaymentMethodTypeMapper

@objc(DTPaymentMethodTypeMapper)
public class PaymentMethodTypeMapper : NSObject

Use this class to map the payment method identifiers from Datatrans to the PaymentMethodType.

  • This function returns the PaymentMethodType based on the Datatrans payment method identifier.

    Declaration

    Swift

    public static func toType(identifier: String) -> PaymentMethodType?

    Parameters

    identifier

    The payment method identifier from Datatrans

    Return Value

    The payment method type, e.g. Visa, or nil if identifier is invalid

  • This function returns the PaymentMethodType based on the Datatrans payment method identifier.

    This is for use from Objective-C only. The returned NSNumber contains the rawValue of a DTPaymentMethodType.

    Declaration

    Swift

    @objc(toTypeWithIdentifier:)
    public static func toTypeObjc(identifier: String) -> NSNumber?

    Parameters

    identifier

    The payment method identifier from Datatrans

    Return Value

    The payment method type, e.g. Visa, or nil if identifier is invalid

  • This function returns the payment method identifier based on the PaymentMethodType.

    Declaration

    Swift

    @objc
    public static func toIdentifier(type: PaymentMethodType) -> String

    Parameters

    type

    The payment method type, e.g. Visa

    Return Value

    The payment method identifier