Skip to content

Commit

Permalink
Fix FundingSource's Customer Lookup Method
Browse files Browse the repository at this point in the history
Closes #9
  • Loading branch information
kolanos committed Oct 19, 2021
1 parent 00fc8ef commit 680d5a3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion funding_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,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

0 comments on commit 680d5a3

Please # to comment.