Confidential & Proprietary

Class

MomentCashbackService


class MomentCashbackService {
    private init() {}
    
    // 사용자 ID 설정 (콜백 있음)
    func setUserId(_ userId: String, onComplete: CashbackCallbackPayload) {}
    
    // 캐시백 리스트 불러오기
    func listCashback(onComplete: @Sendable @MainActor @escaping (Result<[CashbackProgramType], Error>) -> Void) {
}

CashbackViewController

UIKit에서 캐시백 서비스 UI를 론칭할때 사용하는 클래스

public class CashbackViewController: UIViewController {
		// retun값을 받을 delegate
    public weak var delegate: CashbackViewControllerDelegate?
    // Redirect하고 싶은 URL
    public var redirectTo: String?
}

CashbackViewControllerDelegate

CashbackViewController 콜백 delegate protocol

public protocol CashbackViewControllerDelegate: AnyObject {
		// UI 화면에서 종료시 불림
		func cashbackViewControllerDidFinish(_ viewController: CashbackViewController)
		
		// UI 화면에서 에러가 발생했을 때
		func cashbackViewController(_ viewController: CashbackViewController, didFailWithError error: CashbackError)
}

CashbackError

// WARNING: case가 불러와지지 않습니다. CashbackError.rawValue (0,1, ...)로 이용이 필요합니다

public enum CashbackError: Error {
    /**
     * @case userIdNotFound
     * @discussion Indicates that no user ID could be found or retrieved,
     *           which is necessary for Moment cashback service activation.
     */
    case userIdNotFound = 0

    /**
     * @case initializationError
     * @discussion Indicates that an error occurred during CashbackUI initialization.
     * @param error The underlying error regarding initialization.
     */
    case initializationError(Error)
}

Callback