Skip to content
Browse files

Allow numeric pclass argument to add_transaction

  • Loading branch information...
1 parent 915ad78 commit a2f1af51a79ef3e8e07d8cc9f46cad3244263282 @pwigle pwigle committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/klarna/api/methods/invoicing.rb
View
4 lib/klarna/api/methods/invoicing.rb
@@ -21,7 +21,9 @@ def add_invoice(store_user_id, order_id, articles, shipping_fee,
country = ::Klarna::API.id_for(:country, country)
language = ::Klarna::API.id_for(:language, language)
pno_encoding = ::Klarna::API.id_for(:pno_format, pno_encoding)
- pclass = pclass ? ::Klarna::API.id_for(:pclass, pclass) : -1
+ if not pclass.is_a? Fixnum
+ pclass = pclass ? ::Klarna::API.id_for(:pclass, pclass) : -1
+ end
flags = ::Klarna::API.parse_flags(:INVOICE, flags)
articles = Array.wrap(articles).compact

0 comments on commit a2f1af5

Please sign in to comment.
Something went wrong with that request. Please try again.