如何将 Spreedly/Chargify 与 Rails 应用程序集成?
我是一个蹩脚的新手程序员,正在开发一个应用程序,我想要 Spreedly 或 Chargify 或类似的东西来进行定期计费。
该文档看起来确实不错,但它还没有简单到足以让我使用它。
我只是在最基本的集成之后,我公开了一个订阅链接,将用户带到定期计费人员的页面,他们输入计费信息,然后页面重定向回我的网站并更新必要的位。
我的应用程序的工作原理如下:
- 用户注册并获得一个帐户。
- 用户的帐户可以分配有多个场所。
- 所有场馆一开始都是免费状态,但每个场馆都可以升级为 通过仅拥有该场地的用户可用的菜单获得高级状态。
那么,我如何公开该链接,以便它获取场馆 ID、向用户计费并更新场馆计划字段?
场馆计划字段在模型中设置为:
PLANS = %w[free premium]
场馆 edit.html.erb
<div id="tabs-4">
<%= form_for @venue, :html => { :multipart => true } do |f| %>
<h2 class="venue_show_orange">Payments</h2>
<div class="button">
<p class="button_test">Upgrade</p>
</div>
<% end %>
</div>
感谢您的帮助,非常感谢!
I'm a crappy novice programmer and am working on an app which I want Spreedly or Chargify or something similar to do recurring billing.
The documentation seems really good but its not dumbed down enough for me to make any use of it.
I'm only after the most basic integration, where I expose a subscription link take the user to the recurring billing people's page, they put in the billing info then the page redirects back to my site and the necessary bits are updated.
My app works like this:
- A user signs up and gets an account.
- The user's account can have many venues assigned to it.
- All the venues start with a free status, but each can be upgraded to
premium status via a menu only available to the user who owns the venue.
So how can I expose the link so that it takes the venues ID, bills the user and updates the venues plan field?
The venues plan field is set in the model as:
PLANS = %w[free premium]
Venues edit.html.erb
<div id="tabs-4">
<%= form_for @venue, :html => { :multipart => true } do |f| %>
<h2 class="venue_show_orange">Payments</h2>
<div class="button">
<p class="button_test">Upgrade</p>
</div>
<% end %>
</div>
Thanks for any help its very much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会看看 Spreedly Express https://docs.spreedly.com/guides/添加付款方式/express/。对于新手程序员来说非常容易。
I would look at Spreedly Express https://docs.spreedly.com/guides/adding-payment-methods/express/. Very easy for novice programmers.