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 support for PaymentMethod #806
Conversation
125b389
to
6595643
Compare
charge.go
Outdated
|
||
// PaymentMethodDetailsCardWallet represents the details of the card wallet if this Card | ||
// PaymentMethod is part of a card wallet. | ||
type PaymentMethodDetailsCardWallet struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@remi-stripe should this be prefixed with ChargeXXX
like other structs too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should, nice catch.
6595643
to
4820f40
Compare
paymentmethod.go
Outdated
// PaymentMethodTransferDataParams is the set of parameters allowed for the transfer_data hash. | ||
type PaymentMethodTransferDataParams struct { | ||
Destination *string `form:"destination"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is unintentional—this struct doesn't appear to be used anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes bad copy paste, fixed (won't push while you review)
02a083e
to
00f558e
Compare
00f558e
to
6d9c5f5
Compare
@@ -114,14 +114,16 @@ type PaymentIntentListParams struct { | |||
|
|||
// PaymentIntentLastPaymentError represents the last error happening on a payment intent. | |||
type PaymentIntentLastPaymentError struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, this should be Error
right? Is it worth changing this and releasing as a major version to be cleaner?
faa9ef8
to
6e68eb4
Compare
Okay, this should now be feature complete and ready for review. There is one test failing, |
6e68eb4
to
93a53a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I reviewed stripe-java
against the autogen for schema correctness, it might be easier for me to review stripe-go
here too. I reviewed both resource and params here. The params look good to me.
charge.go
Outdated
|
||
// ChargePaymentMethodDetailsBancontact represents details about the Bancontact PaymentMethod. | ||
type ChargePaymentMethodDetailsBancontact struct { | ||
AccountHolderType BankAccountAccountHolderType `json:"account_holder_type"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops i think we accidentally duplicated that from AchDebit here.
Bancontact should have bank_code
, bank_name
, bic
.. and
charge.go
Outdated
|
||
// ChargePaymentMethodDetailsEps represents details about the EPS PaymentMethod. | ||
type ChargePaymentMethodDetailsEps struct { | ||
Reference string `json:"reference"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we no longer want reference
?
It's not in apiRefs anymore: /docs/api/charges/object#charge_object-payment_method_details-eps
SepaDebit *ChargePaymentMethodDetailsSepaDebit `json:"sepa_debit"` | ||
Sofort *ChargePaymentMethodDetailsSofort `json:"sofort"` | ||
StripeAccount *ChargePaymentMethodDetailsStripeAccount `json:"stripe_account"` | ||
Wechat *ChargePaymentMethodDetailsWechat `json:"wechat"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah we might be missing type
field here
// is part of a card wallet. | ||
type PaymentMethodCardWallet struct { | ||
DynamicLast4 string `json:"dynamic_last4"` | ||
Type PaymentMethodCardWalletType `json:"type"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We miss non-empty visa_checkout
, master_pass
structs here.
docs/api/payment_methods/object#payment_method_object-card-wallet-masterpass
and
docs/api/payment_methods/object#payment_method_object-card-wallet-visa_checkout
Do we also want to include the empty structs like google_pay
and samsung_pay
like in java and dotnet?
93a53a3
to
0a05cef
Compare
@mickjermsurawong-stripe Thanks a lot for the thorough review. I can't believe after all the back and forth I did on those PRs I still missed the wallet fields on Charge. I fixed everything you found I think. PTAL! |
thanks remi for the fix! |
ah the test is failing on
|
You can ignore that failing test, it's being fixed in another PR in parallel I just didn't want to duplicate the work |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as well Remi.
PaymentMethodCardBrandMastercard PaymentMethodCardBrand = "mastercard" | ||
PaymentMethodCardBrandUnionpay PaymentMethodCardBrand = "unionpay" | ||
PaymentMethodCardBrandVisa PaymentMethodCardBrand = "visa" | ||
PaymentMethodCardBrandUnknown PaymentMethodCardBrand = "unknown" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor alphabetization problem here: unknown should be above visa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, fixed
0a05cef
to
a9ed8f4
Compare
a9ed8f4
to
5a99811
Compare
I had to remove a test because we don't support |
LGTM |
cc @stripe/api-libraries