Create payment intent using stripe

Curl

curl https://api.stripe.com/v1/payment_intents \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d amount=2000 \ -d currency=usd \ -d “payment_method_types[]”=card

Creates a PaymentIntent object.
After the PaymentIntent is created, attach a payment method and confirm to continue the payment. You can read more about the different payment flows available via the Payment Intents API here.

When confirm=true is used during creation, it is equivalent to creating and confirming the PaymentIntent in the same call. You may use any parameters available in the confirm API when confirm=true is supplied.

Parameters
amount
REQUIRED
Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).

currency
REQUIRED
Three-letter ISO currency code, in lowercase. Must be a supported currency.

Sample response

{ “id”: “pi_1Dsr1T2eZvKYlo2C7KHhBRmV”, “object”: “payment_intent”, “amount”: 2000, “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”, “client_secret”: “pi_1Dsr1T2eZvKYlo2C7KHhBRmV_secret_qH4mhHMXKbJjDgyVuBao7MkBq”, “confirmation_method”: “automatic”, “created”: 1547555283, “currency”: “usd”, “customer”: null, “description”: null, “invoice”: null, “last_payment_error”: null, “latest_charge”: null, “livemode”: false, “metadata”: {}, “next_action”: null, “on_behalf_of”: null, “payment_method”: null, “payment_method_options”: {}, “payment_method_types”: [ “card” ], “processing”: null, “receipt_email”: null, “redaction”: null, “review”: null, “setup_future_usage”: null, “shipping”: null, “statement_descriptor”: null, “statement_descriptor_suffix”: null, “status”: “requires_payment_method”, “transfer_data”: null, “transfer_group”: null }

Leave a comment

Your email address will not be published. Required fields are marked *