Forum Xamarin Xamarin.iOS

Help with binding PaymentEngineMiddleware

DeanCleaverDeanCleaver USMember ✭✭✭

I'm trying to get this to work, but I must have made a mistake somewhere. This is the Delegate class (snipped down) as per the C headers:

@protocol PaymentEngineMiddlewareDelegate <NSObject>


    @brief Delegate method for startTransaction. 
    @param transResponse - Contains all the transaction response info from the gateway
-(void)transactionComplete :(PaymentEngineTransactionResponse *)transResponse;

    @brief Delegate method for device connected. The method gets called when the device is connected

  @brief Delegate method for device disconnected. The method gets called when the device is disconnected


For this, I have:

    // @interface PaymentEngineMiddlewareDelegate : NSObject
    interface PaymentEngineMiddlewareDelegate
        void TransactionComplete(PaymentEngineTransactionResponse transactionResponse);

        void DeviceConnected();

        void DeviceDisconnected();

Then for the PaymentEngineMiddleware class, the header has this:

@interface PaymentEngineMiddleware : NSObject

+ (PaymentEngineMiddleware *) getInstance;

@property(nonatomic, strong) id<PaymentEngineMiddlewareDelegate> delegate;

//------------------------------Device Methods------------------------------

    @brief This method must be called before starting any transaction. Use it to connect to a device.
    @param deviceName The name of the device such as icmp or castle
    @param setDelegate Sets to self

-(void)setDevice :(NSString *)deviceName :(id)setDelegate;


And for that, I have:

    // @interface PaymentEngineMiddleware : NSObject
    interface PaymentEngineMiddleware
        // +(id)getInstance;
        PaymentEngineMiddleware GetInstance { get; }

        [Export("delegate", ArgumentSemantic.Retain)]
        PaymentEngineMiddlewareDelegate Delegate { get; set; }

        void SetDevice(string deviceName, PaymentEngineMiddlewareDelegate setDelegate);

Is there anything obvious that I missed or got wrong?

Sign In or Register to comment.