Hi- so I’m pulling the Stripe FX API to convert the foreign currency to USD before going into checkout. I had to use regex to get what I want (“exchange_rate”) from API because the currency code changes each call, so I couldn’t use the normal output.
It works fine when I was just using input/text elements to test. However, when I integrated it into the workflow, it would return “0” to my data field. I’m not sure what I’m doing wrong.
Edit 1 It seems to be a Bubble API intake problem. I pulled the workflow to the frontend and take a look what’s going on. It seems if I deviate away from Mexican pesos, Bubble is returning the entire API output as empty:
It’s a problem on Bubble’s end because when I checked Stripe’s developer console. It’s returning this output:
{
“id”:
“fxq_1RI0fQR6aaZt6bKXCvuCr4j9”,
“object”:
“fx_quote”,
“created”:
1745642924
,
“lock_duration”:
“none”,
“lock_expires_at”:
null,
“lock_status”:
“none”,
“rates”: {
“cop”: {
“exchange_rate”:
0.000233887,
“rate_details”: {
“base_rate”:
0.000236249,
“duration_premium”:
0,
“fx_fee_rate”:
0.01,
“reference_rate”:
null,
“reference_rate_provider”:
null,
},
},
},
“to_currency”:
“usd”,
“usage”: {
“payment”: {
“destination”:
null,
“on_behalf_of”:
null,
},
“transfer”:
null,
“type”:
“payment”,
},
}
Raw body:
{
“id”: “fxq_1RI0JUR6aaZt6bKXFSw9EecU”,
“object”: “fx_quote”,
“created”: 1745641564,
“lock_duration”: “none”,
“lock_expires_at”: null,
“lock_status”: “none”,
“rates”: {
“brl”: {
"exchange_rate": 0.174077,
< trying to pull this number
“rate_details”: {
“base_rate”: 0.175835,
“duration_premium”: 0,
“fx_fee_rate”: 0.01,
“reference_rate”: 0.175898,
“reference_rate_provider”: “ecb”
}
}
},
“to_currency”: “usd”,
“usage”: {
“payment”: {
“destination”: null,
“on_behalf_of”: null
},
“transfer”: null,
“type”: “payment”
}
}`