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

Add a RefundWithRequest method to TransactionGateway #277

Merged

Conversation

aaronlehmann
Copy link
Contributor

The current Refund method cannot take additional parameters like
OrderId. This new method allows those parameters to be passed as part of
a request structure.

Fixes #276

Copy link
Contributor

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

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

Wow that was fast! Looks great. Thanks!

transaction.go Outdated
type TransactionRefundRequest struct {
XMLName string `xml:"transaction"`
Amount *Decimal `xml:"amount"`
OrderId string `xml:"order-id,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we have this parameter OrderID? There's a mix of casings in this package but trying to make new ones consistent with Go standards.

@@ -140,6 +140,22 @@ func (g *TransactionGateway) Refund(ctx context.Context, id string, amount ...*D
return nil, &invalidResponseError{resp}
}

// RefundWithRequest is similar to Refund, but allows more parameters such as
// OrderId to be included as part of the refund request.
Copy link
Contributor

Choose a reason for hiding this comment

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

OrderID

The current Refund method cannot take additional parameters like
OrderID. This new method allows those parameters to be passed as part of
a request structure.
@aaronlehmann
Copy link
Contributor Author

Thanks. I've amended the commit to change OrderId to OrderID.

@leighmcculloch leighmcculloch merged commit 294f481 into braintree-go:master Nov 20, 2018
@leighmcculloch leighmcculloch added this to the v0.22.0 milestone Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants