-
Notifications
You must be signed in to change notification settings - Fork 570
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 the PaymentMethod resource #1541
Conversation
src/Stripe.net/Entities/PaymentMethods/PaymentMethodCardWallet.cs
Outdated
Show resolved
Hide resolved
841a1c4
to
74d42f9
Compare
@@ -23,6 +23,12 @@ public class PaymentIntentLastPaymentError : StripeEntity | |||
[JsonProperty("param")] | |||
public string Param { get; set; } | |||
|
|||
[JsonProperty("payment_intent")] |
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.
Should we fix this to be a StripeError instead and release as a major version?
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'd say yes.
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.
(Although maybe just bundle this with the next release for the new API version?)
b88030d
to
f29ab65
Compare
{ "key", "value" }, | ||
}, | ||
} | ||
SourceToken = "btok_123", |
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.
openapi is now failing because this can only be a string instead of a hash. It used to work and I think it's related to some recent changes that @mickjermsurawong-stripe did for stripe-java.
Ultimately it's likely okay to just pass a string here, the library is already well-tested in general
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 sorry, I didn't foresee it would fail current library tests. Yup, it is my work on typed params to make public spec for these params only taking String as an attempt to limit non-PCI compliant users from accidentally passing in raw PAN data. So as I understand, we want to make this enforcement on in the client lib too, so passing String here would be okay.
Just a side note: on live request OpenAPI validation, we skipped validation on these undocumented polymorphic param so we won't see false rate of validation failure. (Additionally, there's no sever side effect because its' OpenAPI)
Currency = "usd", | ||
RoutingNumber = "110000000", | ||
} | ||
ExternalAccountTokenId = "btok_123", |
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.
same as above, cc @mickjermsurawong-stripe
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.
Ack, yup it applies to external account to. The only old endpoint that takes full hash is the token creation params that takes full card/bank account
f29ab65
to
7d58b4d
Compare
src/Stripe.net/Services/PaymentMethods/PaymentMethodCreateOptions.cs
Outdated
Show resolved
Hide resolved
46363aa
to
3b9910a
Compare
Okay this is now supposed to be feature complete and ready for review. r? @ob-stripe |
7a72407
to
d93329d
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-dotnet
here too. I reviewed both resource and params here.
public string Fingerprint { get; set; } | ||
|
||
[JsonProperty("routing_number")] | ||
public string RoutingNumber { get; set; } |
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.
nit: last4
should come before routing_number
alphabetically?
public class ChargePaymentMethodDetailsCardThreeDSecure : StripeEntity | ||
{ | ||
[JsonProperty("supported")] | ||
public bool Supported { get; set; } |
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 it should be empty class here. The "supported" field is correctly present in PaymentMethodCardThreeDSecureUsage
though.
public string Bic { get; set; } | ||
|
||
[JsonProperty("verified_name")] | ||
public string VerifiedName { get; set; } |
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 got the schema from Giropay above instead. Ideal should have iban_last4
and bank
public class PaymentMethodUpdateOptions : BaseOptions | ||
{ | ||
[JsonProperty("metadata")] | ||
public Dictionary<string, string> Metadata { get; set; } |
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 compare with autogen params, and we seem to allow updating card and billing details too..
Maybe we don't want this?
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, forgot to fix that one. cc @ob-stripe Are we okay having a nested option have names such as PaymentMethodCardCreateOptions
and PaymentMethodCardUpdateOptions
?
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 that's fine. I assume most users rely on Intellisense to discover classes anyway.
d93329d
to
8936c9a
Compare
@mickjermsurawong-stripe Thanks for the thorough reviews and catching multiple mistakes here! |
Thanks for the fix remi. The schema looks great to me! |
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.
Left a couple of comments. Also, don't forget to remove the spec and fixtures files and use the latest stripe-mock before merging to master.
|
||
[JsonProperty("stripe_account")] | ||
public ChargePaymentMethodDetailsStripeAccount StripeAccount { get; set; } | ||
|
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.
type
is missing.
public string Funding { get; set; } | ||
|
||
[JsonProperty("generated_card")] | ||
public string GeneratedCard { get; set; } |
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.
If this is an ID, this should be GeneratedCardId
.
@@ -23,6 +23,12 @@ public class PaymentIntentLastPaymentError : StripeEntity | |||
[JsonProperty("param")] | |||
public string Param { get; set; } | |||
|
|||
[JsonProperty("payment_intent")] |
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.
(Although maybe just bundle this with the next release for the new API version?)
ca14631
to
07e4b2b
Compare
07e4b2b
to
1d8ea30
Compare
cc @stripe/api-libraries