Sha256: ed3589d2a967d9afc07a42c0f857e74c8d84a2a25426c48bd64764322b49b722

Contents?: true

Size: 1.35 KB

Versions: 6

Compression:

Stored size: 1.35 KB

Contents

Veritrans.setup do
  config.load_config Rails.root.join("config/veritrans.yml"), Rails.env

  # Or set it manually...
  # config.server_key = ""
  # config.client_key = ""
  # config.api_host = ""

  # Veritrans::Events is rack application to handle http notifications from Veritrans
  # To enable it, add in config/routes.rb
  #
  #   mount Veritrans::Events.new => '/vt_events'
  #
  # All possible events:
  #
  # 'payment.success'     == ['authorize', 'capture', 'settlement']
  # 'payment.failed'      == ['deny', 'cancel', 'expire']
  # 'payment.challenge'   # when payment.fraud_status == 'challenge'
  #
  # 'payment.authorize'
  # 'payment.capture'
  # 'payment.settlement'
  # 'payment.deny'
  # 'payment.cancel'
  # 'payment.expire'

  # events.subscribe 'payment.success' do |payment|
  #   payment is instance of Veritrans::Result
  #   puts "Payment #{payment.data[:order_id]} is successful"
  # end
  #
  # events.subscribe 'payment.failed' do |payment|
  #   puts "Payment #{payment.data[:order_id]} is failed"
  # end
  #
  # events.subscribe 'payment.challenge' do |payment|
  #   puts "Payment #{payment.data[:order_id]} chellenged by fraud system"
  #   payment.mark_challenge!
  # end
  #
  # events.subscribe /.+/ do |payment, event_name|
  #   puts "Payment #{payment.data[:order_id]} has status #{payment.data[:transaction_status]}"
  #   p payment
  # end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
veritrans-2.3.0 lib/generators/templates/veritrans.rb
veritrans-2.2.0 lib/generators/templates/veritrans.rb
veritrans-2.1.3 lib/generators/templates/veritrans.rb
veritrans-2.1.2 lib/generators/templates/veritrans.rb
veritrans-2.1.1 lib/generators/templates/veritrans.rb
veritrans-2.1.0 lib/generators/templates/veritrans.rb