#import <Foundation/Foundation.h>
#import <Capacitor/Capacitor.h>
#import "Plugin.h"
// Define the plugin using the CAP_PLUGIN Macro, and
// each method the plugin supports using the CAP_PLUGIN_METHOD macro.
CAP_PLUGIN(MyPago, "MyPago",
           CAP_PLUGIN_METHOD(echo, CAPPluginReturnPromise);
)



@implementation iZettlePago
    
    
-(int) pagar:(NSDecimalNumber *)monto uic:(UIViewController *)uic
  completion:(pagoComplete)completion;
    {
        [[iZettleSDK shared] chargeAmount:monto currency:nil reference: [[NSUUID UUID] UUIDString] presentFromViewController:uic completion:^(iZettleSDKPaymentInfo *paymentInfo, NSError *error) {
            self.paymentInfo = paymentInfo;
            self.error = error;
            completion();
        }];
        
        
        return 0;
    }
    
    @end
