Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ jobs:

integration-tests:
env:
MERCHANT: ${{ secrets.MERCHANT }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
EXPLICIT_MERCHANT_SECRET_KEY: ${{ secrets.EXPLICIT_MERCHANT_SECRET_KEY }}
EXPLICIT_MERCHANT: ${{ secrets.EXPLICIT_MERCHANT }}
Expand All @@ -13,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
ruby: [ 2.6, 2.7, 3.0 ]
ruby: [ 2.6, 2.7, 3.0.3 ]
include:
- os: macos-latest
ruby: 2.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
ruby-version: 3.0.0
bundler-cache: true
- run: gem build
- run: gem push shift4-*.*.*.gem
2 changes: 1 addition & 1 deletion spec/integration/blacklist_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# then
expect(deleted['ruleType']).to eq('email')
expect(deleted['email']).to eq(email)
expect(deleted['deleted']).to eq(true)
expect(deleted['deleted']).to be(true)
end

it 'list blacklist' do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/cards_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
deleted = Shift4::Cards.retrieve(customer['id'], card['id'])

# then
expect(deleted['deleted']).to eq(true)
expect(deleted['deleted']).to be(true)
end

it 'list cards' do
Expand Down
8 changes: 4 additions & 4 deletions spec/integration/charges_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
captured = Shift4::Charges.capture(created['id'])

# then
expect(created['captured']).to eq(false)
expect(captured['captured']).to eq(true)
expect(created['captured']).to be(false)
expect(captured['captured']).to be(true)
end

it 'capture charge only once with idempotency_key' do
Expand Down Expand Up @@ -141,8 +141,8 @@
refunded = Shift4::Charges.refund(created['id'])

# then
expect(created['refunded']).to eq(false)
expect(refunded['refunded']).to eq(true)
expect(created['refunded']).to be(false)
expect(refunded['refunded']).to be(true)
end

it 'refund charge only once with idempotency_key' do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/customers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

# then
expect(updated['id']).not_to be_nil
expect(updated['deleted']).to eq(true)
expect(updated['deleted']).to be(true)
end

it 'list customers' do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/disputes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
retrieved = Shift4::Disputes.retrieve(dispute['id'])

# then
expect(retrieved['acceptedAsLost']).to eq(true)
expect(retrieved['acceptedAsLost']).to be(true)
end

it 'close dispute only once with idempotency_key' do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/payment_methods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

# then
expect(retrieved['id']).to eq(created['id'])
expect(retrieved['deleted']).to eq(true)
expect(retrieved['deleted']).to be(true)
end

it 'list payment_methods' do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/plans_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

# then
expect(retrieved['id']).to eq(created['id'])
expect(retrieved['deleted']).to eq(true)
expect(retrieved['deleted']).to be(true)
end

it 'list plans' do
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/tokens_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
expect(retrieved['expYear']).to eq("20#{token_req['expYear']}")
expect(retrieved['cardholderName']).to eq(token_req['cardholderName'])
expect(retrieved['customerId']).to eq(token_req['customerId'])
expect(retrieved['used']).to eq(false)
expect(retrieved['used']).to be(false)
end
end
end
7 changes: 5 additions & 2 deletions spec/support/test_data.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

class TestData
class TestData # rubocop:disable Metrics/ClassLength
def self.card
{
'number' => '4242424242424242',
Expand Down Expand Up @@ -110,7 +110,10 @@ def self.payment_method(
'type' => 'alipay',
'customerId' => customer_id,
'billing' => {
'name' => 'Nikola Tesla'
'name' => 'Nikola Tesla',
'address' => {
'country' => 'CN'
}
}.compact
}.compact
end
Expand Down