How did you add the sdk to the app engine project? It's been giving me 
trouble

On Friday, January 3, 2014 12:52:23 AM UTC+3, Robert Avram wrote:
>
> I'm trying to figure out how to process payments using paypal python sdk 
> and google app engine.
> the following code seems to work, but I can't figure out, based on the 
> SDK, how to handle the exceptions (wrong credit card number etc).
> I would like the customer to be able to see the error. I would appreciate 
> any input! thanks!!!
>
>
> class Buy(generichandler.MainHandler):
>
>     def get(self):
>
>        api = paypalrestsdk.set_config(
>
>          mode="sandbox",
>
>          client_id="myclientid",
>
>          client_secret="secret")
>
>        api.get_token()
>
>        paymentDic = {"intent": "sale",
>
>                      "payer": {
>
>                                "payment_method": "credit_card",
>
>                                "funding_instruments": [{
>
>                                                         "credit_card": {
>
>                                                                        
> "type": "visa",
>
>                                                                        
> "number": "4417119669820331",
>
>                                                                        
> "expire_month": "11",
>
>                                                                        
> "expire_year": "2018",
>
>                                                                        
> "cvv2": "874",
>
>                                                                        
> "first_name": "Joe",
>
>                                                                        
> "last_name": "Shopper",
>
>                                                                        
> "billing_address": {
>
>                                                                           
>                    "line1": "52 N Main ST",
>
>                                                                           
>                    "city": "Johnstown",
>
>                                                                           
>                    "state": "OH",
>
>                                                                           
>                    "postal_code": "43210",
>
>                                                                           
>                    "country_code": "US" }}}]},
>
>                      "transactions": [{
>
>                                        "amount": {
>
>                                                  "total": "1.47",
>
>                                                  "currency": "USD",
>
>                                                  "details":{
>
>                                                            "subtotal": 
> "1.41",
>
>                                                            "tax": "0.03",
>
>                                                            "shipping": 
> "0.03"}},
>
>                                        "description": "This is the 
> payment transaction description." }]}
>
>        payment = paypalrestsdk.Payment(paymentDic)
>
>        payment.create()
> Enter code here...
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Reply via email to