// Copyright © 2022 Olo Inc. All rights reserved.
// This software is made available under the Olo Pay SDK License (See LICENSE.md file)
//
//  PaymentCardDetailsViewManager.m
//  OlopaysdkReactNative
//
//  Created by Justin Anderson on 3/2/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(PaymentCardDetailsViewManager, 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(createPaymentMethod:(nonnull NSNumber *)node
                  withResolver:(RCTPromiseResolveBlock)resolve
                  withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXPORT_VIEW_PROPERTY(onCardChangeEvent, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onFocusEvent, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onFocusFieldEvent, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onBlurEvent, RCTDirectEventBlock)
RCT_EXPORT_VIEW_PROPERTY(postalCodeEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(isEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(placeholders, NSDictionary)
RCT_EXPORT_VIEW_PROPERTY(cardStyles, NSDictionary)
RCT_EXPORT_VIEW_PROPERTY(customErrorMessages, NSDictionary)

@end
