-
Notifications
You must be signed in to change notification settings - Fork 7
feat(core): Add support for UPI #36
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
base: main
Are you sure you want to change the base?
Conversation
#[derive(Default, Debug, Serialize, Deserialize, Clone)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum UpiAction { | ||
#[default] |
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.
why is default required?
authentication_channel, | ||
}), | ||
_ => { | ||
// If the payment method is not card, we assume no authentication is required |
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.
This sounds sketchy
@@ -433,9 +441,9 @@ pub struct RazorpayPsyncResponse { | |||
pub id: String, | |||
pub entity: String, | |||
pub amount: i64, | |||
pub base_amount: i64, | |||
pub base_amount: Option<i64>, |
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.
Can we not making this as MinorUnit?
f6291bf
to
79d4488
Compare
Ok(RazorpayPaymentRequest { | ||
amount, | ||
currency, | ||
receipt: uuid::Uuid::new_v4().to_string(), |
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.
here we should use item.router_data.connector_request_reference_id
instead of generating a random id as we will loose track of it.
@@ -433,9 +451,9 @@ pub struct RazorpayPsyncResponse { | |||
pub id: String, | |||
pub entity: String, | |||
pub amount: i64, |
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.
pub amount: i64, | |
pub amount: MinorUnit, |
pub currency: String, | ||
pub base_currency: String, | ||
pub base_currency: Option<String>, |
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.
pub base_currency: Option<String>, | |
pub base_currency: Option<enums::Currency>, |
Make this change at all the places
/// Frequency of the poll | ||
pub frequency: u16, | ||
} | ||
|
||
#[derive(Debug, Default, Serialize, Deserialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub struct RazorpayErrorResponse { |
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.
Razorpay returns varying error formats (e.g. string or JSON), handle them using a enum.
pub method: PaymentMethodType, | ||
pub card: PaymentMethodSpecificData, | ||
#[serde(flatten)] | ||
pub payment_method_specific_data: PaymentMethodSpecificData, | ||
pub authentication: Option<AuthenticationDetails>, | ||
pub browser: Option<BrowserInfo>, | ||
pub ip: String, |
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.
pub ip: String, | |
pub ip: Option<String>, |
referer
and user_agent
is also an optional field.
Description
Added support for UPI
Motivation and Context
Additional Changes
How did you test it?
UPI Collect:
Response: