{"id":25846425,"url":"https://github.com/snkrheadz/omise_test_cards","last_synced_at":"2025-10-17T12:32:09.617Z","repository":{"id":56886305,"uuid":"84531812","full_name":"snkrheadz/omise_test_cards","owner":"snkrheadz","description":"A set of common test cards for omise api in test mode.","archived":false,"fork":false,"pushed_at":"2017-04-17T13:42:16.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-11T13:36:42.466Z","etag":null,"topics":["omise","omise-test-cards","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/snkrheadz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-10T07:25:48.000Z","updated_at":"2024-01-04T08:58:35.000Z","dependencies_parsed_at":"2022-08-21T00:50:15.612Z","dependency_job_id":null,"html_url":"https://github.com/snkrheadz/omise_test_cards","commit_stats":null,"previous_names":["akinrt/omise_test_cards"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/snkrheadz/omise_test_cards","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snkrheadz%2Fomise_test_cards","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snkrheadz%2Fomise_test_cards/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snkrheadz%2Fomise_test_cards/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snkrheadz%2Fomise_test_cards/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snkrheadz","download_url":"https://codeload.github.com/snkrheadz/omise_test_cards/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snkrheadz%2Fomise_test_cards/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264958623,"owners_count":23689035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["omise","omise-test-cards","ruby","ruby-gem"],"created_at":"2025-03-01T09:29:32.777Z","updated_at":"2025-10-17T12:32:04.580Z","avatar_url":"https://github.com/snkrheadz.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OmiseTestCards\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'omise_test_cards'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install omise_test_cards\n\n## Usage\n\nYou can get omise test cards collection set of an instance of Hashie::Mash by `OmiseTestCards.test_cards` .\n\nRegarding to omise website [Tests](https://www.omise.co/api-testing) , there are 10 types of test card set by now( 2017-03-10 16:36:25 +0900 ) .\n\n```ruby\ncards = OmiseTestCards.test_cards\n\ncards.successful_charge\ncards.invalid_security_code\ncards.fail_3ds_card_enrollment\ncards.fail_3ds_card_validation\ncards.insufficient_fund\ncards.stolen_or_lost_card\ncards.failed_processing\ncards.payment_rejected\ncards.failed_fraud_check\ncards.invalid_account_number\n```\n\nSee how to refer successful charge test cards below.\n\n```ruby\ncards = OmiseTestCards.test_cards\n\ncards.successful_charge.code\n# =\u003e \"successful_charge\"\n\ncards.successful_charge.description\n# =\u003e \"these credit card numbers can be used in test mode\"\n\ncards.successful_charge.cards\n# =\u003e \u003cHashie::Array [#\u003cHashie::Mash brand=\"Visa\" number=\"4242424242424242\"\u003e, #\u003cHashie::Mash brand=\"Visa\" number=\"4111111111111111\"\u003e, #\u003cHashie::Mash brand=\"MasterCard\" number=\"5555555555554444\"\u003e, #\u003cHashie::Mash brand=\"MasterCard\" number=\"5454545454545454\"\u003e, #\u003cHashie::Mash brand=\"JCB\" number=\"3530111333300000\"\u003e, #\u003cHashie::Mash brand=\"JCB\" number=\"3566111111111113\"\u003e]\u003e\n\ncards.successful_charge.cards.first.brand\n# =\u003e \"Visa\"\n\ncards.successful_charge.cards.first.number\n# =\u003e \"4242424242424242\"\n```\n\n## Quick Start\n\nThis is a simple way to test charge on test mode.\n\n```ruby\nrequire \"omise\"\nrequire \"omise_test_cards\"\n\nOmise.api_key = \"SET_YOUR_TEST_SECRET_KEY\"\nOmise.vault_key = \"SET_YOUR_TEST_PUBLIC_KEY\"\n\n# get a sample card\nsampel_card = OmiseTestCards.test_cards.successful_charge.cards.first\n\nbegin\n  # create token\n  token = Omise::Token.create(card: {\n    name: \"TARO OMISE\",\n    number: sampel_card.number,\n    expiration_month: 3,\n    expiration_year: 2019,\n    city: \"Tokyo\",\n    postal_code: \"1510051\",\n    security_code: 123\n  })\n\n  # Charge 100000 JPY\n  charge = Omise::Charge.create({\n    amount: 100_000,\n    currency: \"jpy\",\n    card: token.id\n  })\n\n  if charge.paid\n    # handle success\n    puts \"thanks\"\n  else\n    # handle failure\n    raise charge.failure_code\n  end\nrescue OmiseError =\u003e e\n  # handle OmiseError raised by omise library\n  raise e.message\nend\n```\n\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/akinrt/omise_test_cards. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnkrheadz%2Fomise_test_cards","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnkrheadz%2Fomise_test_cards","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnkrheadz%2Fomise_test_cards/lists"}