-
Notifications
You must be signed in to change notification settings - Fork 3.9k
fix(connector): [GLOBALPAY] Added Tokenization Flow for CITs #8568
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
Conversation
3f3ed11
Which typo are you referring to particularly? @pixincreate |
crates/hyperswitch_connectors/src/connectors/globalpay/response.rs
Outdated
Show resolved
Hide resolved
crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs
Outdated
Show resolved
Hide resolved
impl From<GlobalpayPaymentMethodStatus> for common_enums::PaymentMethodStatus { | ||
fn from(item: GlobalpayPaymentMethodStatus) -> Self { | ||
match item { | ||
GlobalpayPaymentMethodStatus::Active => Self::Active, | ||
GlobalpayPaymentMethodStatus::Inactive | GlobalpayPaymentMethodStatus::Delete => { | ||
Self::Inactive | ||
} | ||
} | ||
} | ||
} | ||
|
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.
Remove unused function
crates/hyperswitch_connectors/src/connectors/globalpay/transformers.rs
Outdated
Show resolved
Hide resolved
let connector_mandate_request_reference_id = | ||
item.request.mandate_id.as_ref().and_then(|mandate_ids| { | ||
match &mandate_ids.mandate_reference_id { | ||
Some(api_models::payments::MandateReferenceId::ConnectorMandateId( | ||
connector_mandate_ids, | ||
)) => connector_mandate_ids.get_connector_mandate_request_reference_id(), | ||
_ => None, | ||
} | ||
}); |
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?
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.
not req, removed
type MandateDetails = ( | ||
Option<Initiator>, | ||
Option<StoredCredential>, | ||
Option<String>, | ||
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.
No need for the function get_mandate_details
move entire logic to GlobalpayPaymentsRequest try_from
Some(api_models::payments::MandateReferenceId::ConnectorMandateId( | ||
connector_mandate_ids, | ||
)) => connector_mandate_ids.get_connector_mandate_id(), | ||
_ => None, | ||
} | ||
}); | ||
let connector_mandate_request_reference_id = |
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.
Test the payment_method_id flow for globalpay mandates.
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.
Tested, the curls in description working fine.
…rver * 'main' of github.com:juspay/hyperswitch: (25 commits) chore: `xof` currency to cybersource cards (#8799) chore(version): 2025.08.01.0 feat(core): Implement UCS based upi for paytm and phonepe (#8732) feat(connector): [katapult]add template code for katapult (#8783) feat(router): introduce `feature` and `feature_data` to gsm (#7771) feat(connector): [cybersource] add changes for field CybersourceConsumerAuthInformation (#8768) feat(authentication): added authentication sync api (#8596) feat(connector): [facilitapay] fix refunds, add webhook and void support (#8778) feat(connector): [payload] add recurring payments (#8597) chore(version): 2025.07.31.0 feat(connector): [Flexiti]Add support for flexiti connector (#8743) chore(router): events enhancement for kafka (#8780) ci(cypress): Making a mandate payment with large customer user agents (#8790) fix(openapi): update create_platform endpoint in api-reference docs (#8782) chore(version): 2025.07.30.0 fix(connector): [GLOBALPAY] Added Tokenization Flow for CITs (#8568) feat(routing): Add api-refs for new decision engine endpoints (#8709) fix: replace xtrim with xdel to support older redis version (#8515) fix(connector): [Worldpay] handle multiple ddc submission for CompleteAuthorize (#8741) feat(connector): [Adyen] receive incoming webhooks for pix expiry (#8720) ...
Type of Change
Description
In One-off payments, we donot need to create the token. Just passing raw cards would be enough.
In CITs, we need to create a token and store it in
connector_mandate_id
for future MITs but while executing the CIT, raw cards need to be passed.In MITs, we need to use that previously stored token in CIT and no more need to hit the tokenization endpoint at connector.
Additional Changes
Motivation and Context
How did you test it?
cURL:
Response:
mandate_id
Request:
Response:
mandate_id
Request:
Response:
payment_method_id
cURL:
Response:
payment_method_id
cURL:
Response:
Cypress test
Globalpay
Checklist
cargo +nightly fmt --all
cargo clippy