diff --git a/README.rst b/README.rst index bcfde9f1743ee121ba52be758d646817bd4bc43d..5eb62203160a5c3e2ecb7eaeffc0ac0c05c754ff 100644 --- a/README.rst +++ b/README.rst @@ -199,19 +199,25 @@ Stripe This template can use these variables: - ============ ============================================================ - Name Contents - ============ ============================================================ - description The description given to the payment when it was created - ------------ ------------------------------------------------------------ - fee The amount of fees charged by Stripe for this payment, as a - plain decimal number - ------------ ------------------------------------------------------------ - payment_id The id assigned to this payment by Stripe - ------------ ------------------------------------------------------------ - tax The amount of tax withheld by Stripe for this payment, as a - plain decimal number - ============ ============================================================ + ============== ========================================================== + Name Contents + ============== ========================================================== + customer_id The id assigned to this customer by Stripe + -------------- ---------------------------------------------------------- + customer_email The customer's e-mail address + -------------- ---------------------------------------------------------- + description The description given to the payment when it was created + -------------- ---------------------------------------------------------- + fee The amount of fees charged by Stripe for this payment, as + a plain decimal number + -------------- ---------------------------------------------------------- + payment_id The id assigned to this payment by Stripe + -------------- ---------------------------------------------------------- + payout_id The id of the associated Stripe payout + -------------- ---------------------------------------------------------- + tax The amount of tax withheld by Stripe for this payment, as + a plain decimal number + ============== ========================================================== Other output options ~~~~~~~~~~~~~~~~~~~~ diff --git a/import2ledger/importers/stripe.py b/import2ledger/importers/stripe.py index 1c91e26bdf3a2a9066010831a3dda490e0e2f761..e70b2854ed71ce3525e5100bd38d8448c58da538 100644 --- a/import2ledger/importers/stripe.py +++ b/import2ledger/importers/stripe.py @@ -14,7 +14,10 @@ class PaymentImporter(_csv.CSVImporterBase): COPIED_FIELDS = { 'Card Name': 'payee', 'Converted Amount': 'amount', + 'Customer Email': 'customer_email', + 'Customer ID': 'customer_id', 'Description': 'description', + 'Transfer': 'payout_id', 'id': 'payment_id', } DATE_FMT = '%Y-%m-%d' diff --git a/tests/data/StripePayments.csv b/tests/data/StripePayments.csv index 8c9b3e0f9bbcb5ec94b648891aed4100ef372c68..3dee4ddf19c937a47a8e0dd9eb371081d580f8c8 100644 --- a/tests/data/StripePayments.csv +++ b/tests/data/StripePayments.csv @@ -1,3 +1,3 @@ id,Description,Created (UTC),Amount,Amount Refunded,Currency,Converted Amount,Converted Amount Refunded,Fee,Tax,Converted Currency,Mode,Status,Statement Descriptor,Customer ID,Customer Description,Customer Email,Captured,Card ID,Card Last4,Card Brand,Card Funding,Card Exp Month,Card Exp Year,Card Name,Card Address Line1,Card Address Line2,Card Address City,Card Address State,Card Address Country,Card Address Zip,Card Issue Country,Card Fingerprint,Card CVC Status,Card AVS Zip Status,Card AVS Line1 Status,Card Tokenization Method,Disputed Amount,Dispute Status,Dispute Reason,Dispute Date (UTC),Dispute Evidence Due (UTC),Invoice ID,Payment Source Type,Destination,Transfer,Transfer Group -ch_oxuish6phae2Raighooghi3U,Payment for invoice #102,2017-11-08 16:56,100,0,usd,100,0,3,0,usd,Live,Paid,,cus_DohSheeQu8eng3,,one@example.org,true,card_na1joNohg9Aim6eg9eefooRe,0000,American Express,credit,1,2010,Dakota Smith,1 Example St,,City,State,United States,12345,US,queiheVu2ohyei2u,pass,pass,pass,,,,,,,,card,,, -ch_hHee9ef1aeyee1ruo7ochee9,Payment for invoice #100,2017-10-28 02:32,50,0,usd,50,0,1.4,0,usd,Live,Paid,,cus_iepae2Iecae8Ei,,two@example.org,true,card_sitej3Xi2aNgo1ohfoahue8e,0001,Visa,credit,2,2011,Dakota Jones,2 Example St,,City,State,United States,12345,US,men2shi3xo1Mao4u,pass,pass,pass,,,,,,,,card,,, +ch_oxuish6phae2Raighooghi3U,Payment for invoice #102,2017-11-08 16:56,100,0,usd,100,0,3,0,usd,Live,Paid,,cus_DohSheeQu8eng3,,one@example.org,true,card_na1joNohg9Aim6eg9eefooRe,0,American Express,credit,1,2010,Dakota Smith,1 Example St,,City,State,United States,12345,US,queiheVu2ohyei2u,pass,pass,pass,,,,,,,,card,,po_aeYees2ahtier8ohju7Eeyie, +ch_hHee9ef1aeyee1ruo7ochee9,Payment for invoice #100,2017-10-28 02:32,50,0,usd,50,0,1.4,0,usd,Live,Paid,,cus_iepae2Iecae8Ei,,two@example.org,true,card_sitej3Xi2aNgo1ohfoahue8e,1,Visa,credit,2,2011,Dakota Jones,2 Example St,,City,State,United States,12345,US,men2shi3xo1Mao4u,pass,pass,pass,,,,,,,,card,,po_aeYees2ahtier8ohju7Eeyie, diff --git a/tests/data/imports.yml b/tests/data/imports.yml index 317ec5cd899c3337d73d61a8aac2ef8fc1311bb2..6c6aa9c548506e6ed38df53fefe48f8d5ae12fb3 100644 --- a/tests/data/imports.yml +++ b/tests/data/imports.yml @@ -72,6 +72,9 @@ tax: !!python/object/apply:decimal.Decimal ["0"] currency: USD payment_id: ch_oxuish6phae2Raighooghi3U + customer_id: cus_DohSheeQu8eng3 + customer_email: one@example.org + payout_id: po_aeYees2ahtier8ohju7Eeyie description: "Payment for invoice #102" - payee: Dakota Jones date: !!python/object/apply:datetime.date [2017, 10, 28] @@ -80,6 +83,9 @@ tax: !!python/object/apply:decimal.Decimal ["0"] currency: USD payment_id: ch_hHee9ef1aeyee1ruo7ochee9 + customer_id: cus_iepae2Iecae8Ei + customer_email: two@example.org + payout_id: po_aeYees2ahtier8ohju7Eeyie description: "Payment for invoice #100" - source: nbpy2017a.html