Browse Source

Fix invalid country being sent to Stripe

Alan Lam 1 năm trước cách đây
mục cha
commit
d46f1090fb
1 tập tin đã thay đổi với 6 bổ sung và 1 xóa
  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,