Sha256: 0d18d300f65b7a8ff6cda2927650480d26dafb5944878f6f430aedb6862deeda

Contents?: true

Size: 665 Bytes

Versions: 4

Compression:

Stored size: 665 Bytes

Contents

module BraintreeAdminHelper
  # Returns a link to the Braintree web UI for the given Braintree payment
  def braintree_transaction_link(payment)
    environment = payment.payment_method.preferred_environment == 'sandbox' ? 'sandbox' : 'www'
    merchant_id = payment.payment_method.preferred_merchant_id
    response_code = payment.response_code

    return unless response_code.present?
    return response_code unless merchant_id.present?

    link_to(
      response_code,
      "https://#{environment}.braintreegateway.com/merchants/#{merchant_id}/transactions/#{response_code}",
      title: 'Show payment on Braintree',
      target: '_blank'
    )
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_paypal_braintree-0.4.0 app/helpers/braintree_admin_helper.rb
solidus_paypal_braintree-0.3.0 app/helpers/braintree_admin_helper.rb
solidus_paypal_braintree-0.2.0 app/helpers/braintree_admin_helper.rb
solidus_paypal_braintree-0.1.0 app/helpers/braintree_admin_helper.rb