Skip to content

Commit e74118f

Browse files
mpashbysachsryryan.sachskolanos
authored
Pc 196 rebase (#4)
* added business type (kolanos#10) Co-authored-by: ryan.sachs <ryan.sachs@tensilepayments.com> * Fix FundingSource's Customer Lookup Method Closes kolanos#9 * merge upstream Co-authored-by: sachsry <ryanssachs@gmail.com> Co-authored-by: ryan.sachs <ryan.sachs@tensilepayments.com> Co-authored-by: Michael Lavers <kolanos@gmail.com>
1 parent 5c8c338 commit e74118f

2 files changed

Lines changed: 25 additions & 17 deletions

File tree

customer.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,22 @@ type CustomerType string
7272
// Customer is a dwolla customer
7373
type Customer struct {
7474
Resource
75-
ID string `json:"id"`
76-
FirstName string `json:"firstName"`
77-
LastName string `json:"lastName"`
78-
Email string `json:"email"`
79-
Type CustomerType `json:"type"`
80-
Status CustomerStatus `json:"status"`
81-
Created string `json:"created"`
82-
Address1 string `json:"address1"`
83-
Address2 string `json:"address2"`
84-
City string `json:"city"`
85-
State string `json:"state"`
86-
PostalCode string `json:"postalCode"`
87-
Phone string `json:"phone"`
88-
BusinessName string `json:"businessName"`
89-
Controller Controller `json:"controller"`
90-
CorrelationID string `json:"correlationId"`
75+
ID string `json:"id"`
76+
FirstName string `json:"firstName"`
77+
LastName string `json:"lastName"`
78+
Email string `json:"email"`
79+
Type CustomerType `json:"type"`
80+
Status CustomerStatus `json:"status"`
81+
Created string `json:"created"`
82+
Address1 string `json:"address1"`
83+
Address2 string `json:"address2"`
84+
City string `json:"city"`
85+
State string `json:"state"`
86+
PostalCode string `json:"postalCode"`
87+
Phone string `json:"phone"`
88+
BusinessName string `json:"businessName"`
89+
BusinessType string `json:"businessType"`
90+
Controller Controller `json:"controller"`
9191
}
9292

9393
// Customers is a collection of customers

funding_source.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,19 @@ func (f *FundingSourceServiceOp) Remove(ctx context.Context, id string) error {
140140

141141
// Customer returns the funding source's customer
142142
func (f *FundingSource) Customer(ctx context.Context) (*Customer, error) {
143+
var customer Customer
144+
143145
if _, ok := f.Links["customer"]; !ok {
144146
return nil, errors.New("No customer resource link")
145147
}
146148

147-
return f.client.Customer.Retrieve(ctx, f.Links["customer"].Href)
149+
if err := f.client.Get(ctx, f.Links["customer"].Href, nil, nil, &customer); err != nil {
150+
return nil, err
151+
}
152+
153+
customer.client = f.client
154+
155+
return &customer, nil
148156
}
149157

150158
// FailedVerificationMicroDeposits returns true if micro deposit

0 commit comments

Comments
 (0)