我正在使用 Objective Sharpie 为 WePay.iOS SDK 创建一个 Xamarin 绑定。https://github.com/wepay/wepay-ios
我设法构建了 APIDefinition.cs 和 StructsAndEnums.cs 文件。但是,当我创建绑定项目时,它没有编译成功。
[Export ("initWithSwipedInfo:")]
IntPtr Constructor (NSObject swipedInfo);
// -(instancetype)initWithEMVInfo:(id)emvInfo;
[Export ("initWithEMVInfo:")]
IntPtr Constructor (NSObject emvInfo);
我了解我需要将 NSOBject 更改为正确的数据类型。但是,当我查看 Objective C 文件时。我无法真正理解我应该使用什么数据类型。如果有人可以指导我,我将不胜感激。
Objective-C 类
@interface WPPaymentInfo : NSObject
@property (nonatomic, strong, readonly) NSString *firstName;
@property (nonatomic, strong, readonly) NSString *lastName;
@property (nonatomic, strong, readonly) NSString *email;
@property (nonatomic, strong, readonly) NSString *paymentDescription;
@property (nonatomic, readonly) BOOL isVirtualTerminal;
@property (nonatomic, strong, readonly) WPAddress *billingAddress;
@property (nonatomic, strong, readonly) WPAddress *shippingAddress;
@property (nonatomic, strong, readonly) id paymentMethod;
@property (nonatomic, strong, readonly) id swiperInfo;
@property (nonatomic, strong, readonly) id manualInfo;
@property (nonatomic, strong, readonly) id emvInfo;
- (instancetype) initWithSwipedInfo:(id)swipedInfo;
- (instancetype) initWithEMVInfo:(id)emvInfo;
- (instancetype) initWithFirstName:(NSString *)firstName
lastName:(NSString *)lastName
email:(NSString *)email
billingAddress:(WPAddress *)billingAddress
shippingAddress:(WPAddress *)shippingAddress
cardNumber:(NSString *)cardNumber
cvv:(NSString *)cvv
expMonth:(NSString *)expMonth
expYear:(NSString *)expYear
virtualTerminal:(BOOL)virtualTerminal;
- (void) addEmail:(NSString *)email;
@end