don't count refunds
This commit is contained in:
parent
30a3fce222
commit
86a7994d02
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue