-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(payment_methods_v2): add payment methods list endpoint #6938
base: main
Are you sure you want to change the base?
Conversation
…payment methods list" This reverts commit 70cb8a1.
@@ -776,6 +765,10 @@ pub struct PaymentMethodResponse { | |||
#[cfg(all(feature = "v2", feature = "payment_methods_v2"))] | |||
#[derive(Debug, serde::Deserialize, serde::Serialize, ToSchema, Clone)] | |||
pub struct PaymentMethodResponse { | |||
/// The unique identifier of the Payment method | |||
#[schema(value_type = String, example = "card_rGK4Vi5iSW70MY7J2mIg")] |
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: Could you update the example here?
/// The list of payment methods that are enabled for the business profile | ||
#[schema(value_type = Vec<ResponsePaymentMethodTypes>)] | ||
pub payment_methods_enabled: Vec<ResponsePaymentMethodTypes>, | ||
|
||
/// The list of payment methods that are saved by the given customer | ||
/// This field is only returned if the customer_id is provided in the request | ||
#[schema(value_type = Option<Vec<CustomerPaymentMethod>>)] | ||
pub customer_payment_methods: Option<Vec<CustomerPaymentMethod>>, |
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 don't think the value_type
necessarily needs to be specified for both the fields.
ttl_for_storage_in_secs = 220752000 | ||
host = "http://127.0.0.1:3000" | ||
host_rs = "http://127.0.0.1:3000" | ||
mock_locker = false |
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.
Specifying mock_locker = false
would force everyone running the application locally to set up the card vault. Is that the intended behavior?
@@ -1758,9 +1758,11 @@ pub struct PaymentMethodDeleteResponse { | |||
#[derive(Debug, serde::Serialize, ToSchema)] | |||
pub struct PaymentMethodDeleteResponse { | |||
/// The unique identifier of the Payment method | |||
#[schema(example = "card_rGK4Vi5iSW70MY7J2mIg")] | |||
pub payment_method_id: String, | |||
#[schema(value_type = String, example = "card_rGK4Vi5iSW70MY7J2mIg")] |
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: Can you update the example here?
#[schema(value_type = Vec<ResponsePaymentMethodTypes>)] | ||
pub payment_methods_enabled: Vec<payment_methods::ResponsePaymentMethodTypes>, | ||
pub payment_methods_enabled: Vec<ResponsePaymentMethodTypesForPayments>, |
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 update the value_type
here?
#[schema(example = "klarna", value_type = PaymentMethodType)] | ||
pub payment_method_type: common_enums::PaymentMethod, |
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.
#[schema(example = "klarna", value_type = PaymentMethodType)] | |
pub payment_method_type: common_enums::PaymentMethod, | |
#[schema(example = "klarna", value_type = PaymentMethod)] | |
pub payment_method_type: common_enums::PaymentMethod, |
#[cfg(feature = "v2")] | ||
PaymentMethodListForPaymentMethods { | ||
payment_method_id: id_type::GlobalPaymentMethodId, | ||
}, |
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.
Do we need this enum variant, is this being used anywhere?
) | ||
.service( | ||
web::resource("/update-saved-payment-method") | ||
.route(web::patch().to(payment_methods::payment_method_update_api)), |
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.
Is this supposed to be put()
, to keep things consistent with the other v2 APIs?
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 of Change
Description
This PR adds payment methods list endpoint for payment methods endpoint for payment methods. This will be used to display the list of payment methods that are enabled by the merchant, and also the saved payment methods by the customer.
Motivation and Context
How did you test it?
Checklist
cargo +nightly fmt --all
cargo clippy