be careful, ```customer_id``` is global variable, ```var customer_id``` not. Also you can replace it line with: 
``` customer_id = this.value```
I think that is more safe not use global variable. 
You can defined it in the header of function.
```js
$("#receipt_customer_tokens").on("change", function(){
  var customer_id;
  ...
```