Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mollie/mollie-api-ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
vernondegoede committed May 12, 2020
2 parents 61c89e8 + 03f464d commit f4714c6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/mollie/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ def self.current(options = {})
def address=(address)
@address = OpenStruct.new(address) if address.is_a?(Hash)
end

def dashboard_url
Util.extract_url(links, 'dashboard')
end
end
end
2 changes: 1 addition & 1 deletion test/fixtures/shipments/get.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
],
"_links": {
"self": {
"href": "https://api.mollie.com/v2/shipments/shp_bjylrn",
"href": "https://api.mollie.com/v2/order/ord_kEn1PlbGa/shipments/shp_3wmsgCJN4U",
"type": "application/hal+json"
},
"order": {
Expand Down
7 changes: 6 additions & 1 deletion test/mollie/organization_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ def test_setting_attributes
'self' => {
'href' => 'https://api.mollie.com/v2/organizations/org_12345678',
'type' => 'application/hal+json'
},
},
'dashboard' => {
'href' => 'https://mollie.com/dashboard/org_12345678',
'type' => 'text/html'
},
'documentation' => {
'href' => 'https://docs.mollie.com/reference/v2/organizations-api/get-organization',
'type' => 'text/html'
Expand All @@ -43,6 +47,7 @@ def test_setting_attributes
assert_equal 'NL815839091B01', organization.vat_number
assert_equal 'dutch', organization.vat_regulation
assert_equal 'https://api.mollie.com/v2/organizations/org_12345678', organization.links['self']['href']
assert_equal 'https://mollie.com/dashboard/org_12345678', organization.dashboard_url
end

def test_current_organization
Expand Down
5 changes: 4 additions & 1 deletion test/mollie/settlement_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ def test_setting_attributes
currency: 'EUR'
}
}
]
],
invoice_id: 'inv_FrvewDA3Pr'
}
}
},
Expand Down Expand Up @@ -149,6 +150,8 @@ def test_setting_attributes
assert_equal '0.5000', settlement.periods[:'2015'][:'11'].costs[1].amount_net.value
assert_equal '0.1050', settlement.periods[:'2015'][:'11'].costs[1].amount_vat.value
assert_equal '0.6050', settlement.periods[:'2015'][:'11'].costs[1].amount_gross.value

assert_equal 'inv_FrvewDA3Pr', settlement.periods[:'2015'][:'11'].invoice_id
end

def test_status_open
Expand Down

0 comments on commit f4714c6

Please sign in to comment.