code: import stripe
  stripe.api_key = "sk_test_your_key"
  
  # To create a PaymentIntent for confirmation, see our guide at: https://stripe.com/docs/payments/payment-intents/creating-payment-intents#creating-for-automatic
  stripe.PaymentIntent.confirm(
    "pi_1DrPsv2eZvKYlo2CEDzqXfPH",
    payment_method="pm_card_visa",
  )
  '''Response {
    "id": "pi_1DrPsv2eZvKYlo2CEDzqXfPH",
    "object": "payment_intent",
    "amount": 1000,
    "amount_capturable": 0,
    "amount_details": {
      "tip": {}
    },
    "amount_received": 1000,
    "application": null,
    "application_fee_amount": null,
    "automatic_payment_methods": null,
    "canceled_at": null,
    "cancellation_reason": null,
    "capture_method": "automatic",
    "charges": {
      "object": "list",
      "data": [
        {
          "id": "ch_1EXUPv2eZvKYlo2CStIqOmbY",
          "object": "charge",
          "amount": 1000,
          "amount_captured": 1000,
          "amount_refunded": 0,
          "application": null,
          "application_fee": null,
          "application_fee_amount": null,
          "balance_transaction": "txn_1EXUPv2eZvKYlo2CNUI18wV8",
          "billing_details": {
            "address": {
              "city": null,
              "country": null,
              "line1": null,
              "line2": null,
              "postal_code": null,
              "state": null
            },
            "email": null,
            "name": null,
            "phone": null
          },
          "calculated_statement_descriptor": "Stripe",
          "captured": true,
          "created": 1557239835,
          "currency": "usd",
          "customer": null,
          "description": "One blue fish",
          "disputed": false,
          "failure_balance_transaction": null,
          "failure_code": null,
          "failure_message": null,
          "fraud_details": {},
          "invoice": null,
          "livemode": false,
          "metadata": {},
          "on_behalf_of": null,
          "outcome": {
            "network_status": "approved_by_network",
            "reason": null,
            "risk_level": "normal",
            "risk_score": 9,
            "seller_message": "Payment complete.",
            "type": "authorized"
          },
          "paid": true,
          "payment_intent": "pi_1DrPsv2eZvKYlo2CEDzqXfPH",
          "payment_method": "pm_1EXUPv2eZvKYlo2CUkqZASBe",
          "payment_method_details": {
            "card": {
              "brand": "visa",
              "checks": {
                "address_line1_check": null,
                "address_postal_code_check": null,
                "cvc_check": null
              },
              "country": "US",
              "exp_month": 5,
              "exp_year": 2020,
              "fingerprint": "Xt5EWLLDS7FJjR1c",
              "funding": "credit",
              "installments": null,
              "last4": "4242",
              "mandate": null,
              "moto": null,
              "network": "visa",
              "three_d_secure": null,
              "wallet": null
            },
            "type": "card"
          },
          "receipt_email": null,
          "receipt_number": "1230-7299",
          "receipt_url": "https://pay.stripe.com/receipts/acct_1032D82eZvKYlo2C/ch_1EXUPv2eZvKYlo2CStIqOmbY/rcpt_F1XUd7YIQjmM5TVGoaOmzEpU0FBogb2",
          "redaction": null,
          "refunded": false,
          "refunds": {
            "object": "list",
            "data": [],
            "has_more": false,
            "url": "/v1/charges/ch_1EXUPv2eZvKYlo2CStIqOmbY/refunds"
          },
          "review": null,
          "shipping": null,
          "source_transfer": null,
          "statement_descriptor": null,
          "statement_descriptor_suffix": null,
          "status": "succeeded",
          "transfer_data": null,
          "transfer_group": null
        }
      ],
      "has_more": false,
      "url": "/v1/charges?payment_intent=pi_1DrPsv2eZvKYlo2CEDzqXfPH"
    },
    "client_secret": "pi_1DrPsv2eZvKYlo2CEDzqXfPH_secret_9J35eTzWlxVmfbbQhmkNbewuL",
    "confirmation_method": "automatic",
    "created": 1524505326,
    "currency": "usd",
    "customer": null,
    "description": "One blue fish",
    "invoice": null,
    "last_payment_error": null,
    "livemode": false,
    "metadata": {},
    "next_action": null,
    "on_behalf_of": null,
    "payment_method": "pm_1EXUPv2eZvKYlo2CUkqZASBe",
    "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": "succeeded",
    "transfer_data": null,
    "transfer_group": null
  }'''
nl: Confirm a PaymentIntentConfirm that your customer intends to pay with current or provided
  payment method. Upon confirmation, the PaymentIntent will attempt to initiate
  a payment.
  If the selected payment method requires additional authentication steps, the
  PaymentIntent will transition to the requires_action status and
  suggest additional actions via next_action. If payment fails,
  the PaymentIntent will transition to the requires_payment_method status. If
  payment succeeds, the PaymentIntent will transition to the succeeded
  status (or requires_capture, if capture_method is set to manual).
  If the confirmation_method is automatic, payment may be attempted
  using our client SDKs
  and the PaymentIntent’s client_secret.
  After next_actions are handled by the client, no additional
  confirmation is required to complete the payment.
  If the confirmation_method is manual, all payment attempts must be
  initiated using a secret key.
  If any actions are required for the payment, the PaymentIntent will
  return to the requires_confirmation state
  after those actions are completed. Your server needs to then
  explicitly re-confirm the PaymentIntent to initiate the next payment
  attempt. Read the expanded documentation
  to learn more about manual confirmation.Parameters payment_method optional ID of the payment method (a PaymentMethod, Card, or compatible Source object) to attach to this PaymentIntent. receipt_email optional Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings. setup_future_usage optional enum Indicates that you intend to make future payments with this PaymentIntent’s payment method.
  Providing this parameter will attach the payment method to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes.
  When processing card payments, Stripe also uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.
  If setup_future_usage is already set and you are performing a request using a publishable key, you may only update the value from on_session to off_session.Possible enum valueson_session Use on_session if you intend to only reuse the payment method when your customer is present in your checkout flow.off_session Use off_session if your customer may or may not be present in your checkout flow. shipping optional dictionary Shipping information for this PaymentIntent.Show child parametersMore parametersExpand all  capture_method optional enum secret key only   error_on_requires_action optional   mandate optional secret key only   mandate_data optional dictionary   off_session optional secret key only   payment_method_data optional dictionary   payment_method_options optional dictionary secret key only   payment_method_types optional secret key only   radar_options optional dictionary secret key only   return_url optional   use_stripe_sdk optional ReturnsReturns the resulting PaymentIntent after all possible transitions are applied