Skip to content

Commit c8526bc

Browse files
committed
chore: use new billing fixtures
1 parent b8dfcb0 commit c8526bc

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

examples

Submodule examples updated 40 files

spec/billing_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
)
1717
allow(client).to receive(:make_request).with(:post, '/credit_cards/pm_123/charges', { amount: '2000' })
18-
credit_card = client.billing.fund_wallet('2000', 'primary')
18+
credit_card = client.billing.fund_wallet('2000', Fixture.billing['priority'])
1919

2020
expect(credit_card).to eq(true)
2121
end
@@ -32,7 +32,7 @@
3232
)
3333
allow(client).to receive(:make_request).with(:delete, '/credit_cards/pm_123')
3434

35-
deleted_credit_card = client.billing.delete_payment_method('primary')
35+
deleted_credit_card = client.billing.delete_payment_method(Fixture.billing['priority'])
3636

3737
expect(deleted_credit_card).to eq(true)
3838
end
@@ -55,7 +55,7 @@
5555
# will pass if get_payment_method_info returns ['credit_cards', 'pm_123'], fail otherwise
5656
allow(client).to receive(:make_request).with(:delete, '/credit_cards/pm_123')
5757

58-
deleted_credit_card = client.billing.delete_payment_method('primary')
58+
deleted_credit_card = client.billing.delete_payment_method(Fixture.billing['priority'])
5959

6060
expect(deleted_credit_card).to eq(true)
6161
end

spec/referral_customer_spec.rb

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@
122122
expect {
123123
client.referral_customer.add_credit_card_from_stripe(
124124
REFERRAL_CUSTOMER_PROD_API_KEY,
125-
'pm_0Pn6bQDqT4huGUvd0CjpRerH',
126-
'primary',
125+
Fixture.billing['payment_method_id'],
126+
Fixture.billing['priority'],
127127
)
128128
}.to raise_error(EasyPost::Errors::ApiError).with_message(
129129
'Stripe::PaymentMethod does not exist for the specified reference_id',
@@ -137,13 +137,9 @@
137137
expect {
138138
client.referral_customer.add_bank_account_from_stripe(
139139
REFERRAL_CUSTOMER_PROD_API_KEY,
140-
'fca_0QAc7sDqT4huGUvdf6BahYa9',
141-
{
142-
ip_address: '127.0.0.1',
143-
user_agent: 'Mozilla/5.0',
144-
accepted_at: 1_722_510_730,
145-
},
146-
'primary',
140+
Fixture.billing['financial_connections_id'],
141+
Fixture.billing['mandate_data'],
142+
Fixture.billing['priority'],
147143
)
148144
}.to raise_error(EasyPost::Errors::ApiError).with_message(
149145
'account_holder_name must be present when creating a Financial Connections payment method',

spec/support/fixture.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,8 @@ def self.desired_delivery_date
168168
def self.basic_claim
169169
read_fixture_data['claims']['basic']
170170
end
171+
172+
def self.billing
173+
read_fixture_data['billing']
174+
end
171175
end

0 commit comments

Comments
 (0)