@@ -18,7 +18,7 @@ export default {
1818 itemPriceId : {
1919 propDefinition : [
2020 chargebee ,
21- "itemPriceId"
21+ "itemPriceId" ,
2222 ] ,
2323 } ,
2424 unitPrice : {
@@ -58,26 +58,26 @@ export default {
5858 } ,
5959 async run ( { $ } ) {
6060 try {
61- const response = await this . chargebee . createSubscription ( this . customerId , clearObject ( {
62- id : this . id ,
63- net_term_days : this . netTermDays ,
64- start_date : this . startDate && ( Date . parse ( this . startDate ) / 1000 ) ,
65- subscription_items : [
66- {
67- item_price_id : this . itemPriceId ,
68- item_type : "plan" ,
69- unit_price : this . unitPrice ,
70- quantity : this . quantity ,
71- }
72- ] ,
73- ...this . additionalFields ,
74- } ) ) ;
61+ const response = await this . chargebee . createSubscription ( this . customerId , clearObject ( {
62+ id : this . id ,
63+ net_term_days : this . netTermDays ,
64+ start_date : this . startDate && ( Date . parse ( this . startDate ) / 1000 ) ,
65+ subscription_items : [
66+ {
67+ item_price_id : this . itemPriceId ,
68+ item_type : "plan" ,
69+ unit_price : this . unitPrice ,
70+ quantity : this . quantity ,
71+ } ,
72+ ] ,
73+ ...this . additionalFields ,
74+ } ) ) ;
7575
76- $ . export ( "$summary" , `Successfully created subscription (ID: ${ response ?. subscription ?. id } )` ) ;
77- return response ;
78- } catch ( error ) {
79- $ . export ( "debug" , error ) ;
80- throw new Error ( "Error creating subscription. Check the debug export for more information." )
81- }
76+ $ . export ( "$summary" , `Successfully created subscription (ID: ${ response ?. subscription ?. id } )` ) ;
77+ return response ;
78+ } catch ( error ) {
79+ $ . export ( "debug" , error ) ;
80+ throw new Error ( "Error creating subscription. Check the debug export for more information." ) ;
81+ }
8282 } ,
8383} ;
0 commit comments