如何将Firebase设置为服务器并执行条带支付

编程入门 行业动态 更新时间:2024-10-08 08:25:29
本文介绍了如何将Firebase设置为服务器并执行条带支付的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将Firebase用作服务器,并将请求发送到付款请求以进行分条.我的服务器端经验为零,因此我正在寻找一种简单的方法来实现这一目标.这篇文章是否可以将Stripe与Firebase集成并使用iOS?接近我想要实现的目标,并且还列出了一些有趣的链接.有谁知道我在哪里可以找到一个很好而简单的教程来将Firebase设置为Stripe的服务器?

I would like to use firebase as a server and send request to payment request to stripe. I have zero experience server side so I am looking for a simple way to achieve this. This post Is it possible to integrate Stripe With Firebase and with iOS? is close to what I want to achieve and it also list some interesting link. Does anyone know where I can find a good but simple tutorial to set up firebase as a server for stripe?

推荐答案

我通过以下2个步骤解决了此问题

I resolved this with the following 2 steps

  • 遵循入门文章中的步骤1、2和3( firebase.google/docs/functions/使用入门).这使我能够安装所需的所有软件(请注意,我在安装Firebase工具和node/npm时遇到了几个问题,但最终我设法安装了该程序)
  • 遵循此youtube指南( www.youtube/watch?v=NsPGRIVOg0U).这是一个很好的视频,简单易懂,它介绍了如何设置功能以请求执行付款.
  • 在我的swift应用中创建一些逻辑,以将条带令牌保存在实时数据库中,如下所示
  • follow step 1, 2 and 3 of the the get started article (firebase.google/docs/functions/get-started). This has allowed me to install all the software which was needed (note I had several issue with firebase tool install and node/npm but eventually I managed to install)
  • Follow this youtube guide (www.youtube/watch?v=NsPGRIVOg0U). It is a nice video, simple to understand, on what to do to set up the function to request the execution of the payment.
  • create some logic in my swift app to save the stripe token in a realtime database as below
  • func saveTokenInRealtimeDatabase(令牌:STPToken){

    func saveTokenInRealtimeDatabase(token: STPToken) { let ref = Database.database().reference(withPath: "payments") ref.child(Auth.auth().currentUser!.uid).childByAutoId().setValue(["amount": valueToCharge, "token": token.allResponseFields]) }

    更多推荐

    如何将Firebase设置为服务器并执行条带支付

    本文发布于:2023-11-28 11:46:31,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1642274.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:条带   设置为   如何将   服务器   Firebase

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!