条:客户订购计划时,如何从订购中映射优惠券代码? (.net代码)

问题描述 投票:0回答:1

我正在使用以下代码为我的网站创建订阅付款模型。如何在给定的代码中添加优惠券功能? (.net代码)

        StripeConfiguration.ApiKey = _skApikey;
        var options = new SessionCreateOptions
        {
            PaymentMethodTypes = new List<string> {

                "card",
            },

            SubscriptionData = new SessionSubscriptionDataOptions
            {

                Items = new List<SessionSubscriptionDataItemOptions> {
                    new SessionSubscriptionDataItemOptions {
                        Plan = _planId,// "plan_GIVczN2miKqrY3",
                    },
                },
            },
            SuccessUrl = "http://localhost:37882/MakeThePayment/Success",//"http://example.com/success?session_id={CHECKOUT_SESSION_ID}",
            CancelUrl = "http://localhost:37882/MakeThePayment/Cancelled",
        };
        var service = new Stripe.Checkout.SessionService();
        Session session = service.Create(options);
        return Json(session.Id); 
c# asp.net model-view-controller stripe-payments
1个回答
0
投票

制作带有动画的视频贴纸

© www.soinside.com 2019 - 2024. All rights reserved.