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

[NOTICKET] Explicitly send autoCapture in JSON request #161

Merged

Conversation

MasterXen
Copy link
Contributor

@MasterXen MasterXen commented Feb 16, 2022

autoCapture is being coalesced to undefined when being sent to the POST payload: https://developers.circle.com/reference#payments-payments-create.

While undefined is allowed/correct from an API standpoint, the field is not documented in its behavior when not supplied and is confusing developers/readers. Instead, this PR makes the behavior more clear in true/false when submitting values.

@MasterXen MasterXen changed the title [NOTICKET] Represent autoCapture correctly in JSON request [NOTICKET] Explicitly send autoCapture in JSON request Feb 16, 2022
@@ -190,7 +190,7 @@ export default class CreatePaymentClass extends Vue {

const payload: CreateMarketplaceCardPaymentPayload = {
idempotencyKey: uuidv4(),
autoCapture: this.formData.autoCapture ? undefined : false,
Copy link
Contributor Author

@MasterXen MasterXen Feb 16, 2022

Choose a reason for hiding this comment

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

Simplify the logic to make this look correct to readers -- the current implementation is already correct since auto capture is the default but sending the true/false explicitly is clearer.

@timmy-circle timmy-circle merged commit 4fafda6 into circlefin:master Feb 16, 2022
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.

2 participants