CBsubs item price

2 years 6 months ago #326716 by activha
CBsubs item price was created by activha
Hello

We need to compute an item price from the basket object in order to transfer the real unit price to our accounting software.

What is the formula that you use to get the price without taxes for an invoice between mc_gross, discount_amount, rate and mc_amount3 ?

Thanks
Jean

Please Log in to join the conversation.

2 years 6 months ago #326722 by krileon
Replied by krileon on topic CBsubs item price
mc_gross = Amount for single payment in currency of payment basket. Full amount of the customer's payment, before transaction fee is subtracted.

mc_amount1 = First amount of payment subscription in currency of payment basket

mc_amount3 = Recurring amount of payment subscription in currency of payment basket

If you need to send the full computed amount they paid you'd use mc_gross. If your software stores tax separately then subtract $paymentBasket->tax from $paymentBasket->mc_gross. Suggest reviewing our various analytic plugins for CBSubs for further examples.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 6 months ago #326725 by activha
Replied by activha on topic CBsubs item price

If you need to send the full computed amount they paid you'd use mc_gross


Do you mean that mc_gross will include also any discounts (positive or negative) ?
And in the case of recurring payments with a first payment which is different, the successive values of mc_gross for following payments will be correct ?

I remember having to compute with discount_amount a few years ago

Please Log in to join the conversation.

2 years 6 months ago #326728 by krileon
Replied by krileon on topic CBsubs item price

Do you mean that mc_gross will include also any discounts (positive or negative) ?

Yes, it's the gross amount. mc_gross is typically what you should be sending to your software as it's the actual amount they will pay. When dealing with recurring subscriptions then their first payment is in mc_amount1 and their next recurring payment will be mc_amount3.

I remember having to compute with discount_amount a few years ago

If you want mc_gross without discount_amount then you'll need to do that math same as if you wanted mc_gross without tax. Note there's first_discount_amount and discount_amount depending on if it's first payment or not and depending on promotion configurations.

You can also itemize by calling loadPaymentItems function on the basket to return a list of basket items, which have a getPrice function for returning their individual item prices.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 6 months ago #326729 by activha
Replied by activha on topic CBsubs item price
Ok Thanks
As we do not need item prices for now, the best thing I guess is only to use mc_gross and tax for all first and then recurring payment
Correct ?

Please Log in to join the conversation.

2 years 6 months ago #326731 by krileon
Replied by krileon on topic CBsubs item price
Yes, typically you'll only need to bother with sending mc_gross and minus tax if you don't want to include tax or want to send tax separately.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.219 seconds