bleumi_pay_sdk_ruby 1.0.2 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/README.md +67 -47
  4. data/bleumi_pay_sdk_ruby.gemspec +4 -5
  5. data/docs/AlgorandBalance.md +28 -0
  6. data/docs/AlgorandWalletAddress.md +24 -0
  7. data/docs/AlgorandWalletInputs.md +23 -0
  8. data/docs/BadRequest.md +2 -1
  9. data/docs/Chain.md +14 -0
  10. data/docs/CheckoutToken.md +28 -0
  11. data/docs/CreateCheckoutUrlRequest.md +28 -0
  12. data/docs/CreateCheckoutUrlResponse.md +17 -0
  13. data/docs/CreatePaymentRequest.md +19 -0
  14. data/docs/CreatePaymentResponse.md +15 -0
  15. data/docs/CreatePayoutRequest.md +28 -0
  16. data/docs/CreatePayoutResponse.md +15 -0
  17. data/docs/EthereumBalance.md +30 -0
  18. data/docs/EthereumWalletAddress.md +23 -0
  19. data/docs/EthereumWalletInputs.md +23 -0
  20. data/docs/HostedCheckoutsApi.md +197 -0
  21. data/docs/PaginatedPaymentOperations.md +28 -0
  22. data/docs/PaginatedPayments.md +95 -0
  23. data/docs/PaginatedPayoutItems.md +59 -0
  24. data/docs/Payment.md +67 -0
  25. data/docs/PaymentAddresses.md +21 -0
  26. data/docs/PaymentBalances.md +21 -0
  27. data/docs/PaymentOperation.md +46 -0
  28. data/docs/PaymentOperationInputs.md +31 -0
  29. data/docs/PaymentOperationResponse.md +15 -0
  30. data/docs/PaymentRefundRequest.md +14 -0
  31. data/docs/PaymentSettleRequest.md +17 -0
  32. data/docs/PaymentsApi.md +368 -0
  33. data/docs/Payout.md +18 -0
  34. data/docs/PayoutItem.md +39 -0
  35. data/docs/PayoutItemInputs.md +28 -0
  36. data/docs/PayoutsApi.md +137 -0
  37. data/docs/RskBalance.md +28 -0
  38. data/docs/ValidateCheckoutRequest.md +21 -0
  39. data/docs/ValidateCheckoutResponse.md +15 -0
  40. data/docs/WalletBalance.md +18 -4
  41. data/hc_create.rb +40 -0
  42. data/hc_list.rb +17 -0
  43. data/hc_validate.rb +22 -0
  44. data/lib/bleumi_pay_sdk_ruby.rb +38 -17
  45. data/lib/bleumi_pay_sdk_ruby/api/hosted_checkouts_api.rb +212 -0
  46. data/lib/bleumi_pay_sdk_ruby/api/payments_api.rb +517 -0
  47. data/lib/bleumi_pay_sdk_ruby/api/payouts_api.rb +157 -0
  48. data/lib/bleumi_pay_sdk_ruby/api/request_validator.rb +288 -0
  49. data/lib/bleumi_pay_sdk_ruby/api_client.rb +11 -9
  50. data/lib/bleumi_pay_sdk_ruby/api_error.rb +3 -3
  51. data/lib/bleumi_pay_sdk_ruby/configuration.rb +4 -4
  52. data/lib/bleumi_pay_sdk_ruby/models/algorand_balance.rb +219 -0
  53. data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_address.rb +221 -0
  54. data/lib/bleumi_pay_sdk_ruby/models/algorand_wallet_inputs.rb +247 -0
  55. data/lib/bleumi_pay_sdk_ruby/models/bad_request.rb +15 -5
  56. data/lib/bleumi_pay_sdk_ruby/models/{eth_network.rb → chain.rb} +12 -9
  57. data/lib/bleumi_pay_sdk_ruby/models/checkout_token.rb +302 -0
  58. data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_request.rb +312 -0
  59. data/lib/bleumi_pay_sdk_ruby/models/create_checkout_url_response.rb +227 -0
  60. data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_input.rb → create_payment_request.rb} +33 -11
  61. data/lib/bleumi_pay_sdk_ruby/models/{wallet_create_output.rb → create_payment_response.rb} +19 -23
  62. data/lib/bleumi_pay_sdk_ruby/models/create_payout_request.rb +244 -0
  63. data/lib/bleumi_pay_sdk_ruby/models/create_payout_response.rb +212 -0
  64. data/lib/bleumi_pay_sdk_ruby/models/ethereum_balance.rb +241 -0
  65. data/lib/bleumi_pay_sdk_ruby/models/ethereum_wallet_address.rb +221 -0
  66. data/lib/bleumi_pay_sdk_ruby/models/{wallet_inputs.rb → ethereum_wallet_inputs.rb} +35 -50
  67. data/lib/bleumi_pay_sdk_ruby/models/paginated_payment_operations.rb +224 -0
  68. data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallet_operations.rb → paginated_payments.rb} +19 -9
  69. data/lib/bleumi_pay_sdk_ruby/models/{paginated_wallets.rb → paginated_payout_items.rb} +19 -9
  70. data/lib/bleumi_pay_sdk_ruby/models/{wallet.rb → payment.rb} +31 -54
  71. data/lib/bleumi_pay_sdk_ruby/models/payment_addresses.rb +231 -0
  72. data/lib/bleumi_pay_sdk_ruby/models/payment_balances.rb +225 -0
  73. data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation.rb → payment_operation.rb} +44 -18
  74. data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_inputs.rb → payment_operation_inputs.rb} +38 -12
  75. data/lib/bleumi_pay_sdk_ruby/models/{wallet_operation_output.rb → payment_operation_response.rb} +18 -8
  76. data/lib/bleumi_pay_sdk_ruby/models/{wallet_refund_operation_input.rb → payment_refund_request.rb} +18 -8
  77. data/lib/bleumi_pay_sdk_ruby/models/{wallet_settle_operation_input.rb → payment_settle_request.rb} +18 -8
  78. data/lib/bleumi_pay_sdk_ruby/models/payout.rb +237 -0
  79. data/lib/bleumi_pay_sdk_ruby/models/payout_item.rb +286 -0
  80. data/lib/bleumi_pay_sdk_ruby/models/payout_item_inputs.rb +244 -0
  81. data/lib/bleumi_pay_sdk_ruby/models/rsk_balance.rb +219 -0
  82. data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_request.rb +257 -0
  83. data/lib/bleumi_pay_sdk_ruby/models/validate_checkout_response.rb +212 -0
  84. data/lib/bleumi_pay_sdk_ruby/models/wallet_balance.rb +37 -12
  85. data/lib/bleumi_pay_sdk_ruby/version.rb +4 -4
  86. data/po_create.rb +39 -0
  87. data/po_list.rb +23 -0
  88. data/py_create.rb +48 -0
  89. data/py_get.rb +18 -0
  90. data/py_getop.rb +19 -0
  91. data/py_list.rb +24 -0
  92. data/py_listops.rb +21 -0
  93. data/py_refund.rb +43 -0
  94. data/py_settle.rb +43 -0
  95. data/spec/api/hosted_checkouts_api_spec.rb +67 -0
  96. data/spec/api/payments_api_spec.rb +123 -0
  97. data/spec/api/payouts_api_spec.rb +61 -0
  98. data/spec/api_client_spec.rb +226 -0
  99. data/spec/configuration_spec.rb +42 -0
  100. data/spec/models/algorand_balance_spec.rb +47 -0
  101. data/spec/models/algorand_wallet_address_spec.rb +47 -0
  102. data/spec/models/algorand_wallet_inputs_spec.rb +65 -0
  103. data/spec/models/bad_request_spec.rb +47 -0
  104. data/spec/models/chain_spec.rb +35 -0
  105. data/spec/models/checkout_token_spec.rb +77 -0
  106. data/spec/models/create_checkout_url_request_spec.rb +89 -0
  107. data/spec/models/create_checkout_url_response_spec.rb +47 -0
  108. data/spec/models/create_payment_request_spec.rb +59 -0
  109. data/spec/models/create_payment_response_spec.rb +41 -0
  110. data/spec/models/create_payout_request_spec.rb +53 -0
  111. data/spec/models/create_payout_response_spec.rb +41 -0
  112. data/spec/models/ethereum_balance_spec.rb +59 -0
  113. data/spec/models/ethereum_wallet_address_spec.rb +47 -0
  114. data/spec/models/ethereum_wallet_inputs_spec.rb +65 -0
  115. data/spec/models/paginated_payment_operations_spec.rb +47 -0
  116. data/spec/models/paginated_payments_spec.rb +47 -0
  117. data/spec/models/paginated_payout_items_spec.rb +47 -0
  118. data/spec/models/payment_addresses_spec.rb +53 -0
  119. data/spec/models/payment_balances_spec.rb +53 -0
  120. data/spec/models/payment_operation_inputs_spec.rb +65 -0
  121. data/spec/models/payment_operation_response_spec.rb +41 -0
  122. data/spec/models/payment_operation_spec.rb +71 -0
  123. data/spec/models/payment_refund_request_spec.rb +41 -0
  124. data/spec/models/payment_settle_request_spec.rb +47 -0
  125. data/spec/models/payment_spec.rb +65 -0
  126. data/spec/models/payout_item_inputs_spec.rb +53 -0
  127. data/spec/models/payout_item_spec.rb +71 -0
  128. data/spec/models/payout_spec.rb +53 -0
  129. data/spec/models/rsk_balance_spec.rb +47 -0
  130. data/spec/models/validate_checkout_request_spec.rb +59 -0
  131. data/spec/models/validate_checkout_response_spec.rb +41 -0
  132. data/spec/models/wallet_balance_spec.rb +65 -0
  133. data/spec/spec_helper.rb +111 -0
  134. metadata +180 -49
  135. data/docs/Erc20PaymentsApi.md +0 -334
  136. data/docs/EthAddress.md +0 -8
  137. data/docs/EthNetwork.md +0 -9
  138. data/docs/PaginatedWalletOperations.md +0 -8
  139. data/docs/PaginatedWallets.md +0 -8
  140. data/docs/Wallet.md +0 -13
  141. data/docs/WalletCreateInput.md +0 -9
  142. data/docs/WalletCreateOutput.md +0 -10
  143. data/docs/WalletInputs.md +0 -11
  144. data/docs/WalletOperation.md +0 -11
  145. data/docs/WalletOperationInputs.md +0 -10
  146. data/docs/WalletOperationOutput.md +0 -8
  147. data/docs/WalletRefundOperationInput.md +0 -7
  148. data/docs/WalletSettleOperationInput.md +0 -8
  149. data/lib/bleumi_pay_sdk_ruby/api/erc20_payments_api.rb +0 -482
  150. data/lib/bleumi_pay_sdk_ruby/models/eth_address.rb +0 -208
@@ -1,12 +1,12 @@
1
1
  =begin
2
- #Bleumi Pay API
2
+ #Bleumi Pay REST API
3
3
 
4
- #A simple and powerful REST API to integrate ERC20 payments into your business or application
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand payments and/or payouts into your business or application
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: info@bleumi.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.0
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
@@ -14,25 +14,29 @@ require 'date'
14
14
 
15
15
  module BleumiPay
16
16
  class WalletBalance
17
- # Address of the buyer
17
+ # Token balance for the wallet
18
18
  attr_accessor :balance
19
19
 
20
- # Address of the merchant
20
+ # Token balance for the wallet in Ethereum format
21
21
  attr_accessor :token_balance
22
22
 
23
- # Wallet Library address
23
+ # Token decimal places
24
24
  attr_accessor :token_decimals
25
25
 
26
- # Wallet Proxy address
26
+ # Block in which the balance was last updated
27
27
  attr_accessor :block_num
28
28
 
29
+ # Safety level indicator
30
+ attr_accessor :safety
31
+
29
32
  # Attribute mapping from ruby-style variable name to JSON key.
30
33
  def self.attribute_map
31
34
  {
32
35
  :'balance' => :'balance',
33
36
  :'token_balance' => :'token_balance',
34
37
  :'token_decimals' => :'token_decimals',
35
- :'block_num' => :'blockNum'
38
+ :'block_num' => :'blockNum',
39
+ :'safety' => :'safety'
36
40
  }
37
41
  end
38
42
 
@@ -42,10 +46,17 @@ module BleumiPay
42
46
  :'balance' => :'String',
43
47
  :'token_balance' => :'String',
44
48
  :'token_decimals' => :'Integer',
45
- :'block_num' => :'String'
49
+ :'block_num' => :'String',
50
+ :'safety' => :'String'
46
51
  }
47
52
  end
48
53
 
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
49
60
  # Initializes the object
50
61
  # @param [Hash] attributes Model attributes in the form of hash
51
62
  def initialize(attributes = {})
@@ -76,6 +87,10 @@ module BleumiPay
76
87
  if attributes.key?(:'block_num')
77
88
  self.block_num = attributes[:'block_num']
78
89
  end
90
+
91
+ if attributes.key?(:'safety')
92
+ self.safety = attributes[:'safety']
93
+ end
79
94
  end
80
95
 
81
96
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -98,6 +113,10 @@ module BleumiPay
98
113
  invalid_properties.push('invalid value for "block_num", block_num cannot be nil.')
99
114
  end
100
115
 
116
+ if @safety.nil?
117
+ invalid_properties.push('invalid value for "safety", safety cannot be nil.')
118
+ end
119
+
101
120
  invalid_properties
102
121
  end
103
122
 
@@ -108,6 +127,7 @@ module BleumiPay
108
127
  return false if @token_balance.nil?
109
128
  return false if @token_decimals.nil?
110
129
  return false if @block_num.nil?
130
+ return false if @safety.nil?
111
131
  true
112
132
  end
113
133
 
@@ -119,7 +139,8 @@ module BleumiPay
119
139
  balance == o.balance &&
120
140
  token_balance == o.token_balance &&
121
141
  token_decimals == o.token_decimals &&
122
- block_num == o.block_num
142
+ block_num == o.block_num &&
143
+ safety == o.safety
123
144
  end
124
145
 
125
146
  # @see the `==` method
@@ -131,7 +152,7 @@ module BleumiPay
131
152
  # Calculates hash code according to all attributes.
132
153
  # @return [Integer] Hash code
133
154
  def hash
134
- [balance, token_balance, token_decimals, block_num].hash
155
+ [balance, token_balance, token_decimals, block_num, safety].hash
135
156
  end
136
157
 
137
158
  # Builds the object from hash
@@ -220,7 +241,11 @@ module BleumiPay
220
241
  hash = {}
221
242
  self.class.attribute_map.each_pair do |attr, param|
222
243
  value = self.send(attr)
223
- next if value.nil?
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
224
249
  hash[param] = _to_hash(value)
225
250
  end
226
251
  hash
@@ -1,15 +1,15 @@
1
1
  =begin
2
- #Bleumi Pay API
2
+ #Bleumi Pay REST API
3
3
 
4
- #A simple and powerful REST API to integrate ERC20 payments into your business or application
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai, Algorand payments and/or payouts into your business or application
5
5
 
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: info@bleumi.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.0
9
+ OpenAPI Generator version: 4.2.2
10
10
 
11
11
  =end
12
12
 
13
13
  module BleumiPay
14
- VERSION = '1.0.2'
14
+ VERSION = '1.0.7'
15
15
  end
@@ -0,0 +1,39 @@
1
+ # Load the gem
2
+ require 'bleumi_pay_sdk_ruby'
3
+
4
+ # Setup authorization
5
+ BleumiPay.configure do |config|
6
+ # Configure API key authorization: ApiKeyAuth
7
+ config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
8
+ end
9
+
10
+ api_instance = BleumiPay::PayoutsApi.new
11
+
12
+ opts = {
13
+ chain: BleumiPay::Chain::GOERLI # Chain | Ethereum network in which payment is to be created.
14
+ }
15
+
16
+ create_payout_request = BleumiPay::CreatePayoutRequest.new # CreatePayoutRequest | Specify payout creation parameters.
17
+ create_payout_request = BleumiPay::CreatePayoutRequest.new # CreatePayoutRequest | Request body - used to specify payout creation parameters.
18
+ # This example shows 2 payouts being created
19
+ # Creating Payout-1
20
+ payout1 = BleumiPay::Payout.new
21
+ payout1.amount = '1' # str | Replace <PAYOUT_AMT_1> with the 1st payout's amount
22
+ payout1.transfer_address = '0x5db2d6542d55B2aEC1f10D0C0Df3B0169Bf41E41' # str | Replace <PAYOUT_ADDR_1> with the 1st payout's receiver's address
23
+ # Creating Payout-2
24
+ payout2 = BleumiPay::Payout.new
25
+ payout2.amount = '1' # str | Replace <PAYOUT_AMT_2> with the 2nd payout's amount
26
+ payout2.transfer_address = '0x195797609aDcF24b9ca3a105D221293fCA0c476F' # str | Replace <PAYOUT_ADDR_2> with the 2nd payout's receiver's address
27
+ # Creating a payouts array with both the payouts created above
28
+ payouts = [payout1, payout2]
29
+
30
+ create_payout_request.txid = '3' # str | Replace with unique payout ID
31
+ create_payout_request.token = '0x115615DbD0f835344725146Fa6343219315F15E5' # str | Replace <TOKEN> with Token. Eg. ETH or ECR-20 token contract address or XDAI or XDAIT
32
+ create_payout_request.payouts = payouts # setting the payouts array to the payout create request
33
+ begin
34
+ #Create an unique wallet address to accept payments for an ERC-20 token from a buyer
35
+ result = api_instance.create_payout(create_payout_request, opts)
36
+ p result
37
+ rescue BleumiPay::ApiError => e
38
+ puts "Exception when calling PayoutsApi->create_payout: #{e}"
39
+ end
@@ -0,0 +1,23 @@
1
+ # load the gem
2
+ require 'bleumi_pay_sdk_ruby'
3
+ # setup authorization
4
+ BleumiPay.configure do |config|
5
+ # Configure API key authorization: ApiKeyAuth
6
+ config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
7
+ end
8
+
9
+ api_instance = BleumiPay::PayoutsApi.new
10
+ opts = {
11
+ next_token: '', # String | Cursor to start results from
12
+ sort_by: 'createdAt', # String | Sort wallets by
13
+ start_at: '1577836800', # String | Get wallets from this timestamp
14
+ end_at: '' # String | Get wallets till this timestamp
15
+ }
16
+
17
+ begin
18
+ #Returns a list of wallets
19
+ result = api_instance.list_payouts(opts)
20
+ p result
21
+ rescue BleumiPay::ApiError => e
22
+ puts "Exception when calling PayoutsApi->list_payouts: #{e}"
23
+ end
@@ -0,0 +1,48 @@
1
+ # Load the gem
2
+ require 'bleumi_pay_sdk_ruby'
3
+
4
+ # Setup authorization
5
+ BleumiPay.configure do |config|
6
+ # Configure API key authorization: ApiKeyAuth
7
+ config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
8
+ end
9
+
10
+ api_instance = BleumiPay::PaymentsApi.new
11
+
12
+ create_payment_request = BleumiPay::CreatePaymentRequest.new # CreatePayoutRequest | Specify payout creation parameters.
13
+ # opts = {
14
+ # chain: BleumiPay::Chain::GOERLI # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
15
+ # }
16
+ buyer_address = '0x713883BF69B786f0A7aB6E2248a70C50577F6b34'
17
+ transfer_address = '0x5db2d6542d55B2aEC1f10D0C0Df3B0169Bf41E41'
18
+ # token = '0x115615DbD0f835344725146Fa6343219315F15E5-'
19
+
20
+ # opts = {
21
+ # chain: BleumiPay::Chain::ALG_TESTNET # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
22
+ # }
23
+ # buyer_address = 'W5XU4IWCTVBTYXSYIGJYXEPXH2O5S6RPHLF4JK25NEPYT3RACD4Z3EBS4A'
24
+ # transfer_address = 'CQRMTAHZJA3SIEOTEMZXCAIZKUWE2CCLBCFYQI4NINU43IOTEWT4LOT4IY'
25
+
26
+ # RSK
27
+ # USD p18 - 0xB3A4A821434bDFbE55872C240D3888c412c68B9B
28
+ # USD p6 - 0xb9F624160Bb2755aa25366cc307ED27e39A4f296
29
+ # USD p2 - 0x1efEaBf46Ca3270A9a41D324350692664f1eA105
30
+ # EUR p2 - 0xd7a5c209194AC2E8e3E6Ca1dbF3C55484adb06e1
31
+ # Chain: RSK_TESTNET
32
+ token = '0xb9F624160Bb2755aa25366cc307ED27e39A4f296'
33
+ opts = {
34
+ chain: BleumiPay::Chain::RSK_TESTNET # Chain | RSK network in which payment is to be created. Please refer documentation for Supported Networks
35
+ }
36
+
37
+ create_payment_request.id = '16'
38
+ create_payment_request.buyer_address = buyer_address
39
+ create_payment_request.transfer_address = transfer_address
40
+ create_payment_request.token = token
41
+
42
+ begin
43
+ #Create an unique wallet address to accept payments for an ERC-20 token from a buyer
44
+ result = api_instance.create_payment(create_payment_request, opts)
45
+ p result
46
+ rescue BleumiPay::ApiError => e
47
+ puts "Exception when calling create_payment: #{e}"
48
+ end
@@ -0,0 +1,18 @@
1
+ # load the gem
2
+ require 'bleumi_pay_sdk_ruby'
3
+ # setup authorization
4
+ BleumiPay.configure do |config|
5
+ # Configure API key authorization: ApiKeyAuth
6
+ config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
7
+ end
8
+
9
+ api_instance = BleumiPay::PaymentsApi.new
10
+ id = '16' # String | Unique ID identifying the wallet in your system
11
+
12
+ begin
13
+ #Return a specific wallet
14
+ result = api_instance.get_payment(id)
15
+ p result
16
+ rescue BleumiPay::ApiError => e
17
+ puts "Exception when calling PaymentsApi->get_payment: #{e}"
18
+ end
@@ -0,0 +1,19 @@
1
+ # load the gem
2
+ require 'bleumi_pay_sdk_ruby'
3
+ # setup authorization
4
+ BleumiPay.configure do |config|
5
+ # Configure API key authorization: ApiKeyAuth
6
+ config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
7
+ end
8
+
9
+ api_instance = BleumiPay::PaymentsApi.new
10
+ id = '16' # String | Unique ID identifying the wallet in your system
11
+ txid = '1580382159243' # String | ID of a specific operation of the wallet
12
+
13
+ begin
14
+ #Return a specific operation of the wallet
15
+ result = api_instance.get_payment_operation(id, txid)
16
+ p result
17
+ rescue BleumiPay::ApiError => e
18
+ puts "Exception when calling PaymentsApi->get_payment_operation: #{e}"
19
+ end
@@ -0,0 +1,24 @@
1
+ # load the gem
2
+ require 'bleumi_pay_sdk_ruby'
3
+ # setup authorization
4
+ BleumiPay.configure do |config|
5
+ # Configure API key authorization: ApiKeyAuth
6
+ config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
7
+ end
8
+
9
+ api_instance = BleumiPay::PaymentsApi.new
10
+ opts = {
11
+ next_token: '', # String | Cursor to start results from. Eg. Cm0KEwoJY3JlYXRlZEF0EgYI/IjA8QUSUmoQc35wYXktZGV2LTIzNTkxMXI+CxIHQWNjb3VudCIkVWxvbTNlaVZaTFhqR3gyYWxCcnhDOG13UWx6MXxzYW5kYm94DAsSBldhbGxldCIBOQwYACAA
12
+ sort_by: 'createdAt', # String | Sort payments by
13
+ sort_order: 'ascending', # String | Sort Order for payments
14
+ start_at: '1577836800', # String | Get payments from this timestamp
15
+ end_at: nil # String | Get payments till this timestamp
16
+ }
17
+
18
+ begin
19
+ #Returns a list of wallets
20
+ result = api_instance.list_payments(opts)
21
+ p result
22
+ rescue BleumiPay::ApiError => e
23
+ puts "Exception when calling list_payments: #{e}"
24
+ end
@@ -0,0 +1,21 @@
1
+ # load the gem
2
+ require 'bleumi_pay_sdk_ruby'
3
+ # setup authorization
4
+ BleumiPay.configure do |config|
5
+ # Configure API key authorization: ApiKeyAuth
6
+ config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
7
+ end
8
+
9
+ api_instance = BleumiPay::PaymentsApi.new
10
+ id = '16' # String | Unique ID identifying the wallet in your system
11
+ opts = {
12
+ next_token: '' # String | Cursor to start results from
13
+ }
14
+
15
+ begin
16
+ #Return the list of operations performed by the mechant on a specific wallet
17
+ result = api_instance.list_payment_operations(id, opts)
18
+ p result
19
+ rescue BleumiPay::ApiError => e
20
+ puts "Exception when calling list_payment_operations: #{e}"
21
+ end
@@ -0,0 +1,43 @@
1
+ # load the gem
2
+ require 'bleumi_pay_sdk_ruby'
3
+ # setup authorization
4
+ BleumiPay.configure do |config|
5
+ # Configure API key authorization: ApiKeyAuth
6
+ config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
7
+ end
8
+
9
+ api_instance = BleumiPay::PaymentsApi.new
10
+ id = '16' # String | Unique ID identifying this record in your system
11
+
12
+ # opts = {
13
+ # chain: BleumiPay::Chain::GOERLI # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
14
+ # }
15
+ # refundTokenAddresss = '0x115615DbD0f835344725146Fa6343219315F15E5'
16
+
17
+ # opts = {
18
+ # chain: BleumiPay::Chain::ALG_TESTNET # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
19
+ # }
20
+ # refundTokenAddresss = 'ALGO'
21
+
22
+ # RSK
23
+ # USD p18 - 0xB3A4A821434bDFbE55872C240D3888c412c68B9B
24
+ # USD p6 - 0xb9F624160Bb2755aa25366cc307ED27e39A4f296
25
+ # USD p2 - 0x1efEaBf46Ca3270A9a41D324350692664f1eA105
26
+ # EUR p2 - 0xd7a5c209194AC2E8e3E6Ca1dbF3C55484adb06e1
27
+ # Chain: RSK_TESTNET
28
+ refundTokenAddresss = '0xb9F624160Bb2755aa25366cc307ED27e39A4f296'
29
+ opts = {
30
+ chain: BleumiPay::Chain::RSK_TESTNET # Chain | RSK network in which payment is to be created. Please refer documentation for Supported Networks
31
+ }
32
+
33
+ payment_refund_request = BleumiPay::PaymentRefundRequest.new # PaymentRefundRequest | Request body - used to specify the token to refund.
34
+
35
+ payment_refund_request.token = refundTokenAddresss
36
+
37
+ begin
38
+ #Refund wallet
39
+ result = api_instance.refund_payment(id, payment_refund_request, opts)
40
+ p result
41
+ rescue BleumiPay::ApiError => e
42
+ puts "Exception when calling PaymentsApi->refund_payment: #{e}"
43
+ end
@@ -0,0 +1,43 @@
1
+ # load the gem
2
+ require 'bleumi_pay_sdk_ruby'
3
+ # setup authorization
4
+ BleumiPay.configure do |config|
5
+ # Configure API key authorization: ApiKeyAuth
6
+ config.api_key['x-api-key'] = 'gCix0pemxoUt76Ufef16jwvbV6cC7H60HdryEJj0'
7
+ end
8
+
9
+ api_instance = BleumiPay::PaymentsApi.new
10
+ id = '17' # String | Unique ID identifying this record in your system
11
+ # opts = {
12
+ # chain: BleumiPay::Chain::GOERLI # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
13
+ # }
14
+ # settleToken = '0x115615DbD0f835344725146Fa6343219315F15E5'
15
+
16
+ # opts = {
17
+ # chain: BleumiPay::Chain::ALG_TESTNET # Chain | Ethereum network in which payment is to be created. Please refer documentation for Supported Networks
18
+ # }
19
+ # settleToken = 'ALGO'
20
+
21
+ # RSK
22
+ # USD p18 - 0xB3A4A821434bDFbE55872C240D3888c412c68B9B
23
+ # USD p6 - 0xb9F624160Bb2755aa25366cc307ED27e39A4f296
24
+ # USD p2 - 0x1efEaBf46Ca3270A9a41D324350692664f1eA105
25
+ # EUR p2 - 0xd7a5c209194AC2E8e3E6Ca1dbF3C55484adb06e1
26
+ # Chain: RSK_TESTNET
27
+ settleToken = '0xb9F624160Bb2755aa25366cc307ED27e39A4f296'
28
+ opts = {
29
+ chain: BleumiPay::Chain::RSK_TESTNET # Chain | RSK network in which payment is to be created. Please refer documentation for Supported Networks
30
+ }
31
+
32
+
33
+ payment_settle_request = BleumiPay::PaymentSettleRequest.new # WalletSettleOperationInput | Request body - used to specify the amount to settle.
34
+ payment_settle_request.amount = '10'
35
+ payment_settle_request.token = settleToken
36
+
37
+ begin
38
+ #Settle a wallet, amount received will be transferred even if less than payment amount
39
+ result = api_instance.settle_payment(id, payment_settle_request, opts)
40
+ p result
41
+ rescue BleumiPay::ApiError => e
42
+ puts "Exception when calling PaymentsApi->settle_payment: #{e}"
43
+ end
@@ -0,0 +1,67 @@
1
+ =begin
2
+ #Bleumi Pay API
3
+
4
+ #A simple and powerful REST API to integrate ERC-20, Ethereum, xDai payments and/or payouts into your business or application
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: info@bleumi.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.2
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for BleumiPay::HostedCheckoutsApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'HostedCheckoutsApi' do
20
+ before do
21
+ # run before each test
22
+ @api_instance = BleumiPay::HostedCheckoutsApi.new
23
+ end
24
+
25
+ after do
26
+ # run after each test
27
+ end
28
+
29
+ describe 'test an instance of HostedCheckoutsApi' do
30
+ it 'should create an instance of HostedCheckoutsApi' do
31
+ expect(@api_instance).to be_instance_of(BleumiPay::HostedCheckoutsApi)
32
+ end
33
+ end
34
+
35
+ # unit tests for create_checkout_url
36
+ # Generate a unique checkout URL to accept payment.
37
+ # @param create_checkout_url_request Specify checkout URL creation parameters.
38
+ # @param [Hash] opts the optional parameters
39
+ # @return [CreateCheckoutUrlResponse]
40
+ describe 'create_checkout_url test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ # unit tests for list_tokens
47
+ # Retrieve all tokens configured for the Hosted Checkout in your account in the Bleumi Pay Dashboard.
48
+ # @param [Hash] opts the optional parameters
49
+ # @return [Array<CheckoutToken>]
50
+ describe 'list_tokens test' do
51
+ it 'should work' do
52
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
53
+ end
54
+ end
55
+
56
+ # unit tests for validate_checkout_payment
57
+ # Validate the GET parameters passed by Hosted Checkout in successUrl upon successfully completing payment.
58
+ # @param validate_checkout_request Specify validation of checkout parameters.
59
+ # @param [Hash] opts the optional parameters
60
+ # @return [ValidateCheckoutResponse]
61
+ describe 'validate_checkout_payment test' do
62
+ it 'should work' do
63
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
64
+ end
65
+ end
66
+
67
+ end