pretty js
This commit is contained in:
parent
ba73e688f2
commit
035187d843
|
@ -42,20 +42,20 @@ export default Ember.Component.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
validateBilling() {
|
validateBilling() {
|
||||||
const billing = this.get('billing');
|
const billing = this.get("billing");
|
||||||
const deleteEmpty = (key) => {
|
const deleteEmpty = key => {
|
||||||
if(Ember.isEmpty(billing.get(key))) {
|
if (Ember.isEmpty(billing.get(key))) {
|
||||||
billing.set(key, undefined);
|
billing.set(key, undefined);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
['name', 'phone', 'email'].forEach((key) => deleteEmpty(key));
|
["name", "phone", "email"].forEach(key => deleteEmpty(key));
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
submitStripeCard() {
|
submitStripeCard() {
|
||||||
this.validateBilling();
|
this.validateBilling();
|
||||||
|
|
||||||
const paymentOptions = { billing_details: this.get('billing') };
|
const paymentOptions = { billing_details: this.get("billing") };
|
||||||
|
|
||||||
this.stripe.createPaymentMethod("card", this.card, paymentOptions).then(
|
this.stripe.createPaymentMethod("card", this.card, paymentOptions).then(
|
||||||
result => {
|
result => {
|
||||||
|
|
Loading…
Reference in New Issue