Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for detaching sources from customers #473

Merged
merged 1 commit into from
Oct 9, 2017

Conversation

ob-stripe
Copy link
Contributor

r? @brandur-stripe
cc @stripe/api-libraries @stan-stripe

Adds support for detaching sources from customers.

var err error

if len(params.Customer) > 0 {
err = c.B.Call("DELETE", fmt.Sprintf("/customers/%v/sources/%v", params.Customer, id), c.Key, body, commonParams, source)
Copy link
Contributor

@remi-stripe remi-stripe Oct 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since SourceObjectParams has it defined as

Customer string             `form:"customer"`

won't the parameter be posted anyway to the API? I guess you might need to create a SourceDetachParams instead to avoid this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, though that probably also applies to the Del method on cards and bank accounts then. I'll check!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, you were entirely correct. Cards and bank accounts aren't affected since Customer has form:"-" in their respective structures.

Fixed by defining a new SourceObjectDetachParams struct.

@brandur-stripe
Copy link
Contributor

LGTM. Thanks guys!

@brandur-stripe brandur-stripe merged commit 8cc9afd into master Oct 9, 2017
@brandur-stripe brandur-stripe deleted the ob-detach-sources branch October 9, 2017 16:40
@brandur-stripe
Copy link
Contributor

Released as 28.2.0.

nadaismail-stripe pushed a commit that referenced this pull request Oct 18, 2024
* Validate the sf api key

* Add org key to api tests

* More edge case tests

* Adjust for DB enforced uniqueness

* sfdx version bump

* Use constant for polling frequency

Trying to track down these flaky tests

* Deep freeze and deep copy on connector settings

* Fixing poll constant
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants