mangopay-v4 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +30 -0
  3. data/.rspec +4 -0
  4. data/.rubocop.yml +2 -0
  5. data/.travis.yml +13 -0
  6. data/Gemfile +2 -0
  7. data/LICENSE +20 -0
  8. data/README.md +380 -0
  9. data/bin/mangopay +9 -0
  10. data/lib/mangopay.rb +133 -0
  11. data/lib/mangopay/api/api.rb +9 -0
  12. data/lib/mangopay/api/api_methods.rb +137 -0
  13. data/lib/mangopay/api/auth_token_manager.rb +173 -0
  14. data/lib/mangopay/api/http_client.rb +325 -0
  15. data/lib/mangopay/api/service/bank_accounts.rb +146 -0
  16. data/lib/mangopay/api/service/cards.rb +152 -0
  17. data/lib/mangopay/api/service/client_wallets.rb +89 -0
  18. data/lib/mangopay/api/service/clients.rb +68 -0
  19. data/lib/mangopay/api/service/dispute_documents.rb +158 -0
  20. data/lib/mangopay/api/service/disputes.rb +187 -0
  21. data/lib/mangopay/api/service/e_money.rb +42 -0
  22. data/lib/mangopay/api/service/events.rb +47 -0
  23. data/lib/mangopay/api/service/hooks.rb +93 -0
  24. data/lib/mangopay/api/service/kyc_documents.rb +153 -0
  25. data/lib/mangopay/api/service/mandates.rb +142 -0
  26. data/lib/mangopay/api/service/oauth_tokens.rb +25 -0
  27. data/lib/mangopay/api/service/pay_ins.rb +260 -0
  28. data/lib/mangopay/api/service/pay_outs.rb +54 -0
  29. data/lib/mangopay/api/service/pre_authorizations.rb +69 -0
  30. data/lib/mangopay/api/service/refunds.rb +62 -0
  31. data/lib/mangopay/api/service/reports.rb +151 -0
  32. data/lib/mangopay/api/service/repudiations.rb +32 -0
  33. data/lib/mangopay/api/service/responses.rb +102 -0
  34. data/lib/mangopay/api/service/settlement_transfers.rb +55 -0
  35. data/lib/mangopay/api/service/transactions.rb +183 -0
  36. data/lib/mangopay/api/service/transfers.rb +54 -0
  37. data/lib/mangopay/api/service/ubo_declarations.rb +70 -0
  38. data/lib/mangopay/api/service/users.rb +163 -0
  39. data/lib/mangopay/api/service/wallets.rb +99 -0
  40. data/lib/mangopay/api/uri_provider.rb +35 -0
  41. data/lib/mangopay/common/json_tag_converter.rb +68 -0
  42. data/lib/mangopay/common/jsonifier.rb +249 -0
  43. data/lib/mangopay/common/log_provider.rb +34 -0
  44. data/lib/mangopay/common/rate_limit_interval.rb +17 -0
  45. data/lib/mangopay/common/read_only_fields.rb +27 -0
  46. data/lib/mangopay/common/response_error.rb +61 -0
  47. data/lib/mangopay/common/sort_direction.rb +15 -0
  48. data/lib/mangopay/common/sort_field.rb +13 -0
  49. data/lib/mangopay/common/template_url_options.rb +9 -0
  50. data/lib/mangopay/configuration.rb +39 -0
  51. data/lib/mangopay/environment.rb +66 -0
  52. data/lib/mangopay/model/address.rb +27 -0
  53. data/lib/mangopay/model/declared_ubo.rb +21 -0
  54. data/lib/mangopay/model/dispute_reason.rb +15 -0
  55. data/lib/mangopay/model/document_page_consult.rb +15 -0
  56. data/lib/mangopay/model/e_money.rb +18 -0
  57. data/lib/mangopay/model/entity/account/bank_account.rb +26 -0
  58. data/lib/mangopay/model/entity/account/ca_bank_account.rb +27 -0
  59. data/lib/mangopay/model/entity/account/gb_bank_account.rb +21 -0
  60. data/lib/mangopay/model/entity/account/iban_bank_account.rb +21 -0
  61. data/lib/mangopay/model/entity/account/other_bank_account.rb +24 -0
  62. data/lib/mangopay/model/entity/account/us_bank_account.rb +24 -0
  63. data/lib/mangopay/model/entity/card.rb +45 -0
  64. data/lib/mangopay/model/entity/card_registration.rb +43 -0
  65. data/lib/mangopay/model/entity/client.rb +63 -0
  66. data/lib/mangopay/model/entity/client_wallet.rb +23 -0
  67. data/lib/mangopay/model/entity/dispute.rb +50 -0
  68. data/lib/mangopay/model/entity/dispute_document.rb +29 -0
  69. data/lib/mangopay/model/entity/entity_base.rb +18 -0
  70. data/lib/mangopay/model/entity/hook.rb +26 -0
  71. data/lib/mangopay/model/entity/kyc_document.rb +28 -0
  72. data/lib/mangopay/model/entity/mandate.rb +51 -0
  73. data/lib/mangopay/model/entity/pay_in/bank_wire_direct_pay_in.rb +22 -0
  74. data/lib/mangopay/model/entity/pay_in/card_direct_pay_in.rb +33 -0
  75. data/lib/mangopay/model/entity/pay_in/card_pre_authorized_pay_in.rb +13 -0
  76. data/lib/mangopay/model/entity/pay_in/card_web_pay_in.rb +40 -0
  77. data/lib/mangopay/model/entity/pay_in/direct_debit_direct_pay_in.rb +23 -0
  78. data/lib/mangopay/model/entity/pay_in/direct_debit_web_pay_in.rb +38 -0
  79. data/lib/mangopay/model/entity/pay_in/pay_in.rb +16 -0
  80. data/lib/mangopay/model/entity/pay_out.rb +22 -0
  81. data/lib/mangopay/model/entity/pre_authorization.rb +68 -0
  82. data/lib/mangopay/model/entity/refund.rb +18 -0
  83. data/lib/mangopay/model/entity/report.rb +51 -0
  84. data/lib/mangopay/model/entity/repudiation.rb +18 -0
  85. data/lib/mangopay/model/entity/settlement_transfer.rb +17 -0
  86. data/lib/mangopay/model/entity/transaction.rb +52 -0
  87. data/lib/mangopay/model/entity/transfer.rb +13 -0
  88. data/lib/mangopay/model/entity/ubo_declaration.rb +32 -0
  89. data/lib/mangopay/model/entity/user/legal_user.rb +53 -0
  90. data/lib/mangopay/model/entity/user/natural_user.rb +50 -0
  91. data/lib/mangopay/model/entity/user/user.rb +18 -0
  92. data/lib/mangopay/model/entity/wallet.rb +28 -0
  93. data/lib/mangopay/model/enum/account_type.rb +24 -0
  94. data/lib/mangopay/model/enum/card_status.rb +15 -0
  95. data/lib/mangopay/model/enum/card_type.rb +33 -0
  96. data/lib/mangopay/model/enum/card_validity.rb +19 -0
  97. data/lib/mangopay/model/enum/country_iso.rb +759 -0
  98. data/lib/mangopay/model/enum/culture_code.rb +44 -0
  99. data/lib/mangopay/model/enum/currency_iso.rb +552 -0
  100. data/lib/mangopay/model/enum/declared_ubo_refused_reason_type.rb +16 -0
  101. data/lib/mangopay/model/enum/declared_ubo_status.rb +18 -0
  102. data/lib/mangopay/model/enum/deposit_type.rb +15 -0
  103. data/lib/mangopay/model/enum/direct_debit_type.rb +13 -0
  104. data/lib/mangopay/model/enum/dispute_doc_refused_reason_type.rb +25 -0
  105. data/lib/mangopay/model/enum/dispute_document_type.rb +23 -0
  106. data/lib/mangopay/model/enum/dispute_reason_type.rb +33 -0
  107. data/lib/mangopay/model/enum/dispute_status.rb +21 -0
  108. data/lib/mangopay/model/enum/dispute_type.rb +15 -0
  109. data/lib/mangopay/model/enum/document_status.rb +21 -0
  110. data/lib/mangopay/model/enum/download_format.rb +11 -0
  111. data/lib/mangopay/model/enum/event_type.rb +74 -0
  112. data/lib/mangopay/model/enum/funds_type.rb +15 -0
  113. data/lib/mangopay/model/enum/hook_status.rb +13 -0
  114. data/lib/mangopay/model/enum/hook_validity.rb +15 -0
  115. data/lib/mangopay/model/enum/income_range.rb +21 -0
  116. data/lib/mangopay/model/enum/kyc_doc_refused_reason_type.rb +37 -0
  117. data/lib/mangopay/model/enum/kyc_document_type.rb +19 -0
  118. data/lib/mangopay/model/enum/kyc_level.rb +13 -0
  119. data/lib/mangopay/model/enum/legal_person_type.rb +15 -0
  120. data/lib/mangopay/model/enum/mandate_culture_code.rb +23 -0
  121. data/lib/mangopay/model/enum/mandate_execution_type.rb +11 -0
  122. data/lib/mangopay/model/enum/mandate_scheme.rb +13 -0
  123. data/lib/mangopay/model/enum/mandate_status.rb +24 -0
  124. data/lib/mangopay/model/enum/mandate_type.rb +11 -0
  125. data/lib/mangopay/model/enum/natural_user_capacity.rb +15 -0
  126. data/lib/mangopay/model/enum/pay_in_execution_type.rb +18 -0
  127. data/lib/mangopay/model/enum/pay_in_payment_type.rb +21 -0
  128. data/lib/mangopay/model/enum/pay_out_payment_type.rb +11 -0
  129. data/lib/mangopay/model/enum/payment_status.rb +21 -0
  130. data/lib/mangopay/model/enum/person_type.rb +15 -0
  131. data/lib/mangopay/model/enum/platform_type.rb +23 -0
  132. data/lib/mangopay/model/enum/pre_authorization_execution_type.rb +11 -0
  133. data/lib/mangopay/model/enum/pre_authorization_status.rb +18 -0
  134. data/lib/mangopay/model/enum/refund_reason_type.rb +21 -0
  135. data/lib/mangopay/model/enum/report_status.rb +17 -0
  136. data/lib/mangopay/model/enum/report_type.rb +13 -0
  137. data/lib/mangopay/model/enum/secure_mode.rb +16 -0
  138. data/lib/mangopay/model/enum/transaction_nature.rb +17 -0
  139. data/lib/mangopay/model/enum/transaction_status.rb +15 -0
  140. data/lib/mangopay/model/enum/transaction_type.rb +15 -0
  141. data/lib/mangopay/model/enum/ubo_declaration_refused_reason_type.rb +19 -0
  142. data/lib/mangopay/model/enum/ubo_declaration_status.rb +21 -0
  143. data/lib/mangopay/model/event.rb +18 -0
  144. data/lib/mangopay/model/model.rb +194 -0
  145. data/lib/mangopay/model/money.rb +17 -0
  146. data/lib/mangopay/model/pay_in_web_extended_view.rb +31 -0
  147. data/lib/mangopay/model/refund_reason.rb +15 -0
  148. data/lib/mangopay/model/report_filter.rb +83 -0
  149. data/lib/mangopay/model/request/cancel_request.rb +16 -0
  150. data/lib/mangopay/model/request/complete_registration_request.rb +13 -0
  151. data/lib/mangopay/model/request/currency_request.rb +13 -0
  152. data/lib/mangopay/model/request/deactivation_request.rb +10 -0
  153. data/lib/mangopay/model/request/filter_request.rb +38 -0
  154. data/lib/mangopay/model/request/submit_document_request.rb +14 -0
  155. data/lib/mangopay/model/request/submit_ubo_declaration_request.rb +14 -0
  156. data/lib/mangopay/model/request/upload_file_request.rb +9 -0
  157. data/lib/mangopay/model/response_replica.rb +27 -0
  158. data/lib/mangopay/util/custom_formatter.rb +12 -0
  159. data/lib/mangopay/util/custom_logger.rb +34 -0
  160. data/lib/mangopay/util/enum.rb +52 -0
  161. data/lib/mangopay/util/file_encoder.rb +16 -0
  162. data/lib/mangopay/util/non_instantiable.rb +6 -0
  163. data/lib/mangopay/util/storage_strategy.rb +10 -0
  164. data/lib/mangopay/util/void_logger.rb +6 -0
  165. data/mangopay.gemspec +32 -0
  166. data/spec/context/address_context.rb +25 -0
  167. data/spec/context/bank_account_context.rb +138 -0
  168. data/spec/context/card_context.rb +46 -0
  169. data/spec/context/client_context.rb +45 -0
  170. data/spec/context/dispute_context.rb +37 -0
  171. data/spec/context/dispute_document_context.rb +20 -0
  172. data/spec/context/hook_context.rb +16 -0
  173. data/spec/context/kyc_document_context.rb +23 -0
  174. data/spec/context/mandate_context.rb +27 -0
  175. data/spec/context/pay_in_context.rb +225 -0
  176. data/spec/context/pay_out_context.rb +39 -0
  177. data/spec/context/pre_authorization_context.rb +41 -0
  178. data/spec/context/refund_context.rb +33 -0
  179. data/spec/context/report_context.rb +22 -0
  180. data/spec/context/repudiation_context.rb +19 -0
  181. data/spec/context/settlement_transfer_context.rb +28 -0
  182. data/spec/context/transfer_context.rb +51 -0
  183. data/spec/context/ubo_declaration_context.rb +25 -0
  184. data/spec/context/user_context.rb +83 -0
  185. data/spec/context/wallet_context.rb +53 -0
  186. data/spec/mangopay/bank_accounts_spec.rb +229 -0
  187. data/spec/mangopay/cards_spec.rb +135 -0
  188. data/spec/mangopay/client_wallets_spec.rb +148 -0
  189. data/spec/mangopay/clients_spec.rb +55 -0
  190. data/spec/mangopay/configuration_spec.rb +126 -0
  191. data/spec/mangopay/dispute_documents_spec.rb +174 -0
  192. data/spec/mangopay/disputes_spec.rb +265 -0
  193. data/spec/mangopay/e_money_spec.rb +38 -0
  194. data/spec/mangopay/events_spec.rb +50 -0
  195. data/spec/mangopay/hooks_spec.rb +71 -0
  196. data/spec/mangopay/kyc_documents_spec.rb +180 -0
  197. data/spec/mangopay/mandates_spec.rb +219 -0
  198. data/spec/mangopay/oauth_tokens_spec.rb +41 -0
  199. data/spec/mangopay/pay_ins_spec.rb +181 -0
  200. data/spec/mangopay/pay_outs_spec.rb +39 -0
  201. data/spec/mangopay/pre_authorizations_spec.rb +58 -0
  202. data/spec/mangopay/refunds_spec.rb +40 -0
  203. data/spec/mangopay/reports_spec.rb +121 -0
  204. data/spec/mangopay/responses_spec.rb +295 -0
  205. data/spec/mangopay/settlement_transfers_spec.rb +37 -0
  206. data/spec/mangopay/transactions_spec.rb +233 -0
  207. data/spec/mangopay/transfers_spec.rb +38 -0
  208. data/spec/mangopay/ubo_declarations_spec.rb +65 -0
  209. data/spec/mangopay/users_spec.rb +146 -0
  210. data/spec/mangopay/wallets_spec.rb +104 -0
  211. data/spec/resources/logo.png +0 -0
  212. data/spec/resources/test_pdf.pdf +0 -0
  213. data/spec/spec_helper.rb +72 -0
  214. metadata +349 -0
@@ -0,0 +1,13 @@
1
+ require_relative '../../common/jsonifier'
2
+
3
+ module MangoModel
4
+
5
+ # Transfer entity
6
+ # A Transfer is a request to relocate e-money
7
+ # from one wallet to another
8
+ class Transfer < Transaction
9
+ include MangoPay::Jsonifier
10
+
11
+ # API docs specify identical fields in Transfer and Transaction.
12
+ end
13
+ end
@@ -0,0 +1,32 @@
1
+ require_relative '../../common/jsonifier'
2
+
3
+ module MangoModel
4
+
5
+ # UBO Declaration entity
6
+ # A UBO Declaration is an electronic version of the previous KYC document
7
+ # of +KycDocumentType::SHAREHOLDER_DECLARATION+, used to declare all the
8
+ # Ultimate Beneficial Owners of a legal user of +LegalPersonType::BUSINESS+
9
+ # (i.e. the shareholders of at least 25% ownership)
10
+ class UboDeclaration < EntityBase
11
+ include MangoPay::Jsonifier
12
+
13
+ # [String] ID of its owner
14
+ attr_accessor :user_id
15
+
16
+ # [UboDeclarationStatus] Its status
17
+ attr_accessor :status
18
+
19
+ # [Array] Array of +UboDeclarationRefusedReasonType+s (reasons why
20
+ # the UBO declaration was refused)
21
+ attr_accessor :refused_reason_types
22
+
23
+ # [String] Explanation of why the UBO declaration was refused
24
+ attr_accessor :refused_reason_message
25
+
26
+ # [Array] When sending to the API, will be a list of the IDs of the users
27
+ # being declared as UBOs. When retrieving +UboDeclaration+s from the API,
28
+ # will be a list of +DeclaredUboStatus+ objects, representing validation
29
+ # status for each person declared as UBO.
30
+ attr_accessor :declared_ubos
31
+ end
32
+ end
@@ -0,0 +1,53 @@
1
+ require_relative '../../../common/jsonifier'
2
+
3
+ module MangoModel
4
+
5
+ # User entity of +PersonType::LEGAL+
6
+ # A Legal User represents a business or an organization.
7
+ class LegalUser < User
8
+ include MangoPay::Jsonifier
9
+
10
+ # [String] Their name
11
+ attr_accessor :name
12
+
13
+ # [LegalPersonType] Type of legal user
14
+ attr_accessor :legal_person_type
15
+
16
+ # [Address] Their headquarters' address
17
+ attr_accessor :headquarters_address
18
+
19
+ # [String] Their legal representative's first name
20
+ attr_accessor :legal_representative_first_name
21
+
22
+ # [String] Their legal representative's last name
23
+ attr_accessor :legal_representative_last_name
24
+
25
+ # [Address] Their legal representative's physical address
26
+ attr_accessor :legal_representative_address
27
+
28
+ # [String] Their legal representative's email address
29
+ attr_accessor :legal_representative_email
30
+
31
+ # [Integer] Their legal representative's birthday (UNIX timestamp)
32
+ attr_accessor :legal_representative_birthday
33
+
34
+ # [CountryIso] Their legal representative's nationality
35
+ attr_accessor :legal_representative_nationality
36
+
37
+ # [CountryIso] Their legal representative's country of residence
38
+ attr_accessor :legal_representative_country_of_residence
39
+
40
+ # [String] Their statute
41
+ attr_accessor :statute
42
+
43
+ # [String] Their proof of registration
44
+ attr_accessor :proof_of_registration
45
+
46
+ # [String] Their shareholder declaration
47
+ attr_accessor :shareholder_declaration
48
+
49
+ def initialize
50
+ self.person_type = PersonType::LEGAL
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,50 @@
1
+ require_relative '../../../common/jsonifier'
2
+
3
+ module MangoModel
4
+
5
+ # User entity of +PersonType::NATURAL+
6
+ # A Natural User represents an actual person.
7
+ class NaturalUser < User
8
+ include MangoPay::Jsonifier
9
+
10
+ # [String] Their first name
11
+ attr_accessor :first_name
12
+
13
+ # [String] Their last name
14
+ attr_accessor :last_name
15
+
16
+ # [Address] Their address
17
+ attr_accessor :address
18
+
19
+ # [Integer] Their date of birth (UNIX timestamp)
20
+ attr_accessor :birthday
21
+
22
+ # [String] Their place of birth
23
+ attr_accessor :birthplace
24
+
25
+ # [CountryIso] Their nationality
26
+ attr_accessor :nationality
27
+
28
+ # [CountryIso] Their current country of residence
29
+ attr_accessor :country_of_residence
30
+
31
+ # [String] Their occupation
32
+ attr_accessor :occupation
33
+
34
+ # [Integer] Their income range (see MangoModel::IncomeRange)
35
+ attr_accessor :income_range
36
+
37
+ # [String] Proof of their identity
38
+ attr_accessor :proof_of_identity
39
+
40
+ # [String] Proof of their address
41
+ attr_accessor :proof_of_address
42
+
43
+ # [String] Their capacity within MangoPay
44
+ attr_accessor :capacity
45
+
46
+ def initialize
47
+ self.person_type = PersonType::NATURAL
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,18 @@
1
+ require_relative '../../../util/non_instantiable'
2
+
3
+ module MangoModel
4
+
5
+ # User entity's base class. Should not be instantiated.
6
+ class User < EntityBase
7
+ extend NonInstantiable
8
+
9
+ # Type of user, one of +PersonType+
10
+ attr_accessor :person_type
11
+
12
+ # Their KYC level, one of +KycLevel+
13
+ attr_accessor :kyc_level
14
+
15
+ # Their email address
16
+ attr_accessor :email
17
+ end
18
+ end
@@ -0,0 +1,28 @@
1
+ require_relative '../../common/jsonifier'
2
+
3
+ module MangoModel
4
+
5
+ # Wallet entity
6
+ # A Wallet is an object in which PayIns and Transfers from
7
+ # users are stored in order to collect money. Wallets can
8
+ # be paid into, funds can be withdrawn from them or transferred
9
+ # from one Wallet to another.
10
+ class Wallet < EntityBase
11
+ include MangoPay::Jsonifier
12
+
13
+ # [Array] Its owners (currently only one may be specified)
14
+ attr_accessor :owners
15
+
16
+ # [Money] Its current balance
17
+ attr_accessor :balance
18
+
19
+ # [FundsType] Its funds' type
20
+ attr_accessor :funds_type
21
+
22
+ # [String] Its description
23
+ attr_accessor :description
24
+
25
+ # [CurrencyIso] Its funds' currency
26
+ attr_accessor :currency
27
+ end
28
+ end
@@ -0,0 +1,24 @@
1
+ require_relative '../../util/enum'
2
+
3
+ module MangoModel
4
+
5
+ # Bank account types enumeration
6
+ class AccountType
7
+ extend Enum
8
+
9
+ # IBAN bank account
10
+ IBAN = value 'IBAN'
11
+
12
+ # US format bank account
13
+ US = value 'US'
14
+
15
+ # CA format bank account
16
+ CA = value 'CA'
17
+
18
+ # GB format bank account
19
+ GB = value 'GB'
20
+
21
+ # Unspecified bank account format
22
+ OTHER = value 'OTHER'
23
+ end
24
+ end
@@ -0,0 +1,15 @@
1
+ require_relative '../../util/enum'
2
+
3
+ module MangoModel
4
+
5
+ # Card registration status enumeration
6
+ class CardStatus
7
+ extend Enum
8
+
9
+ CREATED = value 'CREATED'
10
+
11
+ VALIDATED = value 'VALIDATED'
12
+
13
+ ERROR = value 'ERROR'
14
+ end
15
+ end
@@ -0,0 +1,33 @@
1
+ require_relative '../../util/enum'
2
+
3
+ module MangoModel
4
+
5
+ # Card types enumeration
6
+ class CardType
7
+ extend Enum
8
+
9
+ # Visa MasterCard
10
+ CB_VISA_MASTERCARD = value 'CB_VISA_MASTERCARD'
11
+
12
+ # Diners card
13
+ DINERS = value 'DINERS'
14
+
15
+ # MasterPass card
16
+ MASTERPASS = value 'MASTERPAS'
17
+
18
+ # Maestro card
19
+ MAESTRO = value 'MAESTRO'
20
+
21
+ # P24 card
22
+ P24 = value 'P24'
23
+
24
+ # Ideal card
25
+ IDEAL = value 'IDEAL'
26
+
27
+ # BCMC card
28
+ BCMC = value 'BCMC'
29
+
30
+ # PayLib card
31
+ PAYLIB = value 'PAYLIB'
32
+ end
33
+ end
@@ -0,0 +1,19 @@
1
+ require_relative '../../util/enum'
2
+
3
+ module MangoModel
4
+
5
+ # Card validity status enumeration
6
+ class CardValidity
7
+ extend Enum
8
+
9
+ # Before any payment processing is attempted, a card's
10
+ # validity is not determined
11
+ UNKNOWN = value 'UNKNOWN'
12
+
13
+ # Card is valid
14
+ VALID = value 'VALID'
15
+
16
+ # Card is not valid
17
+ INVALID = value 'INVALID'
18
+ end
19
+ end
@@ -0,0 +1,759 @@
1
+ require_relative '../../util/enum'
2
+
3
+ module MangoModel
4
+
5
+ # ISO 3166-1 alpha-2 format country codes enumeration
6
+ class CountryIso
7
+ extend Enum
8
+
9
+ # Andorra
10
+ AD = value 'AD'
11
+
12
+ # United Arab Emirates
13
+ AE = value 'AE'
14
+
15
+ # Afghanistan
16
+ AF = value 'AF'
17
+
18
+ # Antigua and Barbuda
19
+ AG = value 'AG'
20
+
21
+ # Anguilla
22
+ AI = value 'AI'
23
+
24
+ # Albania
25
+ AL = value 'AL'
26
+
27
+ # Armenia
28
+ AM = value 'AM'
29
+
30
+ # Netherlands Antilles
31
+ AN = value 'AN'
32
+
33
+ # Angola
34
+ AO = value 'AO'
35
+
36
+ # Antarctica
37
+ AQ = value 'AQ'
38
+
39
+ # Argentina
40
+ AR = value 'AR'
41
+
42
+ # American Samoa
43
+ AS = value 'AS'
44
+
45
+ # Austria
46
+ AT = value 'AT'
47
+
48
+ # Australia
49
+ AU = value 'AU'
50
+
51
+ # Aruba
52
+ AW = value 'AW'
53
+
54
+ # Aland Islands
55
+ AX = value 'AX'
56
+
57
+ # Azerbaijan
58
+ AZ = value 'AZ'
59
+
60
+ # Bosnia and Herzegovina
61
+ BA = value 'BA'
62
+
63
+ # Barbados
64
+ BB = value 'BB'
65
+
66
+ # Bangladesh
67
+ BD = value 'BD'
68
+
69
+ # Belgium
70
+ BE = value 'BE'
71
+
72
+ # Burkina Faso
73
+ BF = value 'BF'
74
+
75
+ # Bulgaria
76
+ BG = value 'BG'
77
+
78
+ # Bahrain
79
+ BH = value 'BH'
80
+
81
+ # Burundi
82
+ BI = value 'BI'
83
+
84
+ # Benin
85
+ BJ = value 'BJ'
86
+
87
+ # Saint Barthélemy
88
+ BL = value 'BL'
89
+
90
+ # Bermuda
91
+ BM = value 'BM'
92
+
93
+ # Brunei Darussalam
94
+ BN = value 'BN'
95
+
96
+ # Bolivia, Plurinational State of
97
+ BO = value 'BO'
98
+
99
+ # Bonaire, Sint Eustatius and Saba
100
+ BQ = value 'BQ'
101
+
102
+ # Brazil
103
+ BR = value 'BR'
104
+
105
+ # Bahamas
106
+ BS = value 'BS'
107
+
108
+ # Bhutan
109
+ BT = value 'BT'
110
+
111
+ # Bouvet Island
112
+ BV = value 'BV'
113
+
114
+ # Botswana
115
+ BW = value 'BW'
116
+
117
+ # Belarus
118
+ BY = value 'BY'
119
+
120
+ # Belize
121
+ BZ = value 'BZ'
122
+
123
+ # Canada
124
+ CA = value 'CA'
125
+
126
+ # Cocos Keeling Islands
127
+ CC = value 'CC'
128
+
129
+ # Congo, Democratic Republic of
130
+ CD = value 'CD'
131
+
132
+ # Central African Republic
133
+ CF = value 'CF'
134
+
135
+ # Congo
136
+ CG = value 'CG'
137
+
138
+ # Switzerland
139
+ CH = value 'CH'
140
+
141
+ # Côte d'Ivoire
142
+ CI = value 'CI'
143
+
144
+ # Cook Islands
145
+ CK = value 'CK'
146
+
147
+ # Chile
148
+ CL = value 'CL'
149
+
150
+ # Cameroon
151
+ CM = value 'CM'
152
+
153
+ # China
154
+ CN = value 'CN'
155
+
156
+ # Colombia
157
+ CO = value 'CO'
158
+
159
+ # Costa Rica
160
+ CR = value 'CR'
161
+
162
+ # Cuba
163
+ CU = value 'CU'
164
+
165
+ # Cabo Verde
166
+ CV = value 'CV'
167
+
168
+ # Curaçao
169
+ CW = value 'CW'
170
+
171
+ # Christmas Island
172
+ CX = value 'CX'
173
+
174
+ # Cyprus
175
+ CY = value 'CY'
176
+
177
+ # Czech Republic
178
+ CZ = value 'CZ'
179
+
180
+ # Germany
181
+ DE = value 'DE'
182
+
183
+ # Djibouti
184
+ DJ = value 'DJ'
185
+
186
+ # Denmark
187
+ DK = value 'DK'
188
+
189
+ # Dominica
190
+ DM = value 'DM'
191
+
192
+ # Dominican Republic
193
+ DO = value 'DO'
194
+
195
+ # Algeria
196
+ DZ = value 'DZ'
197
+
198
+ # Ecuador
199
+ EC = value 'EC'
200
+
201
+ # Estonia
202
+ EE = value 'EE'
203
+
204
+ # Egypt
205
+ EG = value 'EG'
206
+
207
+ # Western Sahara
208
+ EH = value 'EH'
209
+
210
+ # Eritrea
211
+ ER = value 'ER'
212
+
213
+ # Spain
214
+ ES = value 'ES'
215
+
216
+ # Ethiopia
217
+ ET = value 'ET'
218
+
219
+ # Finland
220
+ FI = value 'FI'
221
+
222
+ # Fiji
223
+ FJ = value 'FJ'
224
+
225
+ # Falkland Islands Malvinas
226
+ FK = value 'FK'
227
+
228
+ # Micronesia, Federated States of
229
+ FM = value 'FM'
230
+
231
+ # Faroe Islands
232
+ FO = value 'FO'
233
+
234
+ # France
235
+ FR = value 'FR'
236
+
237
+ # Gabon
238
+ GA = value 'GA'
239
+
240
+ # United Kingdom
241
+ GB = value 'GB'
242
+
243
+ # Grenada
244
+ GD = value 'GD'
245
+
246
+ # Georgia
247
+ GE = value 'GE'
248
+
249
+ # French Guiana
250
+ GF = value 'GF'
251
+
252
+ # Guernsey
253
+ GG = value 'GG'
254
+
255
+ # Ghana
256
+ GH = value 'GH'
257
+
258
+ # Gibraltar
259
+ GI = value 'GI'
260
+
261
+ # Greenland
262
+ GL = value 'GL'
263
+
264
+ # Gambia
265
+ GM = value 'GM'
266
+
267
+ # Guinea
268
+ GN = value 'GN'
269
+
270
+ # Guadeloupe
271
+ GP = value 'GP'
272
+
273
+ # Equatorial Guinea
274
+ GQ = value 'GQ'
275
+
276
+ # Greece
277
+ GR = value 'GR'
278
+
279
+ # South Georgia and the South Sandwich Islands
280
+ GS = value 'GS'
281
+
282
+ # Guatemala
283
+ GT = value 'GT'
284
+
285
+ # Guam
286
+ GU = value 'GU'
287
+
288
+ # Guinea-Bissau
289
+ GW = value 'GW'
290
+
291
+ # Guyana
292
+ GY = value 'GY'
293
+
294
+ # Hong Kong
295
+ HK = value 'HK'
296
+
297
+ # Heard Island and McDonald Islands
298
+ HM = value 'HM'
299
+
300
+ # Honduras
301
+ HN = value 'HN'
302
+
303
+ # Croatia
304
+ HR = value 'HR'
305
+
306
+ # Haiti
307
+ HT = value 'HT'
308
+
309
+ # Hungary
310
+ HU = value 'HU'
311
+
312
+ # Indonesia
313
+ ID = value 'ID'
314
+
315
+ # Ireland
316
+ IE = value 'IE'
317
+
318
+ # Israel
319
+ IL = value 'IL'
320
+
321
+ # Isle of Man
322
+ IM = value 'IM'
323
+
324
+ # India
325
+ IN = value 'IN'
326
+
327
+ # British Indian Ocean Territory
328
+ IO = value 'IO'
329
+
330
+ # Iraq
331
+ IQ = value 'IQ'
332
+
333
+ # Iran, Islamic Republic of
334
+ IR = value 'IR'
335
+
336
+ # Iceland
337
+ IS = value 'IS'
338
+
339
+ # Italy
340
+ IT = value 'IT'
341
+
342
+ # Jersey
343
+ JE = value 'JE'
344
+
345
+ # Jamaica
346
+ JM = value 'JM'
347
+
348
+ # Jordan
349
+ JO = value 'JO'
350
+
351
+ # Japan
352
+ JP = value 'JP'
353
+
354
+ # Kenya
355
+ KE = value 'KE'
356
+
357
+ # Kyrgyzstan
358
+ KG = value 'KG'
359
+
360
+ # Cambodia
361
+ KH = value 'KH'
362
+
363
+ # Kiribati
364
+ KI = value 'KI'
365
+
366
+ # Comoros
367
+ KM = value 'KM'
368
+
369
+ # Saint Kitts and Nevis
370
+ KN = value 'KN'
371
+
372
+ # Korea, Democratic People's Republic of
373
+ KP = value 'KP'
374
+
375
+ # Korea, Republic of
376
+ KR = value 'KR'
377
+
378
+ # Kuwait
379
+ KW = value 'KW'
380
+
381
+ # Cayman Islands
382
+ KY = value 'KY'
383
+
384
+ # Kazakhstan
385
+ KZ = value 'KZ'
386
+
387
+ # Lao People's Democratic Republic
388
+ LA = value 'LA'
389
+
390
+ # Lebanon
391
+ LB = value 'LB'
392
+
393
+ # Saint Lucia
394
+ LC = value 'LC'
395
+
396
+ # Liechtenstein
397
+ LI = value 'LI'
398
+
399
+ # Sri Lanka
400
+ LK = value 'LK'
401
+
402
+ # Liberia
403
+ LR = value 'LR'
404
+
405
+ # Lesotho
406
+ LS = value 'LS'
407
+
408
+ # Lithuania
409
+ LT = value 'LT'
410
+
411
+ # Luxembourg
412
+ LU = value 'LU'
413
+
414
+ # Latvia
415
+ LV = value 'LV'
416
+
417
+ # Libya
418
+ LY = value 'LY'
419
+
420
+ # Morocco
421
+ MA = value 'MA'
422
+
423
+ # Monaco
424
+ MC = value 'MC'
425
+
426
+ # Moldova, Republic of
427
+ MD = value 'MD'
428
+
429
+ # Montenegro
430
+ ME = value 'ME'
431
+
432
+ # Saint Martin French part
433
+ MF = value 'MF'
434
+
435
+ # Madagascar
436
+ MG = value 'MG'
437
+
438
+ # Marshall Islands
439
+ MH = value 'MH'
440
+
441
+ # Macedonia, the former Yugoslav Republic of
442
+ MK = value 'MK'
443
+
444
+ # Mali
445
+ ML = value 'ML'
446
+
447
+ # Myanmar
448
+ MM = value 'MM'
449
+
450
+ # Mongolia
451
+ MN = value 'MN'
452
+
453
+ # Macao
454
+ MO = value 'MO'
455
+
456
+ # Northern Marina Islands
457
+ MP = value 'MP'
458
+
459
+ # Martinique
460
+ MQ = value 'MQ'
461
+
462
+ # Mauritania
463
+ MR = value 'MR'
464
+
465
+ # Montserrat
466
+ MS = value 'MS'
467
+
468
+ # Malta
469
+ MT = value 'MT'
470
+
471
+ # Mauritius
472
+ MU = value 'MU'
473
+
474
+ # Maldives
475
+ MV = value 'MV'
476
+
477
+ # Malawi
478
+ MW = value 'MW'
479
+
480
+ # Mexico
481
+ MX = value 'MX'
482
+
483
+ # Malaysia
484
+ MY = value 'MY'
485
+
486
+ # Mozambique
487
+ MZ = value 'MZ'
488
+
489
+ # Namibia
490
+ NA = value 'NA'
491
+
492
+ # New Caledonia
493
+ NC = value 'NC'
494
+
495
+ # Niger
496
+ NE = value 'NE'
497
+
498
+ # Norfolk Island
499
+ NF = value 'NF'
500
+
501
+ # Nigeria
502
+ NG = value 'NG'
503
+
504
+ # Nicaragua
505
+ NI = value 'NI'
506
+
507
+ # Netherlands
508
+ NL = value 'NL'
509
+
510
+ # Norway
511
+ NO = value 'NO'
512
+
513
+ # Nepal
514
+ NP = value 'NP'
515
+
516
+ # Nauru
517
+ NR = value 'NR'
518
+
519
+ # Niue
520
+ NU = value 'NU'
521
+
522
+ # New Zealand
523
+ NZ = value 'NZ'
524
+
525
+ # Oman
526
+ OM = value 'OM'
527
+
528
+ # Panama
529
+ PA = value 'PA'
530
+
531
+ # Peru
532
+ PE = value 'PE'
533
+
534
+ # French Polynesia
535
+ PF = value 'PF'
536
+
537
+ # Papua New Guinea
538
+ PG = value 'PG'
539
+
540
+ # Philippines
541
+ PH = value 'PH'
542
+
543
+ # Pakistan
544
+ PK = value 'PK'
545
+
546
+ # Poland
547
+ PL = value 'PL'
548
+
549
+ # Saint Pierre and Miquelon
550
+ PM = value 'PM'
551
+
552
+ # Pitcairn
553
+ PN = value 'PN'
554
+
555
+ # Puerto Rico
556
+ PR = value 'PR'
557
+
558
+ # Palestine, State of
559
+ PS = value 'PS'
560
+
561
+ # Portugal
562
+ PT = value 'PT'
563
+
564
+ # Palau
565
+ PW = value 'PW'
566
+
567
+ # Paraguay
568
+ PY = value 'PY'
569
+
570
+ # Qatar
571
+ QA = value 'QA'
572
+
573
+ # Réunion
574
+ RE = value 'RE'
575
+
576
+ # Romania
577
+ RO = value 'RO'
578
+
579
+ # Serbia
580
+ RS = value 'RS'
581
+
582
+ # Russian Federation
583
+ RU = value 'RU'
584
+
585
+ # Rwanda
586
+ RW = value 'RW'
587
+
588
+ # Saudi Arabia
589
+ SA = value 'SA'
590
+
591
+ # Solomon Islands
592
+ SB = value 'SB'
593
+
594
+ # Seychelles
595
+ SC = value 'SC'
596
+
597
+ # Sudan
598
+ SD = value 'SD'
599
+
600
+ # Sweden
601
+ SE = value 'SE'
602
+
603
+ # Singapore
604
+ SG = value 'SG'
605
+
606
+ # Saint Helena, Ascension and Tristan da Cunha
607
+ SH = value 'SH'
608
+
609
+ # Slovenia
610
+ SI = value 'SI'
611
+
612
+ # Svalbard and Jan Mayen
613
+ SJ = value 'SJ'
614
+
615
+ # Slovakia
616
+ SK = value 'SK'
617
+
618
+ # Sierra Leone
619
+ SL = value 'SL'
620
+
621
+ # San Marino
622
+ SM = value 'SM'
623
+
624
+ # Senegal
625
+ SN = value 'SN'
626
+
627
+ # Somalia
628
+ SO = value 'SO'
629
+
630
+ # Suriname
631
+ SR = value 'SR'
632
+
633
+ # South Sudan
634
+ SS = value 'SS'
635
+
636
+ # Sao Tome and Principe
637
+ ST = value 'ST'
638
+
639
+ # El Salvador
640
+ SV = value 'SV'
641
+
642
+ # Sint Maarten Dutch part
643
+ SX = value 'SX'
644
+
645
+ # Syrian Arab Republic
646
+ SY = value 'SY'
647
+
648
+ # Swaziland
649
+ SZ = value 'SZ'
650
+
651
+ # Turks and Caicos Islands
652
+ TC = value 'TC'
653
+
654
+ # Chad
655
+ TD = value 'TD'
656
+
657
+ # French Southern Territories
658
+ TF = value 'TF'
659
+
660
+ # Togo
661
+ TG = value 'TG'
662
+
663
+ # Thailand
664
+ TH = value 'TH'
665
+
666
+ # Tajikistan
667
+ TJ = value 'TJ'
668
+
669
+ # Tokelau
670
+ TK = value 'TK'
671
+
672
+ # Timor-Leste
673
+ TL = value 'TL'
674
+
675
+ # Turkmenistan
676
+ TM = value 'TM'
677
+
678
+ # Tunisia
679
+ TN = value 'TN'
680
+
681
+ # Tonga
682
+ TO = value 'TO'
683
+
684
+ # Turkey
685
+ TR = value 'TR'
686
+
687
+ # Trinidad and Tobago
688
+ TT = value 'TT'
689
+
690
+ # Tuvalu
691
+ TV = value 'TV'
692
+
693
+ # Taiwan, Province of China
694
+ TW = value 'TW'
695
+
696
+ # Tanzania, United Republic of
697
+ TZ = value 'TZ'
698
+
699
+ # Ukraine
700
+ UA = value 'UA'
701
+
702
+ # Uganda
703
+ UG = value 'UG'
704
+
705
+ # United States Minor Outlying Islands
706
+ UM = value 'UM'
707
+
708
+ # United States
709
+ US = value 'US'
710
+
711
+ # Uruguay
712
+ UY = value 'UY'
713
+
714
+ # Uzbekistan
715
+ UZ = value 'UZ'
716
+
717
+ # Holy See Vatican City State
718
+ VA = value 'VA'
719
+
720
+ # Saint Vincent and the Grenadines
721
+ VC = value 'VC'
722
+
723
+ # Venezuela, Bolivarian Republic of
724
+ VE = value 'VE'
725
+
726
+ # Virgin Islands, British
727
+ VG = value 'VG'
728
+
729
+ # Virgin Islands, U.S.
730
+ VI = value 'VI'
731
+
732
+ # Vietnam
733
+ VN = value 'VN'
734
+
735
+ # Vanuatu
736
+ VU = value 'VU'
737
+
738
+ # Wallis and Futuna
739
+ WF = value 'WF'
740
+
741
+ # Samoa
742
+ WS = value 'WS'
743
+
744
+ # Yemen
745
+ YE = value 'YE'
746
+
747
+ # Mayotte
748
+ YT = value 'YT'
749
+
750
+ # South Africa
751
+ ZA = value 'ZA'
752
+
753
+ # Zambia
754
+ ZM = value 'ZM'
755
+
756
+ # Zimbabwe
757
+ ZW = value 'ZW'
758
+ end
759
+ end