Skip to content
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(service): Migrate b2c, b2b to the builder pattern #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

itsyaasir
Copy link
Collaborator

No description provided.

@itsyaasir itsyaasir mentioned this pull request Jul 8, 2024
7 tasks
@itsyaasir itsyaasir self-assigned this Jul 8, 2024
pub amount: f64,
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.

2 participants