feat(connector): [Peachpayments] Add Webhook Flow and Support For merchant_order_reference_id#9781
Conversation
…chant_order_reference_id
Changed Files
|
crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs
Outdated
Show resolved
Hide resolved
crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs
Outdated
Show resolved
Hide resolved
| let payments_response = peachpayments::PeachpaymentsPaymentsResponse { | ||
| transaction_id: transaction.transaction_id.clone(), | ||
| response_code: transaction.response_code, | ||
| transaction_result: transaction.transaction_result, | ||
| ecommerce_card_payment_only_transaction_data: transaction | ||
| .ecommerce_card_payment_only_transaction_data, | ||
| original_transaction_id: transaction.original_transaction_id, | ||
| reference_id: Some(transaction.reference_id), | ||
| error_message: transaction.error_message, | ||
| payment_method: Some(transaction.payment_method), | ||
| }; |
There was a problem hiding this comment.
Instead of creating a new struct PeachpaymentsIncomingWebhook and then parsing it to PeachpaymentsPaymentsResponse
Make PeachpaymentsPaymentsResponse an enum with 2 structs 1 for payments and 1 for webhooks
Refere Adyen
| Ok(Box::new(payments_response)) | ||
| } | ||
|
|
||
| async fn verify_webhook_source( |
There was a problem hiding this comment.
Do we have information on source_verification_algorithm for this connector?
If so, can we add implementations for get_webhook_source_verification_algorithm, get_webhook_source_verification_signature, and get_webhook_source_verification_message as well?
There was a problem hiding this comment.
Peach doesn't support any algorithm as of now.
a16bc1c to
e0fdc4d
Compare
| pub original_transaction_id: Option<String>, | ||
| pub reference_id: Option<String>, | ||
| pub error_message: Option<String>, | ||
| pub payment_method: Option<Secret<String>>, |
There was a problem hiding this comment.
Why are we modifying the existing PeachpaymentsPaymentsData?
There was a problem hiding this comment.
Not needed, removing it
…chant_order_reference_id (#9781) Co-authored-by: Anurag Singh <anurag.singh.001@MacBookPro.lan> Co-authored-by: Anurag Singh <anurag.singh.001@Anurag-Singh-WPMHJ5619X.local>
…chant_order_reference_id (#9781) Co-authored-by: Anurag Singh <anurag.singh.001@MacBookPro.lan> Co-authored-by: Anurag Singh <anurag.singh.001@Anurag-Singh-WPMHJ5619X.local>
…chant_order_reference_id (juspay#9781) Co-authored-by: Anurag Singh <anurag.singh.001@MacBookPro.lan> Co-authored-by: Anurag Singh <anurag.singh.001@Anurag-Singh-WPMHJ5619X.local>
…chant_order_reference_id (#9781) Co-authored-by: Anurag Singh <anurag.singh.001@MacBookPro.lan> Co-authored-by: Anurag Singh <anurag.singh.001@Anurag-Singh-WPMHJ5619X.local>
…chant_order_reference_id (juspay#9781) Co-authored-by: Anurag Singh <anurag.singh.001@MacBookPro.lan> Co-authored-by: Anurag Singh <anurag.singh.001@Anurag-Singh-WPMHJ5619X.local>
Type of Change
Closes this issue
Description
Added Webhook Flow and Support for merchant_order_reference_id for Peachpayments
Additional Changes
Motivation and Context
How did you test it?
verify_webhook_sourcetotrueResponse:
200 OK Status
Incoming Webhook Screenshot:
Checklist
cargo +nightly fmt --allcargo clippy