小编Joh*_*ode的帖子

使用 Stripe 的 Payment Intent API 接受 Xamarin Forms 付款

我已经使用 Stripe.net 在后端实现了付款,现在我有一个用 Xamarin 编写的移动客户端,我想用它批准信用卡付款。但我在网上找到的所有示例都使用 Charge API。我在后端使用 PaymentIntentAPI,这会根据请求返回客户端密钥。

我的问题是:如何使用 Stripe.net 包和 PaymentIntent API 确认付款?

下面是在 android 上用 java 完成的方法:

 stripe = new Stripe(
                    context,
                    PaymentConfiguration.getInstance(context).getPublishableKey()
            );
            stripe.confirmPayment(this, confirmParams);
Run Code Online (Sandbox Code Playgroud)

使用 dotnet 中旧的收费 API,其操作方法如下:

 StripeConfiguration.SetApiKey("pk_test_xxxxxxxxxxxxxxxxx");

var tokenOptions = new StripeTokenCreateOptions()
{
    Card = new StripeCreditCardOptions()
    {
        Number = cardNumber,
        ExpirationYear = cardExpYear,
        ExpirationMonth = cardExpMonth,
        Cvc = cardCVC
    }
};

var tokenService = new StripeTokenService();
StripeToken stripeToken = tokenService.Create(tokenOptions);
Run Code Online (Sandbox Code Playgroud)

c# stripe-payments xamarin.forms

7
推荐指数
1
解决办法
3313
查看次数

无法访问 ASP.net core 3.0 中的用户机密

我的问题很简单。我有一个 ASP.net core 3.0 应用程序,我使用 Visualstudio 添加了机密,并正常将我的机密粘贴到机密文件中。然后在我的 Program.cs 中,我添加了对 addusersecrets 的调用,如下所示:

...
...
.AddUserSecrets<Startup>()
Run Code Online (Sandbox Code Playgroud)

但是,当像Configuration["Authentication:Secret"]我以前在 appsettings.json 中那样调用我的秘密时,我得到一个 null 值作为返回。

我浏览了 stackoverflow 并尝试了解决方案,例如更改我的 addsecrets,如下所示:

.AddUserSecrets("fds...-...-...askd")

//OR

.AddUserSecrets(typeof(Startup).Assembly, true, reloadOnChange: true)

Run Code Online (Sandbox Code Playgroud)

但这些都不起作用。

我想知道这个秘密的东西是否适用于 ASP.NET Core,因为我没有看到我的代码不起作用的任何原因。如果有人得到它,你能告诉我解决方案吗?谢谢。

c# asp.net-core-mvc .net-core asp.net-core asp.net-core-3.0

5
推荐指数
2
解决办法
1万
查看次数

无法使用 iOS 15 模拟器将我的 Xamarin 应用程序部署到 iPhone 13

我已将 xcode 13 和 Visualstudio for mac 更新至版本 8.10.12。现在我有了 iPhone 13 模拟器和 iOS 15。问题是,当我尝试调试我的应用程序时,我从 Visual Studio 收到此错误。

\n
\n

错误 HE0046:无法在设备“iOS 15.0 (19A339) - iPhone 13 mini”上安装应用程序“ma.myapp.app”:\xe2\x80\x9cMyapp\xe2\x80\x9d 需要更新

\n
\n

在 info.plist 中,最低版本设置为 iOS 9\n我不明白为什么我的应用程序可以在 iOS 14 上完美运行,但不能在 15 上运行。有人可以帮忙吗?

\n

xamarin.ios ios15

2
推荐指数
1
解决办法
2110
查看次数