Skip to content

Commit 6fa1369

Browse files
fix(labrinth): tentative billing period update fix (#3722)
* fix(labrinth/billing): add Spain and Singapore to the list of countries for currency inferences This should fix payments in those countries not going through with their local currencies for products that do not have USD-only pricing. * fix(labrinth/billing): tentative fix for subscription periods not updating
1 parent b66d99c commit 6fa1369

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apps/labrinth/src/routes/internal/billing.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@ fn infer_currency_code(country: &str) -> String {
10201020
"BE" => "EUR",
10211021
"CY" => "EUR",
10221022
"EE" => "EUR",
1023+
"ES" => "EUR",
10231024
"FI" => "EUR",
10241025
"FR" => "EUR",
10251026
"DE" => "EUR",
@@ -1066,6 +1067,7 @@ fn infer_currency_code(country: &str) -> String {
10661067
"TW" => "TWD",
10671068
"SA" => "SAR",
10681069
"QA" => "QAR",
1070+
"SG" => "SGD",
10691071
_ => "USD",
10701072
}
10711073
.to_string()
@@ -1302,6 +1304,12 @@ pub async fn initiate_payment(
13021304
amount: Some(price),
13031305
currency: Some(stripe_currency),
13041306
customer: Some(customer),
1307+
metadata: interval.map(|interval| {
1308+
HashMap::from([(
1309+
"modrinth_subscription_interval".to_string(),
1310+
interval.as_str().to_string(),
1311+
)])
1312+
}),
13051313
..Default::default()
13061314
};
13071315

0 commit comments

Comments
 (0)