Просмотр исходного кода

Fix invalid country being sent to Stripe

Alan Lam 1 год назад
Родитель
Сommit
d46f1090fb
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      engine/helpers/stripe_helper.php

+ 6 - 1
engine/helpers/stripe_helper.php

@@ -34,9 +34,14 @@ class StripeHelper {
 			$name = $location->name;
 		}
 
+		$country = null;
+		if($location->country === "United Kingdom") {
+			$country = "GB";
+		}
+
 		$address = [
 			"city" => $location->city,
-			"country" => $location->country,
+			"country" => $country,
 			"line1" => $location->address_1,
 			"line2" => $location->address_2,
 			"postal_code" => $location->postal_code,