Skip to content
Jagdeep Singh edited this page May 1, 2017 · 1 revision

Remittance API

This feature is available on a PR.

GMO gem can be used to setup payment accounts and registering deposits for those accounts.

gmo = GMO::Payment::RemittanceAPI.new \
  shop_id: 'foo',
  shop_pass: 'bar',
  host: 'test-remittance.gmopg.jp'

Create account

result = gmo.create_account \
  bank_id: 'bank12345',
  bank_code: '0001',
  branch_code: '813',
  account_type: :normal,
  account_name: 'An Yutzy',
  account_number: '0012345'

account_type accepts values :normal, :current and :savings.

Other options that can be passed to create_account are:

  • free A field for storing any metadata with the account
  • branch_code_jp Branch code in Japanese
  • account_number_jp Account number in Japanese

Update account

result = gmo.update_account \
  bank_id: 'bank12345',
  bank_code: '0001',
  branch_code: '813',
  account_type: :normal,
  account_name: 'An Yutzy',
  account_number: '0012345'

All the options from create_account can also be passed to update_account.

Delete account

result = gmo.delete_account(bank_id: 'bank12345')

Retrieve account

result = gmo.search_account(bank_id: 'bank12345')

Create deposit

result = gmo.create_deposit \
  bank_id: 'bank12345',
  deposit_id: 'dep00001',
  amount: '1000'

Cancel deposit

result = gmo.cancel_deposit \
  bank_id: 'bank12345',
  deposit_id: 'dep00001'

Retrieve deposit

result = gmo.search_deposit(deposit_id: 'dep00001')

Retrieve balance

result = gmo.search_balance

Create mail deposit

result = gmo.create_mail_deposit \
  deposit_id: 'dep00001',
  deposit_email: 'anyutzy@demo.com',
  amount: 1000,
  deposit_account_name: 'An Yutzy',
  expire: 5,
  deposit_shop_email: 'anyutzy@demo.com'

expire represents the number of days in advance to allow registration, from 1 to 30.

Cancel mail deposit

result = gmo.cancel_mail_deposit(deposit_id: 'dep00001')

Retrieve mail deposit

result = gmo.search_mail_deposit(deposit_id: 'dep00001')