import { pay } from '@base-org/account'
import { useAccount } from 'wagmi' // Optional - just for display
export function CheckoutButton() {
const { address } = useAccount() // Optional
const handlePayment = async () => {
try {
const payment = await pay({
amount: '5.00',
to: '0xYourAddress',
testnet: true
})
console.log('Payment sent:', payment.id)
} catch (error) {
console.error('Payment failed:', error)
}
}
return (
<div>
{address && <p>Connected: {address}</p>}
<button onClick={handlePayment}>
Pay $5.00 with Base Pay
</button>
</div>
)
}