Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions customer.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,22 @@ type CustomerType string
// Customer is a dwolla customer
type Customer struct {
Resource
ID string `json:"id"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Email string `json:"email"`
Type CustomerType `json:"type"`
Status CustomerStatus `json:"status"`
Created string `json:"created"`
Address1 string `json:"address1"`
Address2 string `json:"address2"`
City string `json:"city"`
State string `json:"state"`
PostalCode string `json:"postalCode"`
Phone string `json:"phone"`
BusinessName string `json:"businessName"`
Controller Controller `json:"controller"`
CorrelationID string `json:"correlationId"`
ID string `json:"id"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Email string `json:"email"`
Type CustomerType `json:"type"`
Status CustomerStatus `json:"status"`
Created string `json:"created"`
Address1 string `json:"address1"`
Address2 string `json:"address2"`
City string `json:"city"`
State string `json:"state"`
PostalCode string `json:"postalCode"`
Phone string `json:"phone"`
BusinessName string `json:"businessName"`
BusinessType string `json:"businessType"`
Controller Controller `json:"controller"`
}

// Customers is a collection of customers
Expand Down
10 changes: 9 additions & 1 deletion funding_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,19 @@ func (f *FundingSourceServiceOp) Remove(ctx context.Context, id string) error {

// Customer returns the funding source's customer
func (f *FundingSource) Customer(ctx context.Context) (*Customer, error) {
var customer Customer

if _, ok := f.Links["customer"]; !ok {
return nil, errors.New("No customer resource link")
}

return f.client.Customer.Retrieve(ctx, f.Links["customer"].Href)
if err := f.client.Get(ctx, f.Links["customer"].Href, nil, nil, &customer); err != nil {
return nil, err
}

customer.client = f.client

return &customer, nil
}

// FailedVerificationMicroDeposits returns true if micro deposit
Expand Down