#rafael_card-installments

1 messages · Page 1 of 1 (latest)

loud bayBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1504233188275519519

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

vapid bridge
#

Hello 👋

Can you provide the doc you are following for this integration?

zinc pagoda
vapid bridge
#

Unfortunately, this doc has no good examples of exactly how to do this

zinc pagoda
#

How do i do that? Remeber, i'm from Brazil

vapid bridge
zinc pagoda
#

see how i'm doing:
class CreateStripeIntentView(APIView):

permission_classes = [AllowAny]

def post(self, request):

    try:

        print("BODY:", request.data)

        amount = request.data.get("amount")

        if not amount:
            return Response(
                {"error": "Amount obrigatório"},
                status=400
            )

        amount_decimal = Decimal(str(amount))

        print("AMOUNT:", amount_decimal)

        intent = stripe.PaymentIntent.create(
            amount=int(amount_decimal * 100),
            currency="brl",
            payment_method_types=["card"],
            payment_method_options={
                "card": {
                    "installments": {
                        "enabled": True
                    }
                }
            }
        )

        print("INTENT:", intent.id, intent)

        return Response({
            "client_secret": intent.client_secret
        })

    except Exception as e:

        print("ERRO STRIPE:", str(e))

        return Response(
            {"error": str(e)},
            status=500
        )
vapid bridge
#

That doesn't help me

zinc pagoda
#

Will that work to currency = brl?

vapid bridge
#

For payment method types card, yes. The currency being BRL would just restrict the different payment method types available. But you are asking about installments that are specific to credit cards so that should not matter here.

#

Actually I think I may be incorrect here. I'm looking to see if we have something for BRL

loud bayBOT