0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Updated price serialisation on subscription

refs https://github.com/TryGhost/Team/issues/586
refs aa12770329

Using `id` as ghost id for subscription prices can be confusing as everything in the method refers ids to be stripe ids. This change updates the ghost id value to use `price_id` key in the serialization
This commit is contained in:
Rishabh 2021-05-07 15:13:23 +05:30
parent d2c6838133
commit 5628bb5f5a

View file

@ -39,8 +39,8 @@ const StripeCustomerSubscription = ghostBookshelf.Model.extend({
if (defaultSerializedObject.stripePrice) {
serialized.price = {
id: defaultSerializedObject.stripePrice.id,
stripe_price_id: defaultSerializedObject.stripePrice.stripe_price_id,
id: defaultSerializedObject.stripePrice.stripe_price_id,
price_id: defaultSerializedObject.stripePrice.id,
nickname: defaultSerializedObject.stripePrice.nickname,
amount: defaultSerializedObject.stripePrice.amount,
interval: defaultSerializedObject.stripePrice.interval,