paymill / paymill-ruby

Ruby wrapper for the Paymill API
MIT License
23 stars 16 forks source link

Attach billing address to transactions #31

Open xxswingxx opened 7 years ago

xxswingxx commented 7 years ago

According to this docs: https://developers.paymill.com/guides/reference/address-data, it shold be possible to attach a billing address to a transaction but so far it raises ArgumentError whenever I try it. If I remove the billing_address, the transaction can be created as expected. The code I've been testing is something like this:

    customer = Paymill::Client.find(CUSTOMER_ID)
    payment = Paymill::Payment.create(token: params[:card_token], client: customer)

    charge = {
      payment: payment,
      amount: 1000
      currency: 'USD'
      billing_address: {
        name: 'Max Mustermann',
        street_address: 'Musterstr. 1',
        street_address_addition: '',
        city: 'Munich',
        state: 'Bavaria',
        postal_code: '80333',
        country: 'DE',
        phone: '+4989123456'
      }
    }

   transaction = Paymill::Transaction.create(charge_attributes) #=> raises ArgumentError
tschelabaumann commented 7 years ago

Thanks for your request. As this feature is quite new, we were not able yet to update all wrappers to support it. The Ruby wrapper unfortunately is one of them but will be updated soon. If it's urgent feel free to fork the project.