Skip to content

Commit

Permalink
Braintree: Handle empty billing address
Browse files Browse the repository at this point in the history
  • Loading branch information
damianpm authored and thomasmaas committed Mar 17, 2021
1 parent a930583 commit 27ff232
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/views/payment_gateways/_braintree_customer_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
required: "required",
class: "form-control col-md-6",
style: "width:50%;",
value: billing_address_data.name
value: billing_address_data ? billing_address_data.name : ''
},
wrapper_html: {class: "form-group"},
label_html: {class: "col-md-4 control-label" }
Expand All @@ -90,7 +90,7 @@
required: "required",
class: "form-control col-md-6",
style: "width:50%;",
value: billing_address_data.address1
value: billing_address_data ? billing_address_data.address1 : ''
},
wrapper_html: {class: "form-group"},
label_html: {class: "col-md-4 control-label" }
Expand All @@ -101,7 +101,7 @@
required: "required",
class: "form-control col-md-6",
style: "width:50%;",
value: billing_address_data.zip
value: billing_address_data ? billing_address_data.zip : ''
},
wrapper_html: {class: "form-group"},
label: "ZIP / Postal Code",
Expand All @@ -114,7 +114,7 @@
required: "required",
class: "form-control col-md-6",
style: "width:50%;",
value: billing_address_data.city
value: billing_address_data ? billing_address_data.city : ''
},
wrapper_html: {class: "form-group"},
label: "City",
Expand All @@ -136,7 +136,7 @@
<%= billing_address.input :country_name,
as: :select,
collection: options_for_select(merchant_countries, get_country_code(billing_address_data)),
collection: options_for_select(merchant_countries, billing_address_data ? get_country_code(billing_address_data) : ''),
input_html: {required: "required", class: "form-control col-md-6", style: "width:50%;" },
wrapper_html: {class: "form-group"},
label: "Country",
Expand Down

0 comments on commit 27ff232

Please sign in to comment.