[web2py] Re: using Stripe

2012-11-21 Thread greaneym
Thank you, Massimo. I will take a look.

Margaret


>

-- 





[web2py] Re: using Stripe

2012-11-21 Thread Massimo Di Pierro
Hello Margaret,

first of all sorry for the late response. Here is a simple application that 
implements a shopping cart sing Authorize.net:

https://github.com/mdipierro/web2py-appliances/blob/master/PosOnlineStore

In file

https://github.com/mdipierro/web2py-appliances/blob/master/PosOnlineStore/controllers/default.py

look at the lines:

from gluon.contrib.AuthorizeNet import process
 ...
 if process(form.vars.creditcard,form.vars.expiration, 
total,form.vars.cvv,0.0,invoice,testmode=True): ...


In the case of sprite.com they are replaced by

  from gluon.contrib.stripe import Stripe
...
d = stripe.charge(amount=total, currency='usd', card_number=form.vars.
creditcard, card_exp_month=form.vars.expiration[:2],
card_exp_year=form.vars.expiration[2:],
card_cvc_check=form.vars.cvv,
description='invoice %s' % invoice)
if d.get('paid',False): ...

Hope this helps.


On Monday, 19 November 2012 18:43:25 UTC-6, greaneym wrote:
>
> Hello,
>
> I've looked into stripe.com and it does look like it is easier than 
> google wallet to implement. 
>
> When I put the example from the web2py manual into a controller, then the 
> charge of whatever amount does communicate with Stripe's server and I can 
> see that a charge went through as a test.
>
>
> How do I see display this example from the manual, section14.10.3, in a 
> view?
>
> thank you,
> Margaret
>
>

--