第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 httppost 將 paymentIntentSecret 獲取到 Javascript

使用 httppost 將 paymentIntentSecret 獲取到 Javascript

C#
慕蓋茨4494581 2023-08-13 16:32:41
這就是當我需要 httppost 某些東西時我的問題。然后我想接收subscription.LatestInvoice.PaymentIntent.ClientSecret我的 js 文件的值。當我單擊“付款”時,剝離必須subscription.LatestInvoice.PaymentIntent.ClientSecret為我的 js 文件指定一個值。但它永遠不會出來。然而,Stripe 告訴我:未捕獲的集成錯誤:stripe.handleCardPayment 意圖機密的值無效:值應為 ${id}機密${secret} 形式的客戶端機密。您指定: 。我的 httppost - 控制器:[HttpPost]    [Route("Members/AddMembership/{id}/{CompaniesId}")]    public async Task<IActionResult> AddMembership(MembersView model)    {        try        {            //Here before that comes some strip code and everything else ...            model.PiinVoice = subscription.LatestInvoice.PaymentIntent.ClientSecret;            return View(model);        }        catch(Exception e)        {            TempData[TempDataClass.Error] = true;            TempData[TempDataClass.ErrorMsg] = HelperText.ExceptionError + e.Message;            return RedirectToAction("", "User");        }    }我通過 Stripe 獲得了 js 代碼,該代碼在此鏈接上。我的 JavaScript 在這里。.... more here....//I Need value from this one.var paymentIntentSecret = document.getElementById('PiinVoice').value;  // Handle form submission.var form = document.getElementById('payment-form');    form.addEventListener('submit', function (event) {       event.preventDefault();    stripe.handleCardPayment(paymentIntentSecret).then(function(result) {      if (result.error) {        // Display error.message in your UI.          // Inform the user if there was an error.          var errorElement = document.getElementById('card-errors');          errorElement.textContent = result.error.message;      } else {        // The payment has succeeded. Display a success message.          stripeTokenHandler(result.token);      }    });});.... more here...我想知道是否可以這樣做,并將其subscription.LatestInvoice.PaymentIntent.ClientSecret放入我的 PiinVoice 中。它的實現(xiàn)與 3D Secure 相關。反對如果我在 3d 之前運行舊代碼。付款后進去找到發(fā)票 ID 并扔進去,var paymentIntentSecret = "xxxxxxx"然后就可以正常工作了
查看完整描述

1 回答

?
慕斯王

TA貢獻1864條經驗 獲得超2個贊

您是否嘗試過打印subscription.LatestInvoice.PaymentIntent.ClientSecret后端代碼來調查此問題?因為它似乎是空的。


var options = new SubscriptionCreateOptions

{

? ? CustomerId = customer.Id,

? ? Items = items,

? ? Expand = new List<string>() { "latest_invoice.payment_intent" }

};


var subscriptionServices = new SubscriptionService();

Subscription subscription = subscriptionServices.Create(options);


查看完整回答
反對 回復 2023-08-13
  • 1 回答
  • 0 關注
  • 136 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號