// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_CHROME_BROWSER_AUTOFILL_MANUAL_FILL_MODEL_MANUAL_FILL_FULL_CARD_REQUESTER_H_
#define IOS_CHROME_BROWSER_AUTOFILL_MANUAL_FILL_MODEL_MANUAL_FILL_FULL_CARD_REQUESTER_H_

#import <UIKit/UIKit.h>

#import "components/autofill/core/browser/data_model/payments/credit_card.h"
#import "ios/chrome/browser/autofill/manual_fill/public/manual_fill_constants.h"
#import "url/origin.h"

class ProfileIOS;

namespace autofill {
class CreditCard;
}  // namespace autofill

class WebStateList;

@protocol FullCardRequestResultDelegateObserving;

// Bridge between manual fill credit card and payments' FullCardRequester to
// let user 'unlock' server side credit card by input correct CVC.
@interface ManualFillFullCardRequester : NSObject

// Inits the requests with required parameters and the `delegate` to receive the
// success/failure state of the request.
- (instancetype)initWithProfile:(ProfileIOS*)profile
                   webStateList:(WebStateList*)webStateList
                 resultDelegate:
                     (id<FullCardRequestResultDelegateObserving>)delegate;

// Executes the request, putting up a CVC input requester then unlocking a
// server side credit card if the CVC is correct. The delegate will receive the
// result of the operation.
- (void)requestFullCreditCard:(const autofill::CreditCard)card
       withBaseViewController:(UIViewController*)viewController
                   recordType:(autofill::CreditCard::RecordType)recordType
                    fieldType:(manual_fill::PaymentFieldType)fieldType
                       origin:(url::Origin)origin;

@end

#endif  // IOS_CHROME_BROWSER_AUTOFILL_MANUAL_FILL_MODEL_MANUAL_FILL_FULL_CARD_REQUESTER_H_
