// Copyright © 2022 Olo Inc. All rights reserved.
// This software is made available under the Olo Pay SDK License (See LICENSE.md file)
//
//  PaymentCardCvvViewManager.m
//  OlopaysdkReactNative
//
//  Created by Justin Anderson on 8/23/23.
//  Copyright © 2023 Facebook. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "React/RCTViewManager.h"
#import "React/RCTUIManager.h"
#import "React/RCTLog.h"

@interface RCT_EXTERN_MODULE(PaymentCardCvvViewManager, RCTViewManager)
RCT_EXTERN_METHOD(focus:(nonnull NSNumber *)node
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(blur:(nonnull NSNumber *)node
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(clear:(nonnull NSNumber *)node
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(createCvvUpdateToken:(nonnull NSNumber *)node
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXPORT_VIEW_PROPERTY(onCvvChangeEvent, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onFocusEvent, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onBlurEvent, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(isEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(placeholder, NSString)
RCT_EXPORT_VIEW_PROPERTY(cvvStyles, NSDictionary)
RCT_EXPORT_VIEW_PROPERTY(customErrorMessages, NSDictionary)

@end
