Forum: Ruby on Rails Using html.erb as stand alone file

Aacab42e3f4ab195e90d91ca69beb511?d=identicon&s=25 Lee Godden (leegodden)
on 2014-03-13 14:49
(Received via mailing list)
Hi

Could anyone tell me if this is possible even with it being bad practice
and not using RoR as it was intended, I am looking into customizing my
CRM
named 'HostPay' in order to integrate stripe payments. Hostpay doesn't
support stripe, but It  is written in Ruby and containes a number of
rhtml
files. I'm looking to create  a stand alone html.erb file which receives
a
variable written as <%= (basket.to_f_withvat).to_money %>  from one of
the
existing files.

On my stand alone page the variable mentioned will be assigned as such:


basket_total = (basket.to_f_withvat).to_money


charge = Stripe::Charge.create(
    :amount => basket_total, # This is your value as a variable.
    :currency => "usd",
    :card => token,
====etc ======

This will then proceed to take card payment with stripe

Of course my file will be nothing to do with the existing CRM structure
of views, models and Controllers, but as long as it renders in the
browser and can recieve the variable then it wont matter for this
situation.
Again, I know this is bad practice but it's the only way i have at
present of doing this.

Hope someone can help me with this

Thanks

LEe
F50d3b02eee623a2172b58c09fe31c2c?d=identicon&s=25 mike2r (Guest)
on 2014-03-13 16:19
(Received via mailing list)
On Thursday, March 13, 2014 9:33:58 AM UTC-4, Lee Godden wrote:
>
> ====etc ======
> LEe
>
>
I'm not sure if I can help, but is HostPay a Ruby on Rails app?  If so,
it
must be an old one.  Rails hasn't supported rhtml files since version 2.
 Stripes is actually pretty straightforward.  There's a gem 'stripes'
you
can use, and they have instructions for using their API in Rails at the
following link:

stripe.com/docs/checkout/guides/rails
F50d3b02eee623a2172b58c09fe31c2c?d=identicon&s=25 mike2r (Guest)
on 2014-03-13 16:58
(Received via mailing list)
On Thursday, March 13, 2014 11:18:34 AM UTC-4, mike2r wrote:
>> support stripe, but It  is written in Ruby and containes a number of rhtml
>> charge = Stripe::Charge.create(
>> Hope someone can help me with this
> following link:
>
> stripe.com/docs/checkout/guides/rails
>

sorry, the gem is 'stripe' (singular) not 'stripes'
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.