Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merchant One bug #3334

Open
hossamhossny opened this issue Sep 9, 2019 · 0 comments
Open

Merchant One bug #3334

hossamhossny opened this issue Sep 9, 2019 · 0 comments

Comments

@hossamhossny
Copy link
Contributor

hossamhossny commented Sep 9, 2019

It looks to me that the implementation of Merchant One gateway has a bug..

require 'active_merchant'
ActiveMerchant::Billing::Base.mode = :test

gateway = ActiveMerchant::Billing::MerchantOneGateway.new(
            :username => 'demo',
            :password => 'password')

# ActiveMerchant accepts all amounts as Integer values in cents
amount = 1000  # $10.00

# The card verification value is also known as CVV2, CVC2, or CID
credit_card = ActiveMerchant::Billing::CreditCard.new(
                :first_name         => 'Bob',
                :last_name          => 'Bobsen',
                :number             => '4242424242424242',
                :month              => '8',
                :year               => Time.now.year+1,
                :verification_value => '000')

# Validating the card automatically detects the card type
if credit_card.validate.empty?
  # Capture $10 from the credit card
  response = gateway.purchase(amount, credit_card)

  if response.success?
    puts "Successfully charged $#{sprintf("%.2f", amount / 100)} to the credit card #{credit_card.display_number}"
  else
    raise StandardError, response.message
  end
end`

Gives: "add_customer_data": undefined method "[]" for nil:NilClass (NoMethodError)

the error comes from the adapter of merchant_one.rb expecting first_name and last_name to be in the options hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant