Self-Service Checkout
SDK methods for self-service checkouts — changing payment method or address on an existing subscription.
Change payment method
import React from "react"
import { useBasket } from "@limio/sdk"
const ChangePaymentButton = ({ subscription, checkoutPageUrl = "/checkout" }) => {
const { initiateCheckout, basketLoading } = useBasket()
const handleChangePayment = async () => {
const basket = await initiateCheckout({
order: {
order_type: "change_payment",
forSubscription: {
id: subscription.id
}
}
})
const checkoutId = basket.order.checkoutId
window.location.href = `${checkoutPageUrl}?basket=${checkoutId}`
}
return (
<button onClick={handleChangePayment} disabled={basketLoading}>
Change payment method
</button>
)
}Change address
Field
Type
Description
Pre-populated basket data
Notes
See also
Last updated
Was this helpful?

