diff --git a/src/PassKit/PKPayLaterView.cs b/src/PassKit/PKPayLaterView.cs index b9105c428999..2cbde81b2454 100644 --- a/src/PassKit/PKPayLaterView.cs +++ b/src/PassKit/PKPayLaterView.cs @@ -40,7 +40,7 @@ static void TrampolineValidateAmount (IntPtr block, byte eligible) [UnsupportedOSPlatform ("tvos")] #endif [BindingImpl (BindingImplOptions.Optimizable)] - public void ValidateAmount (NSDecimalNumber amount, string currencyCode, Action callback) + public static void ValidateAmount (NSDecimalNumber amount, string currencyCode, Action callback) { if (callback is null) ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (callback)); diff --git a/src/passkit.cs b/src/passkit.cs index 7cb7cbb11420..265f3c138d44 100644 --- a/src/passkit.cs +++ b/src/passkit.cs @@ -2759,7 +2759,7 @@ interface PKDeferredPaymentRequest { [BaseType (typeof (UIView))] [DisableDefaultCtor] interface PKPayLaterView { - // [DesignatedInitializer] + [Export ("initWithAmount:currencyCode:")] NativeHandle Constructor (NSDecimalNumber amount, string currencyCode); diff --git a/tests/introspection/ApiCtorInitTest.cs b/tests/introspection/ApiCtorInitTest.cs index 756d723da6ee..970cd6e11422 100644 --- a/tests/introspection/ApiCtorInitTest.cs +++ b/tests/introspection/ApiCtorInitTest.cs @@ -511,6 +511,11 @@ protected virtual bool Match (ConstructorInfo ctor, Type type) if (cstr == "Void .ctor(System.String, Foundation.NSBundle)") return true; break; + case "PKPayLaterView": + // headers have: (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; + if (cstr == "Void .ctor(CoreGraphics.CGRect)") + return true; + break; case "VNDetectedPoint": // This class is not meant to be instantiated if (cstr == "Void .ctor(Double, Double)") diff --git a/tests/monotouch-test/PassKit/PKPayLaterViewTest.cs b/tests/monotouch-test/PassKit/PKPayLaterViewTest.cs index f3602877dcc4..c92c59e59e0e 100644 --- a/tests/monotouch-test/PassKit/PKPayLaterViewTest.cs +++ b/tests/monotouch-test/PassKit/PKPayLaterViewTest.cs @@ -17,14 +17,11 @@ public void ValidateAmountTest () { TestRuntime.AssertXcodeVersion (15, 0); - var payLaterView = new PKPayLaterView (new NSDecimalNumber (100), "USD"); - // From testing with Xcode 15.0.0, all values give the value of false to the completion handler. // Perhaps this will change in the future. - // Also appears to be a static method in Xcode 15.0.0 but not in the headers or docs. // Apple feedback was submitted here: https://feedbackassistant.apple.com/feedback/13268898 for (int i = 0; i < 1000; i++){ - payLaterView.ValidateAmount (new NSDecimalNumber (i), "USD", (eligible) => { + PKPayLaterView.ValidateAmount (new NSDecimalNumber (i), "USD", (eligible) => { Assert.False (eligible); }); }