Skip to content
Snippets Groups Projects
Commit c6cb384c authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

fixed expiration date for manual charges

parent 02469400
No related branches found
No related tags found
No related merge requests found
Pipeline #7390 passed
......@@ -197,7 +197,7 @@ class PaymentReference {
}
resolve(
parseInt(matcher[2]) -
config.get("price.number_range.payment_reference")
config.get("price.number_range.payment_reference")
);
});
}
......@@ -313,14 +313,17 @@ class PaymentReference {
/**
* Charges the key without creating a Payment (Manual Charge)
*
* @returns
*
* @returns
*/
async chargeKey() {
return this.getKey(true).then(key => {
key.charge_key_order(this.amount, this.id, dayjs().add(config.get("keys.expiration_days"), "days"));
return key.save();
})
return this.getKey(true).then((key) => {
let expiration = dayjs().add(config.get("keys.expiration_days"), "days");
return this.setExpiration(expiration).then(() => {
key.charge_key_order(this.amount, this.id, expiration);
return key.save();
});
});
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment