如何在 Xamarin.forms 中将 Apple Pay 与 Stripe 集成?

How to Integrate Apple Pay with Stripe in Xamarin.forms?

我正在关注博客入口 https://agileapp.co/Stripe-and-ApplePay-with-Xamarin-Forms/,它告诉我们如何使用 Xamarin Forms 将 Stripe 与 Apple Pay 集成。

我遵循所有代码,唯一更改的是 PKPaymentRequest 的 PaymentButtonRenderer、CountryCode 和 CurrencyCode 属性,设置为在西班牙(ES 和 EUR)使用,当然还有我在苹果开发者门户中设置的 MerchantIdentifier .

我在 Stripe 中要做的所有事情都已经完成了。

如下图所示,付款没有完成,不知道为什么。我不知道我必须在哪里使用 Stripe (var myCharge = new ChargeCreateOptions()....) 设置付款,也许在 PCL ViewModel 中,在 PaymentWillAuthorize 或 PaymentDidAuthorize 中...但我有两个断点和PaymentDidAuthorize 永远不会中断,只有 PaymentWillAuthorize ,但我不知道如何在这些方法中编码。

另一件奇怪的事情是,如果我将 MerchantCapabilities 用作 PKMerchantCapability.ThreeDS,我会收到一条错误消息,告诉我 "Apple Pay is not available in my App",但如果我将其更改为 PKMerchantCapability.Debit,那么付款未完成。

你能告诉我哪里出了问题吗??

谢谢

一切正常,我只是重新创建了苹果商家证书,代码完成了它必须做的事情。

问题已解决,谢谢@karllekko