Skip to content

Commit 8dffca8

Browse files
authored
Merge pull request #1159 from AndriiMysko/plan-migration-fix-am
Plan migration fix
2 parents 3ece87a + b3e2538 commit 8dffca8

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

lib/travis/api/v3/queries/v2_subscriptions.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Travis::API::V3
22
class Queries::V2Subscriptions < Query
3-
params :plan, :coupon, :organization_id, :client_secret
3+
params :plan, :coupon, :organization_id, :client_secret, :v1_subscription_id
44
params :first_name, :last_name, :company, :address, :address2, :city, :country, :state, :vat_id, :zip_code, :billing_email, prefix: :billing_info
55
params :token, prefix: :credit_card_info
66

@@ -17,7 +17,8 @@ def create(user_id)
1717
:coupon => params['coupon'],
1818
:organization_id => params['organization_id'],
1919
:billing_info => billing_info_params,
20-
:credit_card_info => credit_card_info_params
20+
:credit_card_info => credit_card_info_params,
21+
:v1_subscription_id => params['v1_subscription_id']
2122
)
2223
end
2324
end

lib/travis/api/v3/services/v2_subscriptions/create.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Travis::API::V3
22
class Services::V2Subscriptions::Create < Service
33
result_type :v2_subscription
4-
params :plan, :coupon, :organization_id, :client_secret
4+
params :plan, :coupon, :organization_id, :client_secret, :v1_subscription_id
55
params :first_name, :last_name, :company, :address, :address2, :city, :country, :state, :vat_id, :zip_code, :billing_email, prefix: :billing_info
66
params :token, prefix: :credit_card_info
77

spec/v3/services/v2_subscriptions/create_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@
5959
},
6060
'credit_card_info' => {
6161
'token' => 'token_from_stripe'
62-
}})
62+
},
63+
'v1_subscription_id': nil
64+
})
6365
.to_return(status: 201, body: JSON.dump(billing_subscription_response_body(
6466
'id' => 1234,
6567
'owner' => { 'type' => 'Organization', 'id' => organization.id },

0 commit comments

Comments
 (0)