Skip to content

Commit

Permalink
Redirect to hosted checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
acasazza committed Jul 30, 2024
1 parent a8992ec commit 9028bc1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export function CheckoutLink(props: Props): JSX.Element {
): void {
e.preventDefault()
e.stopPropagation()
console.log('e.currentTarget.href', e.currentTarget.href)
const currentHref = e.currentTarget.href
if (accessToken && endpoint && order?.id) {
void getOrganizationConfig({
accessToken,
Expand All @@ -74,11 +76,11 @@ export function CheckoutLink(props: Props): JSX.Element {
if (config?.links?.checkout) {
location.href = config.links.checkout
} else {
location.href = e.currentTarget.href
location.href = currentHref
}
})
} else {
location.href = e.currentTarget.href
location.href = currentHref
}
}
return children ? (
Expand Down

0 comments on commit 9028bc1

Please sign in to comment.