Skip to content

Commit

Permalink
fix: return url none on complete authorize (#3067)
Browse files Browse the repository at this point in the history
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
  • Loading branch information
dracarys18 and hyperswitch-bot[bot] authored Dec 6, 2023
1 parent 8a995ce commit 6eec06b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,11 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>

payment_intent.shipping_address_id = shipping_address.clone().map(|i| i.address_id);
payment_intent.billing_address_id = billing_address.clone().map(|i| i.address_id);
payment_intent.return_url = request.return_url.as_ref().map(|a| a.to_string());
payment_intent.return_url = request
.return_url
.as_ref()
.map(|a| a.to_string())
.or(payment_intent.return_url);

payment_intent.allowed_payment_method_types = request
.get_allowed_payment_method_types_as_value()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>
payment_attempt.browser_info = browser_info;
payment_attempt.payment_method_type =
payment_method_type.or(payment_attempt.payment_method_type);
payment_attempt.payment_experience = request.payment_experience;
payment_attempt.payment_experience = request
.payment_experience
.or(payment_attempt.payment_experience);
currency = payment_attempt.currency.get_required_value("currency")?;
amount = payment_attempt.amount.into();

Expand Down Expand Up @@ -173,7 +175,11 @@ impl<F: Send + Clone, Ctx: PaymentMethodRetrieve>

payment_intent.shipping_address_id = shipping_address.clone().map(|i| i.address_id);
payment_intent.billing_address_id = billing_address.clone().map(|i| i.address_id);
payment_intent.return_url = request.return_url.as_ref().map(|a| a.to_string());
payment_intent.return_url = request
.return_url
.as_ref()
.map(|a| a.to_string())
.or(payment_intent.return_url);

payment_intent.allowed_payment_method_types = request
.get_allowed_payment_method_types_as_value()
Expand Down

0 comments on commit 6eec06b

Please sign in to comment.