spec/mangopay/user_spec.rb in mangopay-3.0.29 vs spec/mangopay/user_spec.rb in mangopay-3.0.30
- old
+ new
@@ -153,6 +153,24 @@
expect(emoney['CreditedEMoney']['Currency']).to eq 'EUR'
expect(emoney['DebitedEMoney']['Amount']).to eq 0
expect(emoney['DebitedEMoney']['Currency']).to eq 'EUR'
end
end
+
+ describe 'CREATE UBO DECLARATION' do
+ it 'creates a UBO declaration' do
+ legal_user = new_legal_user
+ natural_user = define_new_natural_user
+ natural_user['Capacity'] = 'DECLARATIVE'
+ natural_user = MangoPay::NaturalUser.create(natural_user)
+ ubo_declaration = {
+ DeclaredUBOs: [natural_user['Id']]
+ }
+ ubo_declaration = MangoPay::LegalUser.create_ubo_declaration(legal_user['Id'], ubo_declaration)
+
+ expect(ubo_declaration).not_to be_nil
+ expect(ubo_declaration['Status']).to eq 'CREATED'
+ expect(ubo_declaration['UserId']).to eq legal_user['Id']
+ expect(ubo_declaration['DeclaredUBOs'][0]['UserId']).to eq natural_user['Id']
+ end
+ end
end