six_saferpay 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/Gemfile.lock +58 -0
  4. data/lib/six_saferpay/api/six_payment_page/requests/assert.rb +34 -0
  5. data/lib/six_saferpay/api/six_payment_page/requests/initialize.rb +96 -0
  6. data/lib/six_saferpay/api/six_payment_page/responses/assert_response.rb +46 -0
  7. data/lib/six_saferpay/api/six_payment_page/responses/initalize_response.rb +44 -0
  8. data/lib/six_saferpay/api/six_payment_page.rb +10 -0
  9. data/lib/six_saferpay/api/six_transaction/requests/authorization.rb +33 -0
  10. data/lib/six_saferpay/api/six_transaction/requests/cancel.rb +33 -0
  11. data/lib/six_saferpay/api/six_transaction/requests/capture.rb +54 -0
  12. data/lib/six_saferpay/api/six_transaction/requests/initialize.rb +73 -0
  13. data/lib/six_saferpay/api/six_transaction/responses/capture_response.rb +32 -0
  14. data/lib/six_saferpay/api/six_transaction/responses/initialize_response.rb +12 -0
  15. data/lib/six_saferpay/api/six_transaction.rb +4 -0
  16. data/lib/six_saferpay/api.rb +1 -4
  17. data/lib/six_saferpay/client.rb +17 -5
  18. data/lib/six_saferpay/error.rb +11 -0
  19. data/lib/six_saferpay/model.rb +5 -0
  20. data/lib/six_saferpay/models/address.rb +73 -0
  21. data/lib/six_saferpay/models/address_form.rb +21 -0
  22. data/lib/six_saferpay/models/alias.rb +23 -0
  23. data/lib/six_saferpay/models/alipay.rb +18 -0
  24. data/lib/six_saferpay/models/amount.rb +19 -0
  25. data/lib/six_saferpay/models/bank_account.rb +35 -0
  26. data/lib/six_saferpay/models/billing_address.rb +4 -0
  27. data/lib/six_saferpay/models/billing_address_form.rb +4 -0
  28. data/lib/six_saferpay/models/billpay.rb +18 -0
  29. data/lib/six_saferpay/models/brand.rb +20 -0
  30. data/lib/six_saferpay/models/card.rb +40 -0
  31. data/lib/six_saferpay/models/card_form.rb +18 -0
  32. data/lib/six_saferpay/models/client_info.rb +20 -0
  33. data/lib/six_saferpay/models/dcc.rb +18 -0
  34. data/lib/six_saferpay/models/debit_direct.rb +20 -0
  35. data/lib/six_saferpay/models/delivery_address.rb +4 -0
  36. data/lib/six_saferpay/models/delivery_address_form.rb +4 -0
  37. data/lib/six_saferpay/models/fee.rb +4 -0
  38. data/lib/six_saferpay/models/fee_refund.rb +4 -0
  39. data/lib/six_saferpay/models/installment.rb +18 -0
  40. data/lib/six_saferpay/models/invoice.rb +22 -0
  41. data/lib/six_saferpay/models/liability.rb +36 -0
  42. data/lib/six_saferpay/models/marketplace.rb +22 -0
  43. data/lib/six_saferpay/models/notification.rb +26 -0
  44. data/lib/six_saferpay/models/options.rb +18 -0
  45. data/lib/six_saferpay/models/payee.rb +23 -0
  46. data/lib/six_saferpay/models/payer.rb +27 -7
  47. data/lib/six_saferpay/models/payer_amount.rb +22 -0
  48. data/lib/six_saferpay/models/payment.rb +33 -14
  49. data/lib/six_saferpay/models/payment_means.rb +40 -0
  50. data/lib/six_saferpay/models/payment_methods_options.rb +18 -0
  51. data/lib/six_saferpay/models/pending_notification.rb +20 -0
  52. data/lib/six_saferpay/models/recurring.rb +18 -0
  53. data/lib/six_saferpay/models/register_alias.rb +23 -0
  54. data/lib/six_saferpay/models/registration_result.rb +27 -0
  55. data/lib/six_saferpay/models/request_header.rb +12 -11
  56. data/lib/six_saferpay/models/response_header.rb +20 -0
  57. data/lib/six_saferpay/models/return_urls.rb +12 -10
  58. data/lib/six_saferpay/models/six_transaction/initialize/card.rb +44 -0
  59. data/lib/six_saferpay/models/six_transaction/initialize/payment_means.rb +32 -0
  60. data/lib/six_saferpay/models/six_transaction/initialize.rb +6 -0
  61. data/lib/six_saferpay/models/six_transaction.rb +4 -0
  62. data/lib/six_saferpay/models/styling.rb +12 -7
  63. data/lib/six_saferpay/models/terminal.rb +14 -14
  64. data/lib/six_saferpay/models/three_ds.rb +28 -0
  65. data/lib/six_saferpay/models/transaction.rb +69 -0
  66. data/lib/six_saferpay/models/transaction_reference.rb +11 -7
  67. data/lib/six_saferpay/models/twint.rb +18 -0
  68. data/lib/six_saferpay/models/verification_code.rb +4 -2
  69. data/lib/six_saferpay/models/wallet.rb +32 -0
  70. data/lib/six_saferpay/version.rb +1 -1
  71. data/lib/six_saferpay.rb +6 -15
  72. data/six_saferpay.gemspec +12 -5
  73. metadata +131 -15
  74. data/.rspec_status +0 -28
  75. data/lib/six_saferpay/api/payment_page/assert.rb +0 -30
  76. data/lib/six_saferpay/api/payment_page/initialize.rb +0 -35
  77. data/lib/six_saferpay/api/payment_page.rb +0 -20
  78. data/lib/six_saferpay/api/transaction/authorization.rb +0 -31
  79. data/lib/six_saferpay/api/transaction/cancel.rb +0 -31
  80. data/lib/six_saferpay/api/transaction/capture.rb +0 -31
  81. data/lib/six_saferpay/api/transaction/initialize.rb +0 -36
  82. data/lib/six_saferpay/api/transaction.rb +0 -22
  83. data/lib/six_saferpay/models/token.rb +0 -18
@@ -0,0 +1,73 @@
1
+ module SixSaferpay
2
+ class Address
3
+
4
+ attr_accessor(:first_name,
5
+ :last_name,
6
+ :date_of_birth,
7
+ :company,
8
+ :gender,
9
+ :legal_form,
10
+ :street_1,
11
+ :street_2,
12
+ :zip,
13
+ :city,
14
+ :country_subdevision_code,
15
+ :country_code,
16
+ :phone,
17
+ :email,
18
+ )
19
+
20
+
21
+ def initialize(first_name: nil,
22
+ last_name: nil,
23
+ date_of_birth: nil,
24
+ company: nil,
25
+ gender: nil,
26
+ legal_form: nil,
27
+ street_1: nil,
28
+ street_2: nil,
29
+ zip: nil,
30
+ city: nil,
31
+ country_subdevision_code: nil,
32
+ country_code: nil,
33
+ phone: nil,
34
+ email: nil
35
+ )
36
+ @first_name = first_name
37
+ @last_name = last_name
38
+ @date_of_birth = date_of_birth
39
+ @company = company
40
+ @gender = gender
41
+ @legal_form = legal_form
42
+ @street_1 = street_1
43
+ @street_2 = street_2
44
+ @zip = zip
45
+ @city = city
46
+ @country_subdevision_code = country_subdevision_code
47
+ @country_code = country_code
48
+ @phone = phone
49
+ @email = email
50
+ end
51
+
52
+ def to_hash
53
+ hash = Hash.new
54
+ hash.merge!(first_name: @first_name) if @first_name
55
+ hash.merge!(last_name: @last_name) if @last_name
56
+ hash.merge!(date_of_birth: @date_of_birth) if @date_of_birth
57
+ hash.merge!(company: @company) if @company
58
+ hash.merge!(gender: @gender) if @gender
59
+ hash.merge!(legal_form: @legal_form) if @legal_form
60
+ hash.merge!(street: @street_1) if @street_1
61
+ hash.merge!(street_2: @street_2) if @street_2
62
+ hash.merge!(zip: @zip) if @zip
63
+ hash.merge!(city: @city) if @city
64
+ hash.merge!(country_subdevision_code: @country_subdevision_code) if @country_subdevision_code
65
+ hash.merge!(country_code: @country_code) if @country_code
66
+ hash.merge!(phone: @phone) if @phone
67
+ hash.merge!(email: @email) if @email
68
+ hash
69
+ end
70
+ alias_method :to_h, :to_hash
71
+
72
+ end
73
+ end
@@ -0,0 +1,21 @@
1
+ module SixSaferpay
2
+ class AddressForm
3
+
4
+ attr_accessor(:display, :mandatory_fields)
5
+
6
+ def initialize(display:, mandatory_fields: nil)
7
+ @display = display
8
+ @mandatory_fields = mandatory_fields
9
+ end
10
+
11
+ def to_hash
12
+ hash = Hash.new
13
+ hash.merge!(display: @display)
14
+ hash.merge!(mandatory_fields: @mandatory_fields) if @mandatory_fields
15
+ hash
16
+ end
17
+ alias_method :to_h, :to_hash
18
+
19
+ end
20
+ end
21
+
@@ -0,0 +1,23 @@
1
+ module SixSaferpay
2
+ class PaymentMeans
3
+
4
+ attr_accessor(:id,
5
+ :verification_code
6
+ )
7
+
8
+ def initialize(id:,
9
+ verification_code: nil
10
+ )
11
+ @id = id
12
+ @verification_code = verification_code
13
+ end
14
+
15
+ def to_hash
16
+ body = Hash.new
17
+ body.merge!(Id: @id)
18
+ body.merge!(VerificationCode: @verification_code) if @verification_code
19
+ body
20
+ end
21
+ alias_method :to_h, :to_hash
22
+ end
23
+ end
@@ -0,0 +1,18 @@
1
+ module SixSaferpay
2
+ class Alipay
3
+
4
+ attr_accessor(:local_wallet)
5
+
6
+ def initialize(local_wallet:)
7
+ @local_wallet = local_wallet
8
+ end
9
+
10
+ def to_hash
11
+ hash = Hash.new
12
+ hash.merge!(local_wallet: @local_wallet)
13
+ hash
14
+ end
15
+ alias_method :to_h, :to_hash
16
+
17
+ end
18
+ end
@@ -0,0 +1,19 @@
1
+ module SixSaferpay
2
+ class Amount
3
+
4
+ attr_accessor :value, :currency_code
5
+
6
+ def initialize(value:, currency_code:)
7
+ @value = value
8
+ @currency_code = currency_code
9
+ end
10
+
11
+ def to_hash
12
+ body = Hash.new
13
+ body.merge!(value: @value)
14
+ body.merge!(currency_code: @currency_code)
15
+ end
16
+ alias_method :to_h, :to_hash
17
+
18
+ end
19
+ end
@@ -0,0 +1,35 @@
1
+ module SixSaferpay
2
+ class BankAccount
3
+
4
+ attr_accessor(:iban,
5
+ :holder_name,
6
+ :bic,
7
+ :bank_name,
8
+ :country_code
9
+ )
10
+
11
+ def initialize(iban:,
12
+ holder_name: nil,
13
+ bic: nil,
14
+ bank_name: nil,
15
+ country_code: nil
16
+ )
17
+ @iban = iban
18
+ @holder_name = holder_name
19
+ @bic = bic
20
+ @bank_name = bank_name
21
+ @country_code = country_code
22
+ end
23
+
24
+ def to_hash
25
+ body = Hash.new
26
+ body.merge!(IBAN: @iban)
27
+ body.merge!(HolderName: @holder_name)
28
+ body.merge!(BankName: @bank_name)
29
+ body.merge!(CountryCode: @country_code)
30
+ body
31
+ end
32
+ alias_method :to_h, :to_hash
33
+
34
+ end
35
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class BillingAddress < SixSaferpay::Address
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class BillingAddressForm < SixSaferpay::AddressForm
3
+ end
4
+ end
@@ -0,0 +1,18 @@
1
+ module SixSaferpay
2
+ class Billpay
3
+
4
+ attr_accessor(:delay_in_days)
5
+
6
+ def initialize(delay_in_days: )
7
+ @delay_in_days = delay_in_days
8
+ end
9
+
10
+ def to_hash
11
+ hash = Hash.new
12
+ hash.merge!(delay_in_days: @delay_in_days) if @delay_in_days
13
+ hash
14
+ end
15
+ alias_method :to_h, :to_hash
16
+
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ module SixSaferpay
2
+ class Brand
3
+
4
+ attr_accessor(:payment_method, :name)
5
+
6
+ def initialize(payment_method: nil, name:)
7
+ @payment_method = payment_method
8
+ @name = name
9
+ end
10
+
11
+ def to_hash
12
+ body = Hash.new
13
+ body.merge!(PaymentMethod: @payment_method) if @payment_method
14
+ body.merge!(Name: @name)
15
+ body
16
+ end
17
+ alias_method :to_h, :to_hash
18
+
19
+ end
20
+ end
@@ -0,0 +1,40 @@
1
+ module SixSaferpay
2
+ class Card
3
+
4
+ attr_accessor(:masked_number,
5
+ :exp_year,
6
+ :exp_month,
7
+ :holder_name,
8
+ :country_code,
9
+ :hash_value
10
+ )
11
+
12
+ def initialize(masked_number:,
13
+ exp_year:,
14
+ exp_month:,
15
+ holder_name: nil,
16
+ country_code: nil,
17
+ hash_value: nil
18
+ )
19
+ @masked_number = masked_number
20
+ @exp_year = exp_year
21
+ @exp_month = exp_month
22
+ @holder_name = holder_name
23
+ @country_code = country_code
24
+ @hash_value = hash_value
25
+ end
26
+
27
+ def to_hash
28
+ body = Hash.new
29
+ body.merge!(MaskedNumber: @masked_number)
30
+ body.merge!(ExpYear: @exp_year)
31
+ body.merge!(ExpMonth: @exp_month)
32
+ body.merge!(HolderName: @holder_name) if @holder_name
33
+ body.merge!(CountryCode: @country_code) if @country_code
34
+ body.merge!(HashValue: @hash_value) if @hash_value
35
+ body
36
+ end
37
+ alias_method :to_h, :to_hash
38
+
39
+ end
40
+ end
@@ -0,0 +1,18 @@
1
+ module SixSaferpay
2
+ class CardForm
3
+
4
+ attr_accessor(:holder_name)
5
+
6
+ def initialize(holder_name: nil)
7
+ @holder_name = holder_name
8
+ end
9
+
10
+ def to_hash
11
+ hash = Hash.new
12
+ hash.merge!(holder_name: @holder_name) if @holder_name
13
+ hash
14
+ end
15
+ alias_method :to_h, :to_hash
16
+
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ module SixSaferpay
2
+ class ClientInfo < Model
3
+
4
+ attr_accessor :shop_info, :os_info
5
+
6
+ def initialize(shop_info:, os_info:)
7
+ @shop_info = shop_info
8
+ @os_info = os_info
9
+ end
10
+
11
+ def to_hash
12
+ hash = Hash.new
13
+ hash.merge!(shop_info: @shop_info)
14
+ hash.merge!(os_info: @os_info)
15
+ hash
16
+ end
17
+ alias_method :to_h, :to_hash
18
+
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ module SixSaferpay
2
+ class Dcc
3
+
4
+ attr_accessor(:payer_amount)
5
+
6
+ def initialize(payer_amount:)
7
+ @payer_amount = SixSaferpay::PayerAmount(payer_amount.to_h)
8
+ end
9
+
10
+ def to_hash
11
+ hash = Hash.new
12
+ hash.merge!(PayerAmount: @payer_amount.to_h) if @payer_amount
13
+ hash
14
+ end
15
+ alias_method :to_h, :to_hash
16
+
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ module SixSaferpay
2
+ class DebitDirect
3
+
4
+ attr_accessor(:mandate_id, :creditor_id)
5
+
6
+ def invoice(mandate_id:, creditor_id:)
7
+ @mandate_id = mandate_id
8
+ @creditor_id = creditor_id
9
+ end
10
+
11
+ def to_hash
12
+ body = Hash.new
13
+ body.merge!(MandateId: @mandate_id)
14
+ body.merge!(CreditorId: @creditor_id)
15
+ body
16
+ end
17
+ alias_method :to_h, :to_hash
18
+
19
+ end
20
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class DeliveryAddress < SixSaferpay::Address
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class DeliveryAddressForm < SixSaferpay::AddressForm
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class Fee < SixSaferpay::Amount
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module SixSaferpay
2
+ class SixRefund < SixSaferpay::Amount
3
+ end
4
+ end
@@ -0,0 +1,18 @@
1
+ module SixSaferpay
2
+ class Installment
3
+
4
+ attr_accessor(:initial)
5
+
6
+ def initialize(initial:)
7
+ @initial = initial
8
+ end
9
+
10
+ def to_hash
11
+ hash = Hash.new
12
+ hash.merge!(initial: @initial)
13
+ hash
14
+ end
15
+ alias_method :to_h, :to_hash
16
+
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ module SixSaferpay
2
+ class Invoice
3
+
4
+ attr_accessor(:payee, :reason_for_transfer, :due_date)
5
+
6
+ def initialize(payee: nil, reason_for_transfer: nil, due_date: nil)
7
+ @payee = payee
8
+ @reason_for_transfer = reason_for_transfer
9
+ @due_date = due_date
10
+ end
11
+
12
+ def to_hash
13
+ body = Hash.new
14
+ body.merge!(payee: @payee.to_h) if @payee
15
+ body.merge!(reason_for_transfer: @reason_for_transfer) if @reason_for_transfer
16
+ body.merge!(due_date: @due_date) if @due_date
17
+ body
18
+ end
19
+ alias_method :to_h, :to_hash
20
+
21
+ end
22
+ end
@@ -0,0 +1,36 @@
1
+ module SixSaferpay
2
+ class Liability
3
+
4
+ attr_accessor(:liability_shift,
5
+ :liable_entity,
6
+ :three_ds,
7
+ :fraud_free,
8
+ :dcc
9
+ )
10
+
11
+ def initialize(liability_shift:,
12
+ liable_entity:,
13
+ three_ds: nil,
14
+ fraud_free: nil,
15
+ dcc: nil
16
+ )
17
+ @liability_shift = liability_shift
18
+ @liable_entity = liable_entity
19
+ @three_ds = three_ds
20
+ @fraud_free = fraud_free
21
+ @dcc = dcc
22
+ end
23
+
24
+ def to_hash
25
+ body = Hash.new
26
+ body.merge!(LiabilityShift: @liability_shift)
27
+ body.merge!(LiableEntry: @liable_entity)
28
+ body.merge!(ThreeDs: @three_ds) if @three_ds
29
+ body.merge!(FraudFree: @fraud_free) if @fraud_free
30
+ body.merge!(Dcc: @dcc) if @dcc
31
+ body
32
+ end
33
+ alias_method :to_h, :to_hash
34
+
35
+ end
36
+ end
@@ -0,0 +1,22 @@
1
+ module SixSaferpay
2
+ class Marketplace
3
+
4
+ attr_accessor(:submerchant_id, :fee, :fee_refund)
5
+
6
+ def initialize(submerchant_id: , fee: , fee_refund: )
7
+ @submerchant_id = submerchant_id
8
+ @fee = SixSaferpay::Fee.new(fee.to_h) if fee
9
+ @fee_refund = SixSaferpay::FeeRefund.new(fee_refund.to_h) if fee_refund
10
+ end
11
+
12
+ def to_hash
13
+ hash = Hash.new
14
+ hash.merge!(submerchant_id: @submerchant_id) if @submerchant_id
15
+ hash.merge!(fee: @fee.to_h) if @fee
16
+ hash.merge!(fee_refund: @fee_refund.to_h) if @fee_refund
17
+ hash
18
+ end
19
+ alias_method :to_h, :to_hash
20
+
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ module SixSaferpay
2
+ class Notification
3
+
4
+ attr_accessor(:merchant_email,
5
+ :payer_email,
6
+ :notify_url
7
+ )
8
+
9
+ def initialize(merchant_email: nil, payer_email: nil, notify_url: nil)
10
+ @merchant_email = merchant_email
11
+ @payer_email = payer_email
12
+ @notify_url = notify_url
13
+ end
14
+
15
+ def to_hash
16
+ hash = Hash.new
17
+ hash.merge!(merchant_email: @merchant_email) if @merchant_email
18
+ hash.merge!(payer_email: @payer_email) if @payer_email
19
+ hash.merge!(notify_url: @notify_url) if @notify_url
20
+ hash
21
+ end
22
+ alias_method :to_h, :to_hash
23
+
24
+ end
25
+ end
26
+
@@ -0,0 +1,18 @@
1
+ module SixSaferpay
2
+ class Options
3
+
4
+ attr_accessor :pre_auth
5
+
6
+ def initialize(pre_auth: nil)
7
+ @pre_auth = pre_auth
8
+ end
9
+
10
+ def to_hash
11
+ hash = Hash.new
12
+ hash.merge!(pre_auth: @pre_auth) if @pre_auth
13
+ hash
14
+ end
15
+ alias_method :to_h, :to_hash
16
+
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ module SixSaferpay
2
+ class Payee
3
+
4
+ attr_accessor(:iban, :holder_name, :bic, :bank_name)
5
+
6
+ def initialize(iban:, holder_name: nil, bic: nil, bank_name: nil)
7
+ @iban = iban
8
+ @holder_name = holder_name
9
+ @bic = bic
10
+ @bank_name = bank_name
11
+ end
12
+
13
+ def to_hash
14
+ body = Hash.new
15
+ body.merge!(IBAN: @iban)
16
+ body.merge!(holder_name: @holder_name) if @holder_name
17
+ body.merge!(BIC: @bic) if @bic
18
+ body.merge!(bank_name: @bank_name) if @bank_name
19
+ body
20
+ end
21
+ alias_method :to_h, :to_hash
22
+ end
23
+ end
@@ -1,17 +1,37 @@
1
1
  module SixSaferpay
2
2
  class Payer
3
3
 
4
- def initialize(language)
5
- @language = language
4
+ attr_accessor(:ip_address,
5
+ :ip_location,
6
+ :language_code,
7
+ :delivery_address,
8
+ :billing_address
9
+ )
10
+
11
+
12
+ def initialize(ip_address: nil,
13
+ ip_location: nil,
14
+ language_code: nil,
15
+ delivery_address: nil,
16
+ billing_address: nil
17
+ )
18
+ @ip_address = ip_address
19
+ @ip_location = ip_location
20
+ @language_code = language_code
21
+ @delivery_address = SixSaferpay::DeliveryAddress.new(delivery_address.to_h) if delivery_address
22
+ @billing_address = SixSaferpay::BillingAddress.new(billing_address.to_h) if billing_address
6
23
  end
7
24
 
8
25
  def to_hash
9
- {
10
- 'Payer': {
11
- 'LanguageCode': @language
12
- }
13
- }
26
+ hash = Hash.new
27
+ hash.merge!(ip_address: @ip_address) if @ip_address
28
+ hash.merge!(ip_location: @ip_location) if @ip_location
29
+ hash.merge!(language_code: @language_code) if @language_code
30
+ hash.merge!(delivery_address: @delivery_address.to_h) if @delivery_address
31
+ hash.merge!(billing_address: @billing_address.to_h) if @billing_address
32
+ hash
14
33
  end
15
34
  alias_method :to_h, :to_hash
35
+
16
36
  end
17
37
  end
@@ -0,0 +1,22 @@
1
+ module SixSaferpay
2
+ class PayerAmount
3
+
4
+ attr_accessor(:value,
5
+ :currency_code
6
+ )
7
+
8
+ def initialize(value: , currency_code: )
9
+ @value = value
10
+ @currency_code = @currency_code
11
+ end
12
+
13
+ def to_hash
14
+ hash = Hash.new
15
+ hash.merge!(Value: @value) if @value
16
+ hash.merge!(CurrencyCode: @currency_code) if @currency_code
17
+ hash
18
+ end
19
+ alias_method :to_h, :to_hash
20
+
21
+ end
22
+ end