#José Anchieta
1 messages · Page 1 of 1 (latest)
Can you share an example request id of the payment intent creation?
https://stripe.com/docs/api/request_ids
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Assuming you don't already have the payment method collected, this seems expected. You'd need to complete the payment with Stripe.js in the client:
https://stripe.com/docs/payments/pix/accept-a-payment?platform=web#web-submit-payment
Hi @quaint obsidian in this page https://stripe.com/docs/payments/pix/accept-a-payment?platform=web there's an example on how to create a PaymentIntent
Stripe::PaymentIntent.create( {amount: 1099, currency: 'brl', payment_method_types: ['pix']}, )
I'm trying like this:
{
customer: "cus_L0PKrizM5KscSU",
amount: 1099,
currency: 'brl',
payment_method_types: ['pix'],
payment_method_options: {
pix: {
expires_after_seconds: 2000
}
}
}
)
Right, so then you'd need to do the client side step to complete that
And this is what i get:
"id": "pi_3M4ragCBBZfRcKlq0sGu0Bef",
"object": "payment_intent",
"amount": 1099,
"amount_capturable": 0,
"amount_details": {"tip":{}},
"amount_received": 0,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"charges": {"object":"list","data":[],"has_more":false,"total_count":0,"url":"/v1/charges?payment_intent=pi_3M4ragCBBZfRcKlq0sGu0Bef"},
"confirmation_method": "automatic",
"created": 1668628090,
"currency": "brl",
"customer": "cus_L0PKrizM5KscSU",
"description": null,
"invoice": null,
"last_payment_error": null,
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": null,
"payment_method_options": {"pix":{"expires_after_seconds":2000,"expires_at":null}},
"payment_method_types": [
"pix"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "requires_payment_method",
"transfer_data": null,
"transfer_group": null
}```
Do i need to do something on the client side since i'm using the API?
(its test mode, but you should remove the client_secret there -- those should not be shared)
Nice tip, thanks.
Today i checked and the Pix payment type is enabled on Production and Test, so probably i'm not passing the correct arguments to the PaymentIntent creation.
You are, but there's another step to take I pointed to here
requires_payment_method is expected, you then need to complete the payment on the client side app with your customer