Skip to content

Conversation

@itsyaasir
Copy link
Collaborator

No description provided.

@itsyaasir itsyaasir mentioned this pull request Jul 8, 2024
7 tasks
@itsyaasir itsyaasir requested review from c12i and crispinkoech July 8, 2024 15:33
@itsyaasir itsyaasir self-assigned this Jul 8, 2024
pub party_a: String,
pub sender_identifier_type: IdentifierTypes,
pub party_b: String,
#[serde(rename(serialize = "RecieverIdentifierType"))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still need this inner rename if he outer struct has the rename_all="PascalCase" attribute?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Funny things, there is a typo in the receiver so I am renaming the single field and same fields can't parse the way it the API expects like ResultURL

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hehehe yeah, always has to be safaricom with the inconsistent API/docs.

pub queue_time_out_url: Url,
#[serde(rename = "ResultURL")]
pub result_url: Url,
#[serde(rename = "AccountReference")]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same for the AccountReference...

skip_serializing_if = "Option::is_none"
)]
account_reference: Option<&'mpesa str>,
pub reciever_identifier_type: IdentifierTypes,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Following from the comment above, I guess we can then rename this struct field to have the correct english naming like so:

Suggested change
pub reciever_identifier_type: IdentifierTypes,
pub receiver_identifier_type: IdentifierTypes,

Copy link
Collaborator

@crispinkoech crispinkoech Jul 12, 2024

Choose a reason for hiding this comment

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

...but it might be desirable to keep the same as the typo that mpesa api uses. Up to you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants