Changeset 12044 for main/waeup.ikoba


Ignore:
Timestamp:
24 Nov 2014, 00:05:35 (10 years ago)
Author:
uli
Message:

Add a sample payment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/paypal.py

    r12029 r12044  
    8989        )
    9090    return api.get_access_token()
     91
     92
     93def get_payment():
     94    """Construct a payment.
     95
     96    You have to `create()` the payment yourself.
     97
     98    XXX: Just some sampledata yet.
     99    """
     100    payment = paypalrestsdk.Payment(
     101        {
     102            "intent": "sale",
     103            "payer": {
     104                "payment_method": "credit_card",
     105                "funding_instruments": [
     106                    {
     107                        "credit_card": {
     108                            "type": "visa",
     109                            "number": "4417119669820331",
     110                            "expire_month": "11",
     111                            "expire_year": "2018",
     112                            "cvv2": "874",
     113                            "first_name": "Joe",
     114                            "last_name": "Shopper",
     115                            "billing_address": {
     116                                "line1": "52 N Main ST",
     117                                "city": "Johnstown",
     118                                "state": "OH",
     119                                "postal_code": "43210",
     120                                "country_code": "US" }
     121                            }
     122                        }
     123                    ]},
     124            "transactions": [{
     125                    "amount": {
     126                        "total": "7.47",
     127                        "currency": "USD",
     128                        "details": {
     129                            "subtotal": "7.41",
     130                            "tax": "0.03",
     131                            "shipping": "0.03"}},
     132                    "description": ("This is the payment "
     133                                    "transaction description.")
     134                    }]
     135            }
     136        )
     137    return payment
Note: See TracChangeset for help on using the changeset viewer.