             </Col>
             <Col xs=8>
                 <ButtonToolbar style={float: "right"}>
-                    <Button onClick={=>@setState(state:'view', new_payment_info:{})}>Cancel</Button>
+                    <Button onClick={@props.on_close}>Cancel</Button>
                     <Button onClick={@submit_credit_card} bsStyle='primary'>Add Credit Card</Button>
                 </ButtonToolbar>
             </Col>
         </Row>
 
-    render_add_payment_method: ->
+    render_error: ->
+        if @state.error
+            <ErrorDisplay error={@state.error} onClose={=>@setState(error:'')} />
+
+    render: ->
         <Row>
             <Col xs=8 xsOffset=2>
                 <Well>
+                    {@render_error()}
                     {@render_payment_method_fields()}
                     {@render_payment_method_buttons()}
                 </Well>
             </Col>
         </Row>
+
+
+#address_city: nulladdress_country: "United States"address_line1: nulladdress_line1_check: nulladdress_line2: nulladdress_state: "WA"address_zip: "98122"address_zip_check: "pass"brand: "Diners Club"country: nullcustomer: "cus_6TzOs3X3oawJxr"cvc_check: "pass"dynamic_last4: nullexp_month: 2exp_year: 2020fingerprint: "ukp9e1Ie0rPtwrXy"funding: "credit"id: "card_16MMxEGbwvoRbeYxoQoOUyno"last4: "5904"metadata: Object__proto__: Objectname: "William Stein"object: "card"tokenization_method: null__proto__: Object1: Objectlength: 2__proto__: Array[0]has_more: falseobject: "list"total_count: 2url: "/v1/customers/cus_6TzOs3X3oawJxr/sources"__proto__: Objectsubscriptions: Object__proto__: Object__proto__: Object
+
+
+PaymentMethod = rclass
+    displayName : "PaymentMethod"
+    propTypes:
+        source  : rtypes.object.isRequired
+        default : rtypes.bool.isRequired
+    icon_name: ->
+        return 'cc-discover' # TODO
+    render: ->
+        <Row>
+            <Col xs=2>
+                <Icon name={@icon_name()} /> {@props.source.brand}
+            </Col>
+            <Col xs=1>
+                <em>····</em>{@props.source.last4}
+            </Col>
+            <Col xs=1>
+                {@props.source.exp_month}/{@props.source.exp_year}
+            </Col>
+            <Col xs=2>
+                {@props.source.name}
+            </Col>
+            <Col xs=1>
+                {@props.source.country}
+            </Col>
+            <Col xs=2>
+                {@props.source.address_state}
+                &nbsp; &nbsp;
+                {@props.source.address_zip}
+            </Col>
+            <Col xs=3>
+                <ButtonToolbar style={float: "right"}>
+                    <Button bsStyle={if @props.default then 'primary' else 'default'}>Default</Button>
+                    <Button><Icon name="trash" /> Delete</Button>
+                </ButtonToolbar>
+            </Col>
+        </Row>
+
+
+PaymentMethods = rclass
+    displayName : "PaymentMethods"
+    propTypes:
+        flux    : rtypes.object.isRequired
+        sources : rtypes.array.isRequired
+        default : rtypes.string
+
+    getInitialState: ->
+        state : 'view'   #  'delete' <--> 'view' <--> 'add_new'
+        error : ''
+
+    add_payment_method: ->
+        @setState(state:'add_new')
+
+    render_add_payment_method: ->
+        if @state.state == 'add_new'
+            <AddPaymentMethod flux={@props.flux} on_close={=>@setState(state:'view')} />
 
     render_add_payment_method_button: ->
         <Button disabled={@state.state != 'view'} onClick={@add_payment_method} bsStyle='primary' style={float: "right"}>

    render: ->
        <Panel header={@render_header()}>
            {@render_error()}
            {@render_add_payment_method() if @state.state in ['add_new', 'submit']}
            {@render_payment_methods()}
        </Panel>


InvoiceHistory = rclass
    render_header: ->
        <span>
            <Icon name="list-alt" /> Invoice History

        </Row>

    render_payment_methods: ->
        for source in @props.sources
            <PaymentMethod key={source.id} source={source} default={source.id==@props.default}/>

    render_error: ->
        if @state.error
