Skip to content

Commit

Permalink
fix test errors 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tj_devel709 committed Oct 12, 2023
1 parent 0f90a7e commit 6444d0f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
5 changes: 0 additions & 5 deletions src/PassKit/PKPayLaterView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ static void TrampolineValidateAmount (IntPtr block, bool eligible)
#if NET
[SupportedOSPlatform ("ios17.0")]
[UnsupportedOSPlatform ("macos")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
#else
[NoWatch, NoTV, NoMac, iOS (17, 0), NoMacCatalyst]
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public void ValidateAmount (NSDecimalNumber amount, string currencyCode, Action<bool> callback)
Expand All @@ -65,8 +62,6 @@ public void ValidateAmount (NSDecimalNumber amount, string currencyCode, Action<
[UnsupportedOSPlatform ("macos")]
[UnsupportedOSPlatform ("maccatalyst")]
[UnsupportedOSPlatform ("tvos")]
#else
[NoWatch, NoTV, NoMac, iOS (17, 0), NoMacCatalyst]
#endif
[DllImport (Constants.PassKitLibrary)]
unsafe static extern void PKPayLaterValidateAmount (NSDecimalNumber amount, IntPtr /* NSString */ currencyCode, BlockLiteral* callback);
Expand Down
11 changes: 11 additions & 0 deletions src/passkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1640,37 +1640,48 @@ interface PKDisbursementRequest {
#endif
PKPaymentSummaryItem [] SummaryItems { get; set; }

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[Export ("merchantIdentifier")]
string MerchantIdentifier { get; set; }

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[Export ("regionCode")]
string RegionCode { get; set; }

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[Export ("supportedNetworks", ArgumentSemantic.Copy)]
string [] SupportedNetworks { get; set; }

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[Export ("merchantCapabilities", ArgumentSemantic.Assign)]
PKMerchantCapability MerchantCapabilities { get; set; }

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[Export ("requiredRecipientContactFields", ArgumentSemantic.Strong)]
string [] RequiredRecipientContactFields { get; set; }

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[NullAllowed, Export ("recipientContact", ArgumentSemantic.Strong)]
PKContact RecipientContact { get; set; }

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[NullAllowed, Export ("supportedRegions", ArgumentSemantic.Copy)]
string [] SupportedRegions { get; set; }

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[NullAllowed, Export ("applicationData", ArgumentSemantic.Copy)]
NSData ApplicationData { get; set; }

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[Export ("initWithMerchantIdentifier:currencyCode:regionCode:supportedNetworks:merchantCapabilities:summaryItems:")]
NativeHandle Constructor (string merchantIdentifier, string currencyCode, string regionCode, string [] supportedNetworks, PKMerchantCapability merchantCapabilities, PKPaymentSummaryItem [] summaryItems);

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[Static]
[Export ("disbursementContactInvalidErrorWithContactField:localizedDescription:")]
NSError GetDisbursementContactInvalidError (string field, [NullAllowed] string localizedDescription);

[iOS (17,0), NoMac, NoWatch, NoTV, NoMacCatalyst]
[Static]
[Export ("disbursementCardUnsupportedError")]
NSError DisbursementCardUnsupportedError { get; }
Expand Down
10 changes: 5 additions & 5 deletions tests/monotouch-test/PassKit/PKPayLaterViewTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ public void ValidateAmountTest ()
{
TestRuntime.AssertXcodeVersion (15, 0);

var payLaterView = new PKPayLaterView (100, "USD");
payLaterView.ValidateAmount (50, "USD", (eligible) => {
var payLaterView = new PKPayLaterView (new NSDecimalNumber(50), "USD");
payLaterView.ValidateAmount (new NSDecimalNumber(50), "USD", (eligible) => {
Assert.True (eligible);
});

payLaterView.ValidateAmount (1, "USD", (eligible) => {
payLaterView.ValidateAmount (new NSDecimalNumber(1), "USD", (eligible) => {
Assert.False (eligible);
});

payLaterView.ValidateAmount (1000000, "USD", (eligible) => {
payLaterView.ValidateAmount (new NSDecimalNumber(1000000), "USD", (eligible) => {
Assert.False (eligible);
});

payLaterView.ValidateAmount (50, "USD", (eligible) => {
payLaterView.ValidateAmount (new NSDecimalNumber(50), "USD", (eligible) => {
Assert.True (eligible);
});
}
Expand Down
3 changes: 0 additions & 3 deletions tests/xtro-sharpie/iOS-PassKit.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@
!incorrect-protocol-member! PKAddSecureElementPassViewControllerDelegate::addSecureElementPassViewController:didFinishAddingSecureElementPass:error: is OPTIONAL and should NOT be abstract
!extra-null-allowed! 'System.Void PassKit.PKDisbursementRequest::set_CurrencyCode(System.String)' has a extraneous [NullAllowed] on parameter #0
!extra-null-allowed! 'System.Void PassKit.PKDisbursementRequest::set_SummaryItems(PassKit.PKPaymentSummaryItem[])' has a extraneous [NullAllowed] on parameter #0

# No longer used enum, will be removed in XAMCORE_5_0
!unknown-native-enum! PKDisbursementRequestSchedule bound

0 comments on commit 6444d0f

Please sign in to comment.