don't count refunds

This commit is contained in:
Seth Call 2021-03-16 13:34:50 -05:00
parent 30a3fce222
commit 86a7994d02
2 changed files with 3 additions and 3 deletions

View File

@ -661,7 +661,7 @@ module JamRuby
# these next lines try to ascertain that the transaction we've hit describes a true subscription
# jamtrack transactions are handled entirely separately, so this should avoid those, and perhaps other 'odd'
# transactions in Recurly
next if transaction.status != 'success' || transaction.source != 'subscription'
next if transaction.action != 'purchase' || transaction.status != 'success' || transaction.source != 'subscription'
next if transaction.subscriptions.length == 0
subscription = transaction.subscriptions.first
next if subscription.plan == nil || subscription.plan.plan_code == nil

View File

@ -184,7 +184,7 @@ describe 'Subscription transactions sync' do
client.sync_transactions
most_recently_created = AffiliateDistribution.order(created_at: :desc).first
expect(most_recently_created.affiliate_referral_fee_in_cents).to_not eq(nil)
expect(most_recently_created.affiliate_referral_fee_in_cents).to eq(30)
expect(most_recently_created.affiliate_referral_fee_in_cents).to eq(27)
end
it "change affiliate rate and updates referral fee" do
@ -192,7 +192,7 @@ describe 'Subscription transactions sync' do
affiliate_partner.save!
client.sync_transactions
most_recently_created = AffiliateDistribution.order(created_at: :desc).first
expect(most_recently_created.affiliate_referral_fee_in_cents).to eq(20)
expect(most_recently_created.affiliate_referral_fee_in_cents).to eq(18)
end
it "sets subscription product_type" do