Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout Amount in FastSpring does not represent Cart Quantities #8

Closed
ps-PKrueger opened this issue Jun 18, 2018 · 10 comments
Closed

Comments

@ps-PKrueger
Copy link

ps-PKrueger commented Jun 18, 2018

I am making this a separate issue, as the issues may not be connected in the plugin.

1.1.2 seems to have solved the dividing error (dividing the price by the number of items of that type in the cart), but now there is an error when updating the cart. This happens when I am in the cart, and I have selected multiple items with quantities. When I first go to the checkout page, add my info and click the "Place Order" button, I get a price value in the pop up that is for quantity 1 of each item in the cart. When I cancel and click the "Place Order" button again, it updates to the correct value for all items and quantities in the cart.

If I go back to the cart, it resets with this same behavior, so I think that it may be pulling incorrect quantity information from the cart. I added a picture so that you could see the different prices.

@cyberwombat
Copy link
Owner

I see. I had a default pricing that gets modified when a product is a sub but I didn't have that check in the correct place. This should be fixed. I also addressed an issue with coupons not being applied to subscription signup fees so that works now as well. Hopefully :)

@ps-PKrueger
Copy link
Author

I will test this today. Thanks! More info to come!

@ps-PKrueger
Copy link
Author

Unfortunately, this is still not working correctly.

I updated, but am still getting the price for quantity 1 of each the first time that I select the checkout button that brings up the pop-up. The plugin is still not grabbing the correct quantities from the cart.

If I cancel the pop-up, and click the button to bring up the checkout, the plugin grabs the correct prices.

I am going to complete a checkout to see if the quantities are being reduced to 1, or if the prices are just being changed.

More to come.

@ps-PKrueger
Copy link
Author

More info on the behavior.

When I visit the cart, and the popup gives me the cost for only 1 of each item, it is only passing 1 item through to fastspring.

After I cancel the popup and click the checkout button again, it is passing all items through to fastspring. I think this must have something to do with where you are getting the items, because the plugin thinks that it is only passing 1 of each item through to fastspring the first time i go to the checkout.

Hope that you get a chance to take a look at this soon. Thanks!

@ps-PKrueger
Copy link
Author

Here is the log. I removed all the product and user information, but the important bits are there.

You can see that even though the plugin detects that there are products in the cart, it still only passes quantity 1 for each item in the cart to fastspring.

The second part of the log shows the calculation working correctly. You can see where I cancelled the checkout, and clicked the checkout button again. The plugin then gets the correct value and quantity for all items in the cart.

06-20-2018 @ 02:47:00 - Calculating pricing for amount of 38.00 and qty of 5 with cart total of 240 and discount of 0: 38
06-20-2018 @ 02:47:00 - Calculating pricing for amount of 50 and qty of 1 with cart total of 240 and discount of 0: 50
06-20-2018 @ 02:47:39 - API order hJUpZ90iTvy23SBi5PW6ew completion checked
06-20-2018 @ 02:47:40 - Marking order ID 3812 as complete
06-20-2018 @ 02:47:55 - is_valid_webhook_request: Checking FastSpring webhook validity
06-20-2018 @ 02:47:55 - No webhook handler found for
06-20-2018 @ 02:47:55 - [{"id":"jG3agjboRsubC5EIbCwTcQ","processed":false,"created":1529480854460,"type":"subscription.activated","live":false,"data":{"id":"yXF62FiZRNSph09Il_ZrnA","subscription":"yXF62FiZRNSph09Il_ZrnA","active":true,"state":"active","changed":1529480854135,"changedValue":1529480854135,"changedInSeconds":1529480854,"changedDisplay":"6/20/18","live":false,"currency":"USD","account":"","product":"product-with-premium-support","sku":"PS101PT05","display":"product with Premium Support","quantity":1,"adhoc":false,"autoRenew":true,"price":38,"priceDisplay":"$38.00","priceInPayoutCurrency":38,"priceInPayoutCurrencyDisplay":"$38.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subtotal":38,"subtotalDisplay":"$38.00","subtotalInPayoutCurrency":38,"subtotalInPayoutCurrencyDisplay":"$38.00","attributes":{"webhook_action":"UpdateUserInformation"},"tags":{"store_order_id":3812},"next":1560988800000,"nextValue":1560988800000,"nextInSeconds":1560988800,"nextDisplay":"6/20/19","end":null,"endValue":null,"endInSeconds":null,"endDisplay":null,"canceledDate":null,"canceledDateValue":null,"canceledDateInSeconds":null,"canceledDateDisplay":null,"deactivationDate":null,"deactivationDateValue":null,"deactivationDateInSeconds":null,"deactivationDateDisplay":null,"sequence":1,"periods":null,"remainingPeriods":null,"begin":1529452800000,"beginValue":1529452800000,"beginInSeconds":1529452800,"beginDisplay":"6/20/18","intervalUnit":"year","intervalLength":1,"nextChargeCurrency":"USD","nextChargeDate":1560988800000,"nextChargeDateValue":1560988800000,"nextChargeDateInSeconds":1560988800,"nextChargeDateDisplay":"6/20/19","nextChargeTotal":38,"nextChargeTotalDisplay":"$38.00","nextChargeTotalInPayoutCurrency":38,"nextChargeTotalInPayoutCurrencyDisplay":"$38.00","nextNotificationType":"PAYMENT_REMINDER","nextNotificationDate":1560384000000,"nextNotificationDateValue":1560384000000,"nextNotificationDateInSeconds":1560384000,"nextNotificationDateDisplay":"6/13/19","paymentReminder":{"intervalUnit":"week","intervalLength":1},"paymentOverdue":{"intervalUnit":"week","intervalLength":1,"total":4,"sent":0},"cancellationSetting":{"cancellation":"AFTER_LAST_NOTIFICATION","intervalUnit":"week","intervalLength":1},"instructions":[{"product":"product-with-premium-support","type":"regular","periodStartDate":null,"periodStartDateValue":null,"periodStartDateInSeconds":null,"periodStartDateDisplay":null,"periodEndDate":null,"periodEndDateValue":null,"periodEndDateInSeconds":null,"periodEndDateDisplay":null,"intervalUnit":"year","intervalLength":1,"discountPercent":0,"discountPercentValue":0,"discountPercentDisplay":"0%","discountTotal":0,"discountTotalDisplay":"$0.00","discountTotalInPayoutCurrency":0,"discountTotalInPayoutCurrencyDisplay":"$0.00","unitDiscount":0,"unitDiscountDisplay":"$0.00","unitDiscountInPayoutCurrency":0,"unitDiscountInPayoutCurrencyDisplay":"$0.00","price":38,"priceDisplay":"$38.00","priceInPayoutCurrency":38,"priceInPayoutCurrencyDisplay":"$38.00","priceTotal":38,"priceTotalDisplay":"$38.00","priceTotalInPayoutCurrency":38,"priceTotalInPayoutCurrencyDisplay":"$38.00","unitPrice":38,"unitPriceDisplay":"$38.00","unitPriceInPayoutCurrency":38,"unitPriceInPayoutCurrencyDisplay":"$38.00","total":38,"totalDisplay":"$38.00","totalInPayoutCurrency":38,"totalInPayoutCurrencyDisplay":"$38.00"}]}},{"id":"r9e-EdfoSD2lfyiHWIA7lA","processed":false,"created":1529480854758,"type":"subscription.activated","live":false,"data":{"id":"rs1RyZBvQMOQ2p5zY-NMDA","subscription":"rs1RyZBvQMOQ2p5zY-NMDA","active":true,"state":"active","changed":1529480854534,"changedValue":1529480854534,"changedInSeconds":1529480854,"changedDisplay":"6/20/18","live":false,"currency":"USD","account":"","product":"product-with-premium-support-2-license-bundle","sku":"PS101PT06","display":"product with Premium Support (2 License Bundle)","quantity":1,"adhoc":false,"autoRenew":true,"price":50,"priceDisplay":"$50.00","priceInPayoutCurrency":50,"priceInPayoutCurrencyDisplay":"$50.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subtotal":50,"subtotalDisplay":"$50.00","subtotalInPayoutCurrency":50,"subtotalInPayoutCurrencyDisplay":"$50.00","tags":{"store_order_id":3812},"next":1560988800000,"nextValue":1560988800000,"nextInSeconds":1560988800,"nextDisplay":"6/20/19","end":null,"endValue":null,"endInSeconds":null,"endDisplay":null,"canceledDate":null,"canceledDateValue":null,"canceledDateInSeconds":null,"canceledDateDisplay":null,"deactivationDate":null,"deactivationDateValue":null,"deactivationDateInSeconds":null,"deactivationDateDisplay":null,"sequence":1,"periods":null,"remainingPeriods":null,"begin":1529452800000,"beginValue":1529452800000,"beginInSeconds":1529452800,"beginDisplay":"6/20/18","intervalUnit":"year","intervalLength":1,"nextChargeCurrency":"USD","nextChargeDate":1560988800000,"nextChargeDateValue":1560988800000,"nextChargeDateInSeconds":1560988800,"nextChargeDateDisplay":"6/20/19","nextChargeTotal":50,"nextChargeTotalDisplay":"$50.00","nextChargeTotalInPayoutCurrency":50,"nextChargeTotalInPayoutCurrencyDisplay":"$50.00","nextNotificationType":"PAYMENT_REMINDER","nextNotificationDate":1560384000000,"nextNotificationDateValue":1560384000000,"nextNotificationDateInSeconds":1560384000,"nextNotificationDateDisplay":"6/13/19","paymentReminder":{"intervalUnit":"week","intervalLength":1},"paymentOverdue":{"intervalUnit":"week","intervalLength":1,"total":4,"sent":0},"cancellationSetting":{"cancellation":"AFTER_LAST_NOTIFICATION","intervalUnit":"week","intervalLength":1},"instructions":[{"product":"product-with-premium-support-2-license-bundle","type":"regular","periodStartDate":null,"periodStartDateValue":null,"periodStartDateInSeconds":null,"periodStartDateDisplay":null,"periodEndDate":null,"periodEndDateValue":null,"periodEndDateInSeconds":null,"periodEndDateDisplay":null,"intervalUnit":"year","intervalLength":1,"discountPercent":0,"discountPercentValue":0,"discountPercentDisplay":"0%","discountTotal":0,"discountTotalDisplay":"$0.00","discountTotalInPayoutCurrency":0,"discountTotalInPayoutCurrencyDisplay":"$0.00","unitDiscount":0,"unitDiscountDisplay":"$0.00","unitDiscountInPayoutCurrency":0,"unitDiscountInPayoutCurrencyDisplay":"$0.00","price":50,"priceDisplay":"$50.00","priceInPayoutCurrency":50,"priceInPayoutCurrencyDisplay":"$50.00","priceTotal":50,"priceTotalDisplay":"$50.00","priceTotalInPayoutCurrency":50,"priceTotalInPayoutCurrencyDisplay":"$50.00","unitPrice":50,"unitPriceDisplay":"$50.00","unitPriceInPayoutCurrency":50,"unitPriceInPayoutCurrencyDisplay":"$50.00","total":50,"totalDisplay":"$50.00","totalInPayoutCurrency":50,"totalInPayoutCurrencyDisplay":"$50.00"}]}},{"id":"CtjrZ3OmSOCflbS9zmdNtg","processed":false,"created":1529480855170,"type":"order.completed","live":false,"data":{"order":"hJUpZ90iTvy23SBi5PW6ew","id":"hJUpZ90iTvy23SBi5PW6ew","reference":"COMPANYHERE180620-4197-19163","buyerReference":null,"completed":true,"changed":1529480854811,"changedValue":1529480854811,"changedInSeconds":1529480854,"changedDisplay":"6/20/18","language":"en","live":false,"currency":"USD","payoutCurrency":"USD","invoiceUrl":"https://companynamehere.test.onfastspring.com/account/order/COMPANYNAMEHERE180620-4197-19163/invoice","account":"","total":88,"totalDisplay":"$88.00","totalInPayoutCurrency":88,"totalInPayoutCurrencyDisplay":"$88.00","tax":0,"taxDisplay":"$0.00","taxInPayoutCurrency":0,"taxInPayoutCurrencyDisplay":"$0.00","subtotal":88,"subtotalDisplay":"$88.00","subtotalInPayoutCurrency":88,"subtotalInPayoutCurrencyDisplay":"$88.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","discountWithTax":0,"discountWithTaxDisplay":"$0.00","discountWithTaxInPayoutCurrency":0,"discountWithTaxInPayoutCurrencyDisplay":"$0.00","billDescriptor":"FS* fsprg.com","payment":{"type":"test","cardEnding":"4242"},"customer":{"first":"","last":"","email":"","company":"","phone":""},"address":{"addressLine1":"","city":"","regionCode":"","regionDisplay":"","region":"","postalCode":"","country":"US","display":""},"tags":{"store_order_id":3812},"notes":[],"items":[{"product":"product-with-premium-support","quantity":1,"display":"product with Premium Support","sku":"PS101PT05","subtotal":38,"subtotalDisplay":"$38.00","subtotalInPayoutCurrency":38,"subtotalInPayoutCurrencyDisplay":"$38.00","attributes":{"webhook_action":"UpdateUserInformation"},"discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subscription":"yXF62FiZRNSph09Il_ZrnA","fulfillments":{"product-with-premium-support_license_0":[{"license":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","display":"License Key","type":"license"}],"instructions":""}},{"product":"product-with-premium-support-2-license-bundle","quantity":1,"display":"product with Premium Support (2 License Bundle)","sku":"PS101PT06","subtotal":50,"subtotalDisplay":"$50.00","subtotalInPayoutCurrency":50,"subtotalInPayoutCurrencyDisplay":"$50.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subscription":"rs1RyZBvQMOQ2p5zY-NMDA","fulfillments":{"product-with-premium-support-2-license-bundle_license_0":[{"license":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","display":"License Key","type":"license"}],"instructions":""}}]}}]
06-20-2018 @ 02:48:31 - Calculating pricing for amount of 38.00 and qty of 5 with cart total of 240 and discount of 0: 38
06-20-2018 @ 02:48:31 - Calculating pricing for amount of 50 and qty of 1 with cart total of 240 and discount of 0: 50
06-20-2018 @ 02:49:01 - Calculating pricing for amount of 38.00 and qty of 5 with cart total of 240 and discount of 0: 38
06-20-2018 @ 02:49:01 - Calculating pricing for amount of 50 and qty of 1 with cart total of 240 and discount of 0: 50
06-20-2018 @ 02:49:38 - API order EEcUqi6uQEyekobvPK9qFw completion checked
06-20-2018 @ 02:49:38 - Marking order ID 3815 as complete
06-20-2018 @ 02:49:58 - is_valid_webhook_request: Checking FastSpring webhook validity
06-20-2018 @ 02:49:58 - No webhook handler found for
06-20-2018 @ 02:49:58 - [{"id":"xRYSE9-MQcucBC1xaaL0uA","processed":false,"created":1529480973574,"type":"subscription.activated","live":false,"data":{"id":"N2d5-kQ9TmupHncT5q3Lyw","subscription":"N2d5-kQ9TmupHncT5q3Lyw","active":true,"state":"active","changed":1529480973284,"changedValue":1529480973284,"changedInSeconds":1529480973,"changedDisplay":"6/20/18","live":false,"currency":"USD","account":"","product":"product-with-premium-support","sku":"PS101PT05","display":"product with Premium Support","quantity":5,"adhoc":false,"autoRenew":true,"price":38,"priceDisplay":"$38.00","priceInPayoutCurrency":38,"priceInPayoutCurrencyDisplay":"$38.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subtotal":190,"subtotalDisplay":"$190.00","subtotalInPayoutCurrency":190,"subtotalInPayoutCurrencyDisplay":"$190.00","attributes":{"webhook_action":"UpdateUserInformation"},"tags":{"store_order_id":3815},"next":1560988800000,"nextValue":1560988800000,"nextInSeconds":1560988800,"nextDisplay":"6/20/19","end":null,"endValue":null,"endInSeconds":null,"endDisplay":null,"canceledDate":null,"canceledDateValue":null,"canceledDateInSeconds":null,"canceledDateDisplay":null,"deactivationDate":null,"deactivationDateValue":null,"deactivationDateInSeconds":null,"deactivationDateDisplay":null,"sequence":1,"periods":null,"remainingPeriods":null,"begin":1529452800000,"beginValue":1529452800000,"beginInSeconds":1529452800,"beginDisplay":"6/20/18","intervalUnit":"year","intervalLength":1,"nextChargeCurrency":"USD","nextChargeDate":1560988800000,"nextChargeDateValue":1560988800000,"nextChargeDateInSeconds":1560988800,"nextChargeDateDisplay":"6/20/19","nextChargeTotal":190,"nextChargeTotalDisplay":"$190.00","nextChargeTotalInPayoutCurrency":190,"nextChargeTotalInPayoutCurrencyDisplay":"$190.00","nextNotificationType":"PAYMENT_REMINDER","nextNotificationDate":1560384000000,"nextNotificationDateValue":1560384000000,"nextNotificationDateInSeconds":1560384000,"nextNotificationDateDisplay":"6/13/19","paymentReminder":{"intervalUnit":"week","intervalLength":1},"paymentOverdue":{"intervalUnit":"week","intervalLength":1,"total":4,"sent":0},"cancellationSetting":{"cancellation":"AFTER_LAST_NOTIFICATION","intervalUnit":"week","intervalLength":1},"instructions":[{"product":"product-with-premium-support","type":"regular","periodStartDate":null,"periodStartDateValue":null,"periodStartDateInSeconds":null,"periodStartDateDisplay":null,"periodEndDate":null,"periodEndDateValue":null,"periodEndDateInSeconds":null,"periodEndDateDisplay":null,"intervalUnit":"year","intervalLength":1,"discountPercent":0,"discountPercentValue":0,"discountPercentDisplay":"0%","discountTotal":0,"discountTotalDisplay":"$0.00","discountTotalInPayoutCurrency":0,"discountTotalInPayoutCurrencyDisplay":"$0.00","unitDiscount":0,"unitDiscountDisplay":"$0.00","unitDiscountInPayoutCurrency":0,"unitDiscountInPayoutCurrencyDisplay":"$0.00","price":38,"priceDisplay":"$38.00","priceInPayoutCurrency":38,"priceInPayoutCurrencyDisplay":"$38.00","priceTotal":190,"priceTotalDisplay":"$190.00","priceTotalInPayoutCurrency":190,"priceTotalInPayoutCurrencyDisplay":"$190.00","unitPrice":38,"unitPriceDisplay":"$38.00","unitPriceInPayoutCurrency":38,"unitPriceInPayoutCurrencyDisplay":"$38.00","total":190,"totalDisplay":"$190.00","totalInPayoutCurrency":190,"totalInPayoutCurrencyDisplay":"$190.00"}]}},{"id":"26HnRjZ8S0iK2retxg9G7w","processed":false,"created":1529480973935,"type":"subscription.activated","live":false,"data":{"id":"g16e45KNQ5aHiWvRGfUdBg","subscription":"g16e45KNQ5aHiWvRGfUdBg","active":true,"state":"active","changed":1529480973635,"changedValue":1529480973635,"changedInSeconds":1529480973,"changedDisplay":"6/20/18","live":false,"currency":"USD","account":"","product":"product-with-premium-support-2-license-bundle","sku":"PS101PT06","display":"product with Premium Support (2 License Bundle)","quantity":1,"adhoc":false,"autoRenew":true,"price":50,"priceDisplay":"$50.00","priceInPayoutCurrency":50,"priceInPayoutCurrencyDisplay":"$50.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subtotal":50,"subtotalDisplay":"$50.00","subtotalInPayoutCurrency":50,"subtotalInPayoutCurrencyDisplay":"$50.00","tags":{"store_order_id":3815},"next":1560988800000,"nextValue":1560988800000,"nextInSeconds":1560988800,"nextDisplay":"6/20/19","end":null,"endValue":null,"endInSeconds":null,"endDisplay":null,"canceledDate":null,"canceledDateValue":null,"canceledDateInSeconds":null,"canceledDateDisplay":null,"deactivationDate":null,"deactivationDateValue":null,"deactivationDateInSeconds":null,"deactivationDateDisplay":null,"sequence":1,"periods":null,"remainingPeriods":null,"begin":1529452800000,"beginValue":1529452800000,"beginInSeconds":1529452800,"beginDisplay":"6/20/18","intervalUnit":"year","intervalLength":1,"nextChargeCurrency":"USD","nextChargeDate":1560988800000,"nextChargeDateValue":1560988800000,"nextChargeDateInSeconds":1560988800,"nextChargeDateDisplay":"6/20/19","nextChargeTotal":50,"nextChargeTotalDisplay":"$50.00","nextChargeTotalInPayoutCurrency":50,"nextChargeTotalInPayoutCurrencyDisplay":"$50.00","nextNotificationType":"PAYMENT_REMINDER","nextNotificationDate":1560384000000,"nextNotificationDateValue":1560384000000,"nextNotificationDateInSeconds":1560384000,"nextNotificationDateDisplay":"6/13/19","paymentReminder":{"intervalUnit":"week","intervalLength":1},"paymentOverdue":{"intervalUnit":"week","intervalLength":1,"total":4,"sent":0},"cancellationSetting":{"cancellation":"AFTER_LAST_NOTIFICATION","intervalUnit":"week","intervalLength":1},"instructions":[{"product":"product-with-premium-support-2-license-bundle","type":"regular","periodStartDate":null,"periodStartDateValue":null,"periodStartDateInSeconds":null,"periodStartDateDisplay":null,"periodEndDate":null,"periodEndDateValue":null,"periodEndDateInSeconds":null,"periodEndDateDisplay":null,"intervalUnit":"year","intervalLength":1,"discountPercent":0,"discountPercentValue":0,"discountPercentDisplay":"0%","discountTotal":0,"discountTotalDisplay":"$0.00","discountTotalInPayoutCurrency":0,"discountTotalInPayoutCurrencyDisplay":"$0.00","unitDiscount":0,"unitDiscountDisplay":"$0.00","unitDiscountInPayoutCurrency":0,"unitDiscountInPayoutCurrencyDisplay":"$0.00","price":50,"priceDisplay":"$50.00","priceInPayoutCurrency":50,"priceInPayoutCurrencyDisplay":"$50.00","priceTotal":50,"priceTotalDisplay":"$50.00","priceTotalInPayoutCurrency":50,"priceTotalInPayoutCurrencyDisplay":"$50.00","unitPrice":50,"unitPriceDisplay":"$50.00","unitPriceInPayoutCurrency":50,"unitPriceInPayoutCurrencyDisplay":"$50.00","total":50,"totalDisplay":"$50.00","totalInPayoutCurrency":50,"totalInPayoutCurrencyDisplay":"$50.00"}]}},{"id":"Mn3ZG41WTweretV8mTB8fQ","processed":false,"created":1529480974327,"type":"order.completed","live":false,"data":{"order":"EEcUqi6uQEyekobvPK9qFw","id":"EEcUqi6uQEyekobvPK9qFw","reference":"COMPANYHERE180620-4197-83177","buyerReference":null,"completed":true,"changed":1529480973997,"changedValue":1529480973997,"changedInSeconds":1529480973,"changedDisplay":"6/20/18","language":"en","live":false,"currency":"USD","payoutCurrency":"USD","invoiceUrl":"https://companynamehere.test.onfastspring.com/account/order/COMPANYNAMEHERE180620-4197-83177/invoice","account":"","total":240,"totalDisplay":"$240.00","totalInPayoutCurrency":240,"totalInPayoutCurrencyDisplay":"$240.00","tax":0,"taxDisplay":"$0.00","taxInPayoutCurrency":0,"taxInPayoutCurrencyDisplay":"$0.00","subtotal":240,"subtotalDisplay":"$240.00","subtotalInPayoutCurrency":240,"subtotalInPayoutCurrencyDisplay":"$240.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","discountWithTax":0,"discountWithTaxDisplay":"$0.00","discountWithTaxInPayoutCurrency":0,"discountWithTaxInPayoutCurrencyDisplay":"$0.00","billDescriptor":"FS* fsprg.com","payment":{"type":"test","cardEnding":"4242"},"customer":{"first":"","last":"","email":"","company":"","phone":""},"address":{"addressLine1":"","city":"","regionCode":"","regionDisplay":"","region":"","postalCode":"","country":"","display":""},"tags":{"store_order_id":3815},"notes":[],"items":[{"product":"product-with-premium-support","quantity":5,"display":"product with Premium Support","sku":"PS101PT05","subtotal":190,"subtotalDisplay":"$190.00","subtotalInPayoutCurrency":190,"subtotalInPayoutCurrencyDisplay":"$190.00","attributes":{"webhook_action":"UpdateUserInformation"},"discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subscription":"N2d5-kQ9TmupHncT5q3Lyw","fulfillments":{"product-with-premium-support_license_0":[{"license":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","display":"License Key","type":"license"}],"instructions":""}},{"product":"product-with-premium-support-2-license-bundle","quantity":1,"display":"product with Premium Support (2 License Bundle)","sku":"PS101PT06","subtotal":50,"subtotalDisplay":"$50.00","subtotalInPayoutCurrency":50,"subtotalInPayoutCurrencyDisplay":"$50.00","discount":0,"discountDisplay":"$0.00","discountInPayoutCurrency":0,"discountInPayoutCurrencyDisplay":"$0.00","subscription":"g16e45KNQ5aHiWvRGfUdBg","fulfillments":{"product-with-premium-support-2-license-bundle_license_0":[{"license":"XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX","display":"License Key","type":"license"}],"instructions":""}}]}}]

@cyberwombat
Copy link
Owner

I am not able to recreate this. Let's confirm your process. You have a regular item (not a subscription) of say $20. You add 2 to cart, go to checkout which shows $40, select FS and click Place Order at which point the FS popup says $20?

Can you enable SCRIPT_DEBUG and inspect the console log and look for the payload part which has the items with pricing/qty. See https://github.com/cyberwombat/woocommerce-fastspring-payment-gateway/wiki/Troubleshooting

@ps-PKrueger
Copy link
Author

ps-PKrueger commented Jun 21, 2018 via email

@cyberwombat
Copy link
Owner

Ok - hopefully I got it. Turns out that Woo gives a line total for each non subscription item but totals all quantities of a subscription together. There may be some property I am not aware of that will smooth this up but for now I handled it in the code by multiplying for quantity only in the case of non sub items. Seems to come out ok. Try it out.

@ps-PKrueger
Copy link
Author

Unfortunately, I am still getting the same behavior with 1.1.4 as with 1.1.3.

The first time that I click through, I get quantity 1 for each subscription in the fastspring window.

After I cancel and spawn the window again, I get the correct amount of subscriptions.

But any time I go back to the cart, it starts again.

Try putting some subscription items into your cart, and increase the quantity of one of them past 1 (in the cart). Update your cart.

Then try checking out.

You will get the amount for quantity 1 of the subscription, and fastspring will only receive quantity 1 of the subscription.

Then cancel the fastspring window, and try checking out again. Now fastspring will get the right quantity of subscriptions.

Something is only allowing 1 subscription item through the first time.

Hope this helps.

@cyberwombat
Copy link
Owner

Thats odd. I do exactly that and I always get the correct quantity. I wonder if there is something about your WP/Woo flow that is different. On top of that the issue I was working on would not have affected that in a way that could be changed by reloading. Is there a demo site I can look at?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants