Paypal subscriptions: how to verify successful sandbox payment

i'm currently experimenting with paypal + nextjs for subscriptions i think i got it right so far code goes something like this:
<PayPalButtons
createSubscription={async (data, actions) => {
const res = await myFetch(
'/api/payment/create_subscription',
{
method: 'POST',
},
)

return actions.subscription
.create({
plan_id: res.id,
})
.then((orderId) => {
return orderId
})
}}
onApprove={async (data, actions) => {
toast.success(`Subscription payment success! : ${data.subscriptionID}`)
}}
/>
<PayPalButtons
createSubscription={async (data, actions) => {
const res = await myFetch(
'/api/payment/create_subscription',
{
method: 'POST',
},
)

return actions.subscription
.create({
plan_id: res.id,
})
.then((orderId) => {
return orderId
})
}}
onApprove={async (data, actions) => {
toast.success(`Subscription payment success! : ${data.subscriptionID}`)
}}
/>
looks like it worked how do i check if the payment is successful tho? (can't find any info on the developer sandbox accounts about any ongoing subscriptions) (i can't use stripe where i live btw)
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server