Capture PayPal Order For Presale
Confirm and capture PayPal payments after user authorization
Capture PayPal Order
Finalize PayPal payments and update presale order status
Mutation
Schema
captureOrderForPresale(
orderId: String!
): Boolean
Parameters
orderId
RequiredString!
Return Value
Returns true
if capture successful, false
otherwise
Example
mutation {
captureOrderForPresale(
orderId: "5O190127TN364715T"
)
}
Response Example
{
"data": {
"captureOrderForPresale": true
}
}
How It Works
Backend validates the PayPal order ID with PayPal's API
Confirms that the payment was approved and completed by the user
Backend captures the authorized funds from PayPal
Updates the presale order status and triggers token delivery
Important Notes
Only call this mutation after the user returns from PayPal checkout
The backend verifies payment with PayPal before updating the order
Safe to call multiple times - subsequent calls will return the same result
Returns false if payment wasn't completed or if the order ID is invalid
Extract the order ID from the return URL query parameters when PayPal redirects users back to your site. Call this mutation immediately to capture the payment. Display appropriate success or error messages to users based on the response. Consider implementing webhook handlers for more reliable payment confirmation.