Class: ActiveMerchant::Billing::VeritransGateway

Inherits:
Gateway
  • Object
show all
Defined in:
app/models/active_merchant/billing/veritrans_gateway.rb

Instance Method Summary collapse

Instance Method Details

#approve(payment_id, options = {}) ⇒ Object



38
39
40
# File 'app/models/active_merchant/billing/veritrans_gateway.rb', line 38

def approve(payment_id, options = {})
  #request_with_logging(:post, config.api_host + "/v2/#{URI.escape(payment_id)}/approve", options)
end

#cancel(transaction_id, config) ⇒ Object



32
33
34
# File 'app/models/active_merchant/billing/veritrans_gateway.rb', line 32

def cancel(transaction_id, config)
  make_request(:post, config[:url_api] + "/v2/#{URI.escape(transaction_id)}/cancel", {}, config[:server_key])
end

#capture(transaction_id, gross_amount, config) ⇒ Object



44
45
46
# File 'app/models/active_merchant/billing/veritrans_gateway.rb', line 44

def capture(transaction_id, gross_amount, config)
  make_request(:post, config[:url_api] + "/v2/capture", { transaction_id: transaction_id, gross_amount: gross_amount }, config[:server_key])
end

#charge(data, config) ⇒ Object

POST /v2/charge { payment_type: “vtdirect” } Docs docs.veritrans.co.id/sandbox/charge.html



26
27
28
# File 'app/models/active_merchant/billing/veritrans_gateway.rb', line 26

def charge(data, config)
  make_request(:post, config[:url_api] + "/v2/charge", data, config[:server_key])
end