paymill / paymill-java

Java wrapper for Paymill API
http://paymill.github.io
MIT License
26 stars 22 forks source link

Creating a new Preauthorization discards client and description #23

Closed PerWiklander closed 10 years ago

PerWiklander commented 11 years ago

I'm doing this (yeah, it's scala, bear with me):

val service: PreauthorizationService = Paymill.getService(classOf[PreauthorizationService])
val preauth = new Preauthorization()
preauth.setToken(paymentToken)
preauth.setDescription(order.id.get.toString)
preauth.setClient(
    findClient(customer).getOrElse(createClient(customer))
)
preauth.setAmount(order.orderValue * 100)
preauth.setCurrency("SEK")
service.create(preauth).getId

The intent is to send my order id as description of the preauth transaction and connect it to an existing client or a newly created (by me) one.

What I end up with in Paymill is a preauth transaction with no description and a newly created empty client.

Looking at PreauthorizationService.create I see that only the amount, currency and token is used. The rest of my parameters are disregarded.

public Preauthorization create(Preauthorization preauth) {
    Map<String,Object> params = new HashMap<String,Object>();
    params.put("amount", preauth.getAmount());
    params.put("currency", preauth.getCurrency());

    if (preauth.getPayment() != null) {
        params.put("payment", preauth.getPayment().getId());
    } else {
        params.put("token", preauth.getToken());
    }

    Transaction tx = client.post(resource, params, Transaction.class);
    return tx.getPreauthorization();
}
stoilkov commented 11 years ago

It looks like the client id might get lost in other situations (Transaction) also.

PerWiklander commented 11 years ago

I created my own PreauthorizationService that just puts the missing values in the params map. Now the client id goes in with the params as expected and I see the correct client in the dashboard.

But even though I put the description in the params it does not end up on the transaction in the dashboard.

stoilkov commented 11 years ago

Description is not supported for Preauthorizations. https://www.paymill.com/en-gb/documentation-3/reference/api-reference/#create-new-preauthorization-with

PerWiklander commented 11 years ago

Maybe the Preauthorization class should not have a description property then. Is it also true that a transaction with status "PREAUTH" can not be updated with a description? I wanted to keep track of the order number there.

stoilkov commented 11 years ago

Preauthorization objects in the REST API do have a description field. It is currently not recognized as parameter, but this will hopefully be fixed soon. The description field of transactions can be updated: https://www.paymill.com/en-gb/documentation-3/reference/api-reference/#update-transaction . Works also for transactions with PREAUTH status, just checked.

stoilkov commented 11 years ago

I will leave this issue open, until we have a confirmation that description of preauthorizations is available.

paymill-support commented 11 years ago

Please enter your answer above the separator

Request received: Re: [paymill-java] Creating a new Preauthorization discards client and description (#23) (Ticket Nr. #17924)

Hello paymill/paymill-java,

thank you for your request!

Our business times are Monday to Friday 9AM to 6PM CET. Even outside business hours, we always try to reply you as quickly as possible.

Kind regards, PAYMILL Team

Hallo paymill/paymill-java,

vielen Dank für deine Anfrage!

Unsere Geschäftszeiten sind Montag bis Freitag von 9 Uhr bis 18 Uhr. Auch außerhalb unserer Geschäftszeiten versuchen wir immer dir schnellstmöglich zu antworten.

Viele Grüße Ihr PAYMILL Team

Bonjour paymill/paymill-java,

Merci pour ta demande!

Nos horaires d'ouverture sont du lundi au Vendredi de 9h à 18h. En dehors de ces horaires nous essayons de vous contacter aussi rapidement que possible.

Cordialement, Votre équipe PAYMILL


This email is a service from Paymill GmbH Support.

[3WD3-5HWT]

paymill-support commented 11 years ago

Please enter your answer above the separator

Anfrage Nr. #17924: Wie würden Sie den erhaltenen Support bewerten?

Hello paymill/paymill-java,

We would like to know what you think of our customer service. Please take a moment to answer the following short question:

How would you rate the support you received?

You can copy the following URL into your browser to rate:

https://paymill.zendesk.com/requests/17924/satisfaction/new/bDeHlKCORUwPbTde4AWT0hdXO?locale=1

On your ticket was the following topic:


paymill/paymill-java, Sep 22 20:47 (CEST)

I will leave this issue open, until we have a confirmation that description of preauthorizations is available.


Reply to this email directly or view it on GitHub: https://github.com/paymill/paymill-java/issues/23#issuecomment-24887811


This email is a service from PAYMILL GmbH Support.

[3WD3-5HWT]

stoilkov commented 10 years ago

@cbraun75 any news on this?

stoilkov commented 10 years ago

The API now supports description field for preauths. @nikoloff please include this in the model and create methods

nikoloff commented 10 years ago

now available in version 3.2.0