Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jherreraa committed Apr 27, 2023
1 parent 50a09f9 commit 420fe53
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/active_merchant/billing/gateways/commerce_hub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,17 @@ def add_decrypted_wallet(source, payment, options)

def add_payment(post, payment, options = {})
source = {}
payment = options[:encryption_data] if options[:encryption_data].present?
case payment
when NetworkTokenizationCreditCard
add_decrypted_wallet(source, payment, options)
when CreditCard
add_credit_card(source, payment, options)
when String
add_payment_token(source, payment, options)
when Hash
source[:sourceType] = 'PaymentCard'
source[:encryptionData] = payment
end
post[:source] = source
end
Expand Down

0 comments on commit 420fe53

Please sign in to comment.