Retrieve a PaymentIntent
Retrieve a PaymentIntent resource by ID.
A PaymentIntent can be retrieved from the client side using a public API key when the client_secret
is passed via query string.
Endpoint
GET /payment_intents/:id
Sample code
- curl
- Node
- PHP
- Python
- Ruby
curl --location 'https://api.payrexhq.com/payment_intents/<ID of a payment intent resource>' \
-u replace_with_secret_api_key:
const client = require('payrex-node')('insert your PayRex Secret API key.');
const paymentIntent = await client.paymentIntents.retrieve('<ID of a payment intent resource>');
$client = new \Payrex\PayrexClient('insert your PayRex Secret API key.');
$paymentIntent = $client->paymentIntents->retrieve('<ID of a payment intent resource>');
from payrex import Client as PayrexClient
client = PayrexClient('insert your PayRex Secret API key.')
payment_intent = client.payment_intents.retrieve('<ID of a payment intent resource>')
client = Payrex::Client.new("insert your PayRex Secret API key.")
payment_intent = client.payment_intents.retrieve("<ID of a payment intent resource>")
Parameters
client_secret REQUIRED IF YOU USE A PUBLIC KEY.
The client secret of the PaymentIntent. This attribute is required if you authenticate with the endpoint using your public key. This endpoint is used by PayRexJS using the public key.
Returns
Returns a PaymentIntent resource.