Class: TestVeritrans
- Inherits:
-
Minitest::Test
- Object
- Minitest::Test
- TestVeritrans
- Defined in:
- lib/test/api_test.rb,
lib/test/snap_test.rb,
lib/test/config_test.rb,
lib/test/transaction_test.rb,
lib/test/subscription_test.rb,
lib/test/gopay_tokenization_test.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_api_host ⇒ Object
- #test_approve_transaction ⇒ Object
- #test_cancel_permata_va ⇒ Object
- #test_charge_akulaku ⇒ Object
- #test_charge_alfamart ⇒ Object
- #test_charge_bca_va ⇒ Object
- #test_charge_bcaklikpay ⇒ Object
- #test_charge_bni_va ⇒ Object
- #test_charge_cimb_clicks ⇒ Object
- #test_charge_credit_card ⇒ Object
- #test_charge_danamon_online ⇒ Object
- #test_charge_epay_bri ⇒ Object
- #test_charge_gopay ⇒ Object
- #test_charge_indomaret ⇒ Object
- #test_charge_mandiri_bill ⇒ Object
- #test_charge_permata_va ⇒ Object
- #test_client_key_server_key ⇒ Object
- #test_create_snap_token_string ⇒ Object
- #test_create_subscription ⇒ Object
- #test_create_widget_token ⇒ Object
- #test_deny_transaction ⇒ Object
- #test_disable_subscription ⇒ Object
- #test_disable_subscription_none ⇒ Object
- #test_enable_subscription ⇒ Object
- #test_enable_subscription_none ⇒ Object
- #test_expire_permata_va ⇒ Object
- #test_fail_charge_invalid_key ⇒ Object
- #test_fail_get_token ⇒ Object
- #test_fail_refund_transaction ⇒ Object
- #test_get_payment_acc_dummy ⇒ Object
- #test_get_payment_account ⇒ Object
- #test_get_status_transaction ⇒ Object
- #test_get_subscription ⇒ Object
- #test_get_subscription_none_acc ⇒ Object
- #test_get_token_credit_card ⇒ Object
- #test_link_payment_account ⇒ Object
- #test_point_inquiry ⇒ Object
- #test_snap_invalid_serverkey ⇒ Object
- #test_snap_redirect_url_str ⇒ Object
- #test_unlink_dummy_account ⇒ Object
- #test_unlink_payment_account ⇒ Object
- #test_update_subscription ⇒ Object
- #test_update_subscription_none ⇒ Object
Instance Method Details
#setup ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/test/api_test.rb', line 6 def setup @mt_test = Veritrans.new( server_key: "SB-Mid-server-uQmMImQMeo0Ky3Svl90QTUj2", client_key: "SB-Mid-client-ArNfhrh7st9bQKmz", api_host: "https://api.sandbox.midtrans.com", logger: Logger.new(STDOUT), file_logger: Logger.new(STDOUT) ) @mt_test_invalid_key = Veritrans.new( server_key: "invalid server key", client_key: "invalid client key", api_host: "https://api.sandbox.midtrans.com", logger: Logger.new(STDOUT), file_logger: Logger.new(STDOUT) ) end |
#test_api_host ⇒ Object
15 16 17 |
# File 'lib/test/config_test.rb', line 15 def test_api_host assert_equal "https://api.sandbox.midtrans.com", Veritrans.config.api_host end |
#test_approve_transaction ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/test/transaction_test.rb', line 93 def test_approve_transaction card = { card_number: 5510111111111115, card_cvv: 123, card_exp_month: 12, card_exp_year: 2025 } get_token = @mt_test.test_token(card) charge = @mt_test.charge( { "payment_type": "credit_card", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-#{Time.now.to_i}" }, "credit_card": { "token_id": "#{get_token.token_id}", "authentication": "false" } } ) result = @mt_test.approve(charge.transaction_id) assert_equal "Success, transaction is approved", result. assert_equal 200, result.status_code assert_equal "accept", result.fraud_status end |
#test_cancel_permata_va ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/test/transaction_test.rb', line 35 def test_cancel_permata_va charge = @mt_test.charge( { "payment_type": "bank_transfer", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-#{Time.now.to_i}" }, "bank_transfer": { "bank": "permata", "va_number": "1234567891" } } ) cancel = @mt_test.cancel(charge.transaction_id) assert_equal 200, cancel.status_code assert_equal "cancel", cancel.transaction_status end |
#test_charge_akulaku ⇒ Object
228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/test/api_test.rb', line 228 def test_charge_akulaku result = @mt_test.charge( "payment_type": "akulaku", "transaction_details": { "order_id": "ruby-lib-test-#{Time.now.to_i}", "gross_amount": 44000 } ) assert_equal 201, result.status_code assert_equal "Success, Akulaku transaction is created", result. assert_equal "pending", result.transaction_status end |
#test_charge_alfamart ⇒ Object
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/test/api_test.rb', line 175 def test_charge_alfamart result = @mt_test.charge( "payment_type": "cstore", "transaction_details": { "order_id": "ruby-lib-test-alfamart-#{Time.now.to_i}", "gross_amount": 44000 }, "cstore": { "store": "alfamart", "alfamart_free_text_1": "1st row of receipt", "alfamart_free_text_2": "2nd row", "alfamart_free_text_3": "3rd row" } ) assert_equal 201, result.status_code assert_equal "Success, cstore transaction is successful", result. assert_equal "alfamart", result.store end |
#test_charge_bca_va ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/test/api_test.rb', line 61 def test_charge_bca_va result = @mt_test.charge( { "payment_type": "bank_transfer", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-bcava#{Time.now.to_i}" }, "bank_transfer": { "bank": "bca", "va_number": "1234567891" } } ) assert_equal 201, result.status_code assert_equal "Success, Bank Transfer transaction is created", result. end |
#test_charge_bcaklikpay ⇒ Object
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/test/api_test.rb', line 211 def test_charge_bcaklikpay result = @mt_test.charge( "payment_type": "bca_klikpay", "transaction_details": { "order_id": "ruby-lib-test-bcaklikpay-#{Time.now.to_i}", "gross_amount": 44000 }, "bca_klikpay": { "type": "1", "description": "pembelian produk" } ) assert_equal 201, result.status_code assert_equal "OK, BCA KlikPay transaction is successful", result. assert_equal "pending", result.transaction_status end |
#test_charge_bni_va ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/test/api_test.rb', line 79 def test_charge_bni_va result = @mt_test.charge( { "payment_type": "bank_transfer", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-bniva-#{Time.now.to_i}" }, "bank_transfer": { "bank": "bni", "va_number": "1234567891" } } ) assert_equal 201, result.status_code assert_equal "Success, Bank Transfer transaction is created", result. end |
#test_charge_cimb_clicks ⇒ Object
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
# File 'lib/test/api_test.rb', line 109 def test_charge_cimb_clicks result = @mt_test.charge( { "payment_type": "cimb_clicks", "transaction_details": { "order_id": "ruby-lib-test-cimbclicks-#{Time.now.to_i}", "gross_amount": 44000 }, "cimb_clicks": { "description": "Purchase of a Food Delivery" } } ) assert_equal 201, result.status_code assert_equal "Success, CIMB Clicks transaction is successful", result. end |
#test_charge_credit_card ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/test/api_test.rb', line 36 def test_charge_credit_card card = { card_number: 5211111111111117, card_cvv: 123, card_exp_month: 12, card_exp_year: 2025 } get_token = @mt_test.test_token(card) result = @mt_test.charge( { "payment_type": "credit_card", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-creditcard-#{Time.now.to_i}" }, "credit_card": { "token_id": "#{get_token.token_id}" } } ) assert_equal "Success, Credit Card transaction is successful", result. assert_equal 200, result.status_code assert_equal "Approved", result. end |
#test_charge_danamon_online ⇒ Object
241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/test/api_test.rb', line 241 def test_charge_danamon_online result = @mt_test.charge( "payment_type": "danamon_online", "transaction_details": { "order_id": "ruby-lib-test-#{Time.now.to_i}", "gross_amount": 44000 } ) assert_equal "Success, Danamon Online transaction is successful", result. assert_equal 201, result.status_code assert_equal "pending", result.transaction_status end |
#test_charge_epay_bri ⇒ Object
126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/test/api_test.rb', line 126 def test_charge_epay_bri result = @mt_test.charge( { "payment_type": "bri_epay", "transaction_details": { "order_id": "ruby-lib-test-epaybri-#{Time.now.to_i}", "gross_amount": 44000 } } ) assert_equal 201, result.status_code assert_equal "Success, BRI E-Pay transaction is successful", result. assert_equal "pending", result.transaction_status end |
#test_charge_gopay ⇒ Object
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/test/api_test.rb', line 194 def test_charge_gopay result = @mt_test.charge( "payment_type": "gopay", "transaction_details": { "order_id": "ruby-lib-test-gopay-#{Time.now.to_i}", "gross_amount": 44000 }, "gopay": { "enable_callback": "true", "callback_url": "someapps://callback" } ) assert_equal 201, result.status_code assert_equal "GoPay transaction is created", result. assert_equal "pending", result.transaction_status end |
#test_charge_indomaret ⇒ Object
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/test/api_test.rb', line 158 def test_charge_indomaret result = @mt_test.charge( "payment_type": "cstore", "transaction_details": { "order_id": "ruby-lib-test-indomaret-#{Time.now.to_i}", "gross_amount": 44000 }, "cstore": { "store": "Indomaret", "message": "Message to display" } ) assert_equal 201, result.status_code assert_equal "Success, cstore transaction is successful", result. assert_equal "indomaret", result.store end |
#test_charge_mandiri_bill ⇒ Object
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/test/api_test.rb', line 141 def test_charge_mandiri_bill result = @mt_test.charge( "payment_type": "echannel", "transaction_details": { "order_id": "ruby-lib-test-mandiribill-#{Time.now.to_i}", "gross_amount": 44000 }, "echannel": { "bill_info1": "Payment for:", "bill_info2": "Item descriptions" } ) assert_equal 201, result.status_code assert_equal "OK, Mandiri Bill transaction is successful", result. assert_equal "pending", result.transaction_status end |
#test_charge_permata_va ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/test/transaction_test.rb', line 16 def test_charge_permata_va result = @mt_test.charge( { "payment_type": "bank_transfer", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-#{Time.now.to_i}" }, "bank_transfer": { "bank": "permata", "va_number": "1234567891" } } ) assert_equal 201, result.status_code assert_equal "pending", result.transaction_status assert_equal "Success, PERMATA VA transaction is successful", result. end |
#test_client_key_server_key ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/test/config_test.rb', line 19 def test_client_key_server_key Veritrans.config.client_key = "kk-1" Veritrans.config.server_key = "sk-1" assert_equal "kk-1", Veritrans.config.client_key assert_equal "sk-1", Veritrans.config.server_key end |
#test_create_snap_token_string ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/test/snap_test.rb', line 29 def test_create_snap_token_string result = @mt_test.create_snap_token_string( transaction_details: { order_id: "ruby-lib-test-snap-#{Time.now.to_i}", gross_amount: 200000 }, "credit_card": { "secure": true } ) assert result != nil end |
#test_create_subscription ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/test/subscription_test.rb', line 17 def test_create_subscription p 1 param = { "name": "MONTHLY_2021", "amount": "17000", "currency": "IDR", "payment_type": "credit_card", "token": "dummy", "schedule": { "interval": 1, "interval_unit": "month", "max_interval": 12, "start_time": "2022-10-10 07:25:01 +0700" }, "metadata": { "description": "Recurring payment for A" }, "customer_details": { "first_name": "John", "last_name": "Doe", "email": "[email protected]", "phone": "+62812345678" } } result = @mt_test.create_subscription(param) assert_equal 200, result.status $testsubsid = result.id end |
#test_create_widget_token ⇒ Object
254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/test/api_test.rb', line 254 def result = @mt_test.( transaction_details: { order_id: "ruby-lib-test-#{Time.now.to_i}", gross_amount: 200000 }, "credit_card": { "secure": true } ) assert_equal 201, result.status_code end |
#test_deny_transaction ⇒ Object
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/test/transaction_test.rb', line 120 def test_deny_transaction card = { card_number: 5510111111111115, card_cvv: 123, card_exp_month: 12, card_exp_year: 2025 } get_token = @mt_test.test_token(card) charge = @mt_test.charge( { "payment_type": "credit_card", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-#{Time.now.to_i}" }, "credit_card": { "token_id": "#{get_token.token_id}", "authentication": "false" } } ) result = @mt_test.deny(charge.transaction_id) assert_equal 200, result.status_code assert_equal "Success, transaction is denied", result. assert_equal "deny", result.fraud_status end |
#test_disable_subscription ⇒ Object
52 53 54 55 56 |
# File 'lib/test/subscription_test.rb', line 52 def test_disable_subscription p 3 result = @mt_test.disable_subscription($testsubsid) assert_equal "Subscription is updated.", result. end |
#test_disable_subscription_none ⇒ Object
88 89 90 91 92 93 94 95 |
# File 'lib/test/subscription_test.rb', line 88 def test_disable_subscription_none begin @mt_test.disable_subscription("dummy") rescue MidtransError => e assert_equal "404", e.status assert_match "Subscription doesn't exist.", e.data end end |
#test_enable_subscription ⇒ Object
58 59 60 61 62 |
# File 'lib/test/subscription_test.rb', line 58 def test_enable_subscription p 4 result = @mt_test.enable_subscription($testsubsid) assert_equal "Subscription is updated.", result. end |
#test_enable_subscription_none ⇒ Object
97 98 99 100 101 102 103 104 |
# File 'lib/test/subscription_test.rb', line 97 def test_enable_subscription_none begin @mt_test.enable_subscription("dummy") rescue MidtransError => e assert_equal "404", e.status assert_match "Subscription doesn't exist.", e.data end end |
#test_expire_permata_va ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/test/transaction_test.rb', line 54 def test_expire_permata_va charge = @mt_test.charge( { "payment_type": "bank_transfer", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-#{Time.now.to_i}" }, "bank_transfer": { "bank": "permata", "va_number": "1234567891" } } ) expire = @mt_test.expire(charge.transaction_id) assert_equal "Success, transaction has expired", expire. assert_equal 407, expire.status_code assert_equal "expire", expire.transaction_status end |
#test_fail_charge_invalid_key ⇒ Object
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/test/api_test.rb', line 267 def test_fail_charge_invalid_key @mt_test_invalid_key = Veritrans.new( server_key: "invalid server key", client_key: "invalid client key", api_host: "https://api.sandbox.midtrans.com", logger: Logger.new(STDOUT), file_logger: Logger.new(STDOUT) ) begin @mt_test_invalid_key.charge( { "payment_type": "bank_transfer", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-bcava-#{Time.now.to_i}" }, "bank_transfer": { "bank": "bca", "va_number": "1234567891" } } ) rescue MidtransError => e assert_equal "401", e.status assert_match "Transaction cannot be authorized with the current client/server key.", e.data end end |
#test_fail_get_token ⇒ Object
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
# File 'lib/test/api_test.rb', line 296 def test_fail_get_token @mt_test_invalid_key = Veritrans.new( server_key: "invalid server key", client_key: "invalid client key", api_host: "https://api.sandbox.midtrans.com", logger: Logger.new(STDOUT), file_logger: Logger.new(STDOUT) ) card = { card_number: 4617006959746656, card_cvv: 123, card_exp_month: 12, card_exp_year: 2026 } begin @mt_test_invalid_key.test_token(card) rescue MidtransError => e assert_equal "401", e.status assert_match "Transaction cannot be authorized with the current client/server key.", e.data end end |
#test_fail_refund_transaction ⇒ Object
147 148 149 150 151 152 153 154 155 156 157 158 |
# File 'lib/test/transaction_test.rb', line 147 def test_fail_refund_transaction begin param = { "refund_key": "reference1", "amount": 5000, "reason": "for some reason" } @mt_test.refund("dummy-order-id", param) rescue MidtransError => e assert_equal "404", e.status end end |
#test_get_payment_acc_dummy ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'lib/test/gopay_tokenization_test.rb', line 60 def test_get_payment_acc_dummy p 4 begin @mt_test.get_payment_account("dummy") rescue MidtransError => e assert_equal "404", e.status assert_match "Account doesn't exist.", e.data end end |
#test_get_payment_account ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/test/gopay_tokenization_test.rb', line 33 def test_get_payment_account p 2 param = { "payment_type": "gopay", "gopay_partner": { "phone_number": "81987654321", "country_code": "62", "redirect_url": "https://www.gojek.com" } } charge = @mt_test.link_payment_account(param) result = @mt_test.get_payment_account(charge.account_id) assert_equal 201, result.status_code assert_equal "PENDING", result.account_status end |
#test_get_status_transaction ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/test/transaction_test.rb', line 74 def test_get_status_transaction charge = @mt_test.charge( { "payment_type": "bank_transfer", "transaction_details": { "gross_amount": 10000, "order_id": "ruby-lib-test-#{Time.now.to_i}" }, "bank_transfer": { "bank": "permata", "va_number": "1234567891" } } ) result = @mt_test.status(charge.transaction_id) assert_equal 201, result.status_code assert_equal "Success, transaction is found", result. end |
#test_get_subscription ⇒ Object
46 47 48 49 50 |
# File 'lib/test/subscription_test.rb', line 46 def test_get_subscription p 2 result = @mt_test.get_subscription($testsubsid) assert_equal 200, result.status end |
#test_get_subscription_none_acc ⇒ Object
79 80 81 82 83 84 85 86 |
# File 'lib/test/subscription_test.rb', line 79 def test_get_subscription_none_acc begin @mt_test.get_subscription("dummy") rescue MidtransError => e assert_equal "404", e.status assert_match "Subscription doesn't exist.", e.data end end |
#test_get_token_credit_card ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/test/api_test.rb', line 24 def test_get_token_credit_card card = { card_number: 4811111111111114, card_cvv: 123, card_exp_month: 12, card_exp_year: 2025 } result = @mt_test.test_token(card) assert_equal 200, result.status_code assert_equal "Credit card token is created as Token ID.", result. end |
#test_link_payment_account ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/test/gopay_tokenization_test.rb', line 17 def test_link_payment_account p 1 param = { "payment_type": "gopay", "gopay_partner": { "phone_number": "81987654321", "country_code": "62", "redirect_url": "https://www.gojek.com" } } result = @mt_test.link_payment_account(param) assert_equal 201, result.status_code assert_equal "PENDING", result.account_status $test_gopay_id = result.account_id end |
#test_point_inquiry ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/test/api_test.rb', line 97 def test_point_inquiry card = { card_number: 4617006959746656, card_cvv: 123, card_exp_month: 12, card_exp_year: 2026 } result = @mt_test.test_token(card) card_point_response = @mt_test.point_inquiry(result.token_id) assert_equal 200, card_point_response.status_code end |
#test_snap_invalid_serverkey ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/test/snap_test.rb', line 55 def test_snap_invalid_serverkey @mt_test_invalid_key = Veritrans.new( server_key: "invalid server key", client_key: "invalid client key", api_host: "https://api.sandbox.midtrans.com", logger: Logger.new(STDOUT), file_logger: Logger.new(STDOUT) ) begin @mt_test_invalid_key.( transaction_details: { order_id: "ruby-lib-test-#{Time.now.to_i}", gross_amount: 200000 }, "credit_card": { "secure": true } ) rescue MidtransError => e assert_equal "401", e.status assert_match "please check client or server key", e.data end end |
#test_snap_redirect_url_str ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/test/snap_test.rb', line 42 def test_snap_redirect_url_str result = @mt_test.create_snap_redirect_url_str( transaction_details: { order_id: "ruby-lib-test-snap#{Time.now.to_i}", gross_amount: 200000 }, "credit_card": { "secure": true } ) assert_match "https://", result end |
#test_unlink_dummy_account ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'lib/test/gopay_tokenization_test.rb', line 70 def test_unlink_dummy_account p 5 begin @mt_test.unlink_payment_account("dummy") rescue MidtransError => e assert_equal "404", e.status assert_match "Account doesn't exist.", e.data end end |
#test_unlink_payment_account ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/test/gopay_tokenization_test.rb', line 49 def test_unlink_payment_account #expected the API call will fail because of not click activation from link_payment_account p 3 begin @mt_test.unlink_payment_account($test_gopay_id) rescue MidtransError => e assert_equal "412", e.status assert_match "Account status cannot be updated.", e.data end end |
#test_update_subscription ⇒ Object
64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/test/subscription_test.rb', line 64 def test_update_subscription p 5 param = { "name": "MONTHLY_2021", "amount": "21000", "currency": "IDR", "token": "dummy", "schedule": { "interval": 1 } } result = @mt_test.update_subscription($testsubsid, param) assert_equal "Subscription is updated.", result. end |
#test_update_subscription_none ⇒ Object
106 107 108 109 110 111 112 113 114 |
# File 'lib/test/subscription_test.rb', line 106 def test_update_subscription_none begin param = {} @mt_test.update_subscription("dummy", param) rescue MidtransError => e assert_equal "404", e.status assert_match "Subscription doesn't exist.", e.data end end |