{"id":21878273,"url":"https://github.com/pepabo/active_merchant-epsilon","last_synced_at":"2025-08-21T00:31:07.574Z","repository":{"id":20576712,"uuid":"23857194","full_name":"pepabo/active_merchant-epsilon","owner":"pepabo","description":"Epsilon integration for ActiveMerchant.","archived":false,"fork":false,"pushed_at":"2025-05-15T03:27:27.000Z","size":380,"stargazers_count":26,"open_issues_count":3,"forks_count":12,"subscribers_count":175,"default_branch":"master","last_synced_at":"2025-08-09T19:52:28.020Z","etag":null,"topics":["activemerchant","ruby","rubygems"],"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/pepabo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-09-10T02:02:52.000Z","updated_at":"2025-05-15T03:27:31.000Z","dependencies_parsed_at":"2025-05-15T04:23:16.406Z","dependency_job_id":"f2278972-38c7-4cbd-adb1-817d78d69c60","html_url":"https://github.com/pepabo/active_merchant-epsilon","commit_stats":{"total_commits":381,"total_committers":21,"mean_commits":"18.142857142857142","dds":0.6771653543307087,"last_synced_commit":"c1f88dc2b8046df32f5525972cba3a825d9bce91"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/pepabo/active_merchant-epsilon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Factive_merchant-epsilon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Factive_merchant-epsilon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Factive_merchant-epsilon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Factive_merchant-epsilon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepabo","download_url":"https://codeload.github.com/pepabo/active_merchant-epsilon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepabo%2Factive_merchant-epsilon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270962371,"owners_count":24675959,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["activemerchant","ruby","rubygems"],"created_at":"2024-11-28T08:12:08.990Z","updated_at":"2025-08-21T00:31:07.568Z","avatar_url":"https://github.com/pepabo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActiveMerchant::Epsilon\n[![Gem](https://img.shields.io/gem/v/active_merchant-epsilon.svg?style=flat-square)](https://rubygems.org/gems/active_merchant-epsilon)\n[![Build Status](https://travis-ci.org/pepabo/active_merchant-epsilon.svg?branch=master)](https://travis-ci.org/pepabo/active_merchant-epsilon)\n\n[Epsilon](http://www.epsilon.jp/) integration for ActiveMerchant.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'active_merchant-epsilon'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install active_merchant-epsilon\n\n## Usage\n\n### Settings\n\nAn example Rails initializer would look something like this:\n\n```ruby\nActiveMerchant::Billing::Base.mode = :production\nActiveMerchant::Billing::EpsilonGateway.contract_code = '12345678'\nActiveMerchant::Billing::EpsilonGateway.proxy_port = 8080\nActiveMerchant::Billing::EpsilonGateway.proxy_address = 'myproxy.dev'\n```\n\n### CreditCard Payment\n\n```ruby\nrequire 'active_merchant'\n\nActiveMerchant::Billing::Base.mode = :test\n\nActiveMerchant::Billing::EpsilonGateway.contract_code = 'YOUR_CONTRACT_CODE'\n\ngateway = ActiveMerchant::Billing::EpsilonGateway.new\n\namount = 10000\n\nActiveMerchant::Billing::CreditCard.require_verification_value = true\n\ncredit_card = ActiveMerchant::Billing::CreditCard.new(\n  first_name:         'TARO',\n  last_name:          'YAMADA',\n  number:             '4242424242424242',\n  month:              '10',\n  year:               Time.now.year + 1,\n  verification_value: '000', # security code\n)\n\npurchase_detail = {\n  user_id:      'YOUR_APP_USER_IDENTIFIER',\n  user_name:    '山田 太郎',\n  user_email:   'yamada-taro@example.com',\n  item_code:    'ITEM001',\n  item_name:    'Greate Product',\n  order_number: 'UNIQUE ORDER NUMBER',\n  memo1:        'memo1',\n  memo2:        'memo2',\n}\n\nif credit_card.validate.empty?\n  # Capture 10000 yen from the credit card\n  response = gateway.purchase(amount, credit_card, purchase_detail)\n\n  if response.success?\n    puts \"Successfully charged #{amount} yen to the credit card #{credit_card.display_number}\"\n  else\n    raise StandardError, response.message\n  end\nend\n```\n\n### CreditCard Payment with 3D secure\n\n```ruby\namount = 10000\n\nActiveMerchant::Billing::CreditCard.require_verification_value = true\n\ncredit_card = ActiveMerchant::Billing::CreditCard.new(\n  first_name:         'TARO',\n  last_name:          'YAMADA',\n  number:             '4242424242424242',\n  month:              '10',\n  year:               Time.now.year + 1,\n  verification_value: '000', # security code\n)\n\npurchase_detail = {\n  user_id:                   'YOUR_APP_USER_IDENTIFIER',\n  user_name:                 '山田 太郎',\n  user_email:                'yamada-taro@example.com',\n  item_code:                 'ITEM001',\n  item_name:                 'Greate Product',\n  order_number:              'UNIQUE ORDER NUMBER',\n  three_d_secure_check_code: 1,\n  memo1:                     'memo1',\n  memo2:                     'memo2',\n}\n\nif credit_card.validate.empty?\n  response = gateway.purchase(amount, credit_card, purchase_detail)\n\n  raise StandardError, response.message unless response.success?\n\n  if response.params['three_d_secure']\n    puts response.params['acs_url']\n    puts response.params['pareq']\n  else\n    # NOT 3D SECURE\n    puts \"Successfully charged #{amount} yen to the credit card #{credit_card.display_number}\"\n  end\nend\n\n# (The card holder identifies himself on credit card's page and comes back here)\n\n# AND SECOND REQUEST\n\nresponse = gateway.authenticate(\n  order_number:          'ORDER NUMBER',\n  three_d_secure_pa_res: 'PAYMENT AUTHENTICATION RESPONSE',\n)\n\nif response.success?\n  puts \"Successfully charged to the credit card\"\nelse\n  raise StandardError, response.message\nend\n```\n\n### CreditCard Installment Payment\n\n```ruby\n# (snip)\n\npurchase_detail = {\n  user_id:      'YOUR_APP_USER_IDENTIFIER',\n  user_name:    '山田 太郎',\n  user_email:   'yamada-taro@example.com',\n  item_code:    'ITEM001',\n  item_name:    'Greate Product',\n  order_number: 'UNIQUE ORDER NUMBER',\n  credit_type:  ActiveMerchant::Billing::EpsilonGateway::CreditType::INSTALLMENT,\n  payment_time: 3, # 3, 5, 6, 10, 12, 15, 18, 20, 24\n  memo1:        'memo1',\n  memo2:        'memo2',\n}\n\n# (snip)\n```\n\n### CreditCard Payment with 3D secure 2.0(with token)\n\n```ruby\n# 3D secure 2.0 does not have a test environment for epsilon\nActiveMerchant::Billing::Base.mode = :production\n\namount = 1000\npurchase_detail = {\n  user_id:                   'YOUR_APP_USER_IDENTIFIER',\n  user_name:                 '山田 太郎',\n  user_email:                'yamada-taro@example.com',\n  item_code:                 'ITEM001',\n  item_name:                 'Greate Product',\n  order_number:              'UNIQUE ORDER NUMBER',\n  three_d_secure_check_code: 1,\n  token:                     'CREDIT CARD TOKEN'\n  tds_flag:                  21 # 21 or 22\n  # optional:\n  #   add params for risk-based certification(billAddrCity etc...)\n}\n\nresponse = gateway.purchase(amount, ActiveMerchant::Billing::CreditCard.new, purchase_detail)\n\nif response.success?\n  if response.params['three_d_secure']\n    puts response.params['tds2_url']\n    puts response.params['pa_req']\n  else\n    # NOT 3D SECURE\n    puts \"Successfully charged #{amount} yen as credit card payment(not 3D secure)\"\n  end\nelse\n  raise StandardError, response.message\nend\n\n# (The card holder identifies himself on credit card's page and comes back here)\n\n# AND SECOND REQUEST\n\nresponse = gateway.authenticate(\n  order_number:          'ORDER NUMBER',\n  three_d_secure_pa_res: 'PAYMENT AUTHENTICATION RESPONSE',\n)\n\nif response.success?\n  puts 'Successfully charged as credit card payment(3D secure 2.0)'\nelse\n  raise StandardError, response.message\nend\n```\n\n### CreditCard Revolving Payment\n\n```ruby\n# (snip)\n\npurchase_detail = {\n  user_id:      'YOUR_APP_USER_IDENTIFIER',\n  user_name:    '山田 太郎',\n  user_email:   'yamada-taro@example.com',\n  item_code:    'ITEM001',\n  item_name:    'Greate Product',\n  order_number: 'UNIQUE ORDER NUMBER',\n  credit_type:  ActiveMerchant::Billing::EpsilonGateway::CreditType::REVOLVING,\n  memo1:        'memo1',\n  memo2:        'memo2',\n}\n\n# (snip)\n```\n\n### Convenience Store Payment\n\n```ruby\nActiveMerchant::Billing::EpsilonConvenienceStoreGateway.contract_code = 'YOUR_CONTRACT_CODE'\n\ngateway = ActiveMerchant::Billing::EpsilonConvenienceStoreGateway.new\n\nconvenience_store = ActiveMerchant::Billing::ConvenienceStore.new(\n  code:           ActiveMerchant::Billing::ConvenienceStore::Code::LAWSON,\n  full_name_kana: 'ヤマダ タロウ',\n  phone_number:   '0312345678'\n)\n\npurchase_detail = {\n  user_id:      'YOUR_APP_USER_IDENTIFIER',\n  user_name:    '山田 太郎',\n  user_email:   'yamada-taro@example.com',\n  item_code:    'ITEM001',\n  item_name:    'Greate Product',\n  order_number: 'UNIQUE ORDER NUMBER',\n  memo1:        'memo1',\n  memo2:        'memo2',\n}\n\nif credit_card.validate.empty?\n  # 10000 yen as convenience store paymet\n  response = gateway.purchase(amount, convenience_store, purchase_detail)\n\n  if response.success?\n    puts \"Successfully charged #{amount} yen as convenience store payment\"\n    puts \"Receipt number is #{response.params['receipt_number']}\"\n    puts \"Payment limit date is #{response.params['convenience_store_limit_date']}\"\n  else\n    raise StandardError, response.message\n  end\nend\n```\n\n### Recurring Billing (Monthly subscriptions)\n\n```ruby\npurchase_detail[:mission_code] = ActiveMerchant::Billing::EpsilonGateway::MissionCode::RECURRING_6\n\ngateway.recurring(amount, creadit_card, purchase_detail)\n```\n\n### Cancel recurring billing\n\n```ruby\ngateway.cancel_recurring(user_id: 'user_id', item_code: 'item_code')\n```\n\n### Void Transaction\n\n```ruby\ngateway.void('order_number')\n```\n\n### Verify Credit Card\n\n```ruby\ngateway.verify(credit_card, user_id: 'user_id', user_email: 'user@example.com')\n```\n\n### GMO ID Settlement\n\n```ruby\nActiveMerchant::Billing::EpsilonGmoIdGateway.contract_code = 'YOUR_CONTRACT_CODE'\n\ngateway = ActiveMerchant::Billing::EpsilonGmoIdGateway.new\n\namount = 10000\n\npurchase_detail = {\n  user_id:      'YOUR_APP_USER_IDENTIFIER',\n  user_email:   'yamada-taro@example.com',\n  user_name:    'YAMADA TARO',\n  item_code:    'ITEM001',\n  item_name:    'Golden Product',\n  order_number: 'UNIQUE ORDER NUMBER',\n  gmo_id:       'Your member id of GMO ID',\n  gmo_card_id:  'Your sequential card number of GMO ID',\n}\n\ngateway.purchase(amount, purchase_detail)\n```\n\n### GMO ID Settlement Void Transaction\n\n```ruby\ngateway.void('order_number')\n```\n\n### Virtual Account Payment\n\n```ruby\nActiveMerchant::Billing::EpsilonVirtualAccountGateway.contract_code = 'YOUR_CONTRACT_CODE'\n\ngateway = ActiveMerchant::Billing::EpsilonVirtualAccountGateway.new\n\namount = 10000\n\npurchase_detail = {\n  user_id:        'YOUR_APP_USER_IDENTIFIER',\n  user_name:      '山田 太郎',\n  user_email:     'yamada-taro@example.com',\n  item_code:      'ITEM001',\n  item_name:      'Greate Product',\n  order_number:   'UNIQUE ORDER NUMBER',\n  user_name_kana: 'ﾔﾏﾀﾞﾀﾛｳ'\n}\n\nresponse = gateway.purchase(amount, purchase_detail)\n\nif response.success?\n  puts \"Successfully charged #{amount} yen as virtual account payment\"\n  puts \"Account number is #{response.params['account_number']}\"\n  puts \"Bank name is #{response.params['account_name']}\"\nelse\n  raise StandardError, response.message\nend\n```\n\n### Epsilon Link Payment\n\nEpsilosLinkPaymentGateway is available in all link payments.\nFor example, GMO Payment After Delivery.\n\nIf you don't need to send paramaters of delivery information details(e.g. consignee_postal, consignee_name, orderer_postal, and orderer_name), you set `delivery_info_required` to `false`.\n\nDefault value of `delivery_info_required` is `true`, therefore you must set delivery information details to purchase_detail When you don't set `delivery_info_required`.\n\n```ruby\nActiveMerchant::Billing::EpsilonLinkPaymentGateway.contract_code = 'YOUR_CONTRACT_CODE'\n\ngateway = ActiveMerchant::Billing::EpsilonLinkPaymentGateway.new\n\namount = 10000\n\npurchase_detail = {\n  user_id:           'YOUR_APP_USER_IDENTIFIER',\n  user_name:         '山田 太郎',\n  user_email:        'yamada-taro@example.com',\n  user_tel:          '0312345678',\n  item_code:         'ITEM001',\n  item_name:         'Greate Product',\n  order_number:      'UNIQUE ORDER NUMBER',\n  st_code:           'SETTLEMENT_CODE',\n  consignee_postal:  '1500002',\n  consignee_name:    '山田 太郎',\n  consignee_address: '東京都渋谷区1-1-1',\n  consignee_tel:     '0312345678',\n  orderer_postal:    '1500002',\n  orderer_name:      '山田 太郎',\n  orderer_address:   '東京都渋谷区1-1-1',\n  orderer_tel:       '0312345678',\n  memo1:             'memo1',\n  memo2:             'memo2',\n}\n\ndelivery_info_required = true\n\nresponse = gateway.purchase(amount, purchase_detail, delivery_info_required)\n\nif response.success?\n  puts \"Successfully send order data\"\n  puts \"Redirect url is #{response.params['redirect']}\"\nelse\n  raise StandardError, response.message\nend\n```\n\n### Epsilon Link Payment Void Transaction\n```ruby\ngateway.void('order_number')\n```\n\n### Error handling\n\nIf epsilon server returns status excepted 200, `#purchase` method raise `ActiveMerchant::ResponseError`.\n\nWhen your request parameters are wrong(e.g. contract_code), the method returns failure response.\n\n- `#success?` returns `false`\n- `#params` has error detail\n\n```ruby\nresponse = gateway.purchase(10000, creadit_card, invalid_detail)\n\nresponse.success? # =\u003e false\nresponse.params   # =\u003e Hash included error detail\n```\n\n## Contributing\n\n1. Create your feature branch (`git checkout -b my-new-feature`)\n2. Commit your changes (`git commit -am 'Add some feature'`)\n3. Push to the branch (`git push origin my-new-feature`)\n4. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Factive_merchant-epsilon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepabo%2Factive_merchant-epsilon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepabo%2Factive_merchant-epsilon/lists"}