Capture a PaymentIntent
Captures a PaymentIntent resource.
Endpoint
POST /payment_intents/:id/capture
Sample code
- curl
- Node
- PHP
- Python
- Ruby
curl --request POST --location 'https://api.payrexhq.com/payment_intents/<ID of a payment intent resource>/capture' \
-u replace_with_secret_api_key: \
--data-urlencode 'amount=10000'
const client = require('payrex-node')('insert your PayRex Secret API key.');
const paymentIntent = await client.paymentIntents.capture(
// Payment Intent to capture.
'<ID of a payment intent resource>',
{
// Amount is in cents. The sample below is 100.00.
amount: 10000,
}
)
$client = new \Payrex\PayrexClient('insert your PayRex Secret API key.');
$paymentIntent = $client->paymentIntents->capture([
// Payment Intent to capture.
'id' => '<ID of a payment intent resource>',
// Amount is in cents. The sample below is 100.00.
'amount' => 10000
]);
from payrex import Client as PayrexClient
client = PayrexClient('insert your PayRex Secret API key.')
payment_intent = client.payment_intents.capture(
# Payment Intent to capture.
'<ID of a payment intent resource>',
{
# Amount is in cents. The sample below is 100.00.
'amount': 10000
}
)
client = Payrex::Client.new("insert your PayRex Secret API key.")
payment_intent = client.payment_intents.capture(
# Payment Intent to capture.
"<ID of a payment intent resource>",
{
# Amount is in cents. The sample below is 100.00.
amount: 10000
}
)
Parameters
id REQUIRED
The id of the PaymentIntent to be captured.
amount REQUIRED
The amount to be captured by the PaymentIntent. This is a positive integer that your customer authorized in the smallest currency unit, cents. If the customer should pay ₱ 120.50, the amount of the PaymentIntent should be 12050.
The minimum amount is ₱ 20 (2000 in cents), and the maximum amount is ₱ 59,999,999.99 (5999999999 in cents).
This attribute is best used for hold then capture feature of the card payment method.
Returns
Returns a PaymentIntent resource.