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

Creating a new Preauthorization discards client and description #23

Closed
PerWiklander opened this issue Aug 28, 2013 · 11 comments
Closed
Assignees

Comments

@PerWiklander
Copy link
Contributor

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();
}
@ghost ghost assigned stoilkov Aug 29, 2013
@stoilkov
Copy link
Contributor

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

@PerWiklander
Copy link
Contributor Author

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
Copy link
Contributor

@PerWiklander
Copy link
Contributor Author

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
Copy link
Contributor

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 added a commit that referenced this issue Sep 22, 2013
Issue #23 fix, transaction duplicate fix
@stoilkov
Copy link
Contributor

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

@paymill-support
Copy link

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
Copy link

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:
#23 (comment)


This email is a service from PAYMILL GmbH Support.

[3WD3-5HWT]

@ghost ghost assigned d0mme-zz Jan 10, 2014
@stoilkov
Copy link
Contributor

@cbraun75 any news on this?

@stoilkov stoilkov assigned nikoloff and unassigned d0mme-zz Apr 24, 2014
@stoilkov
Copy link
Contributor

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

@nikoloff
Copy link
Contributor

now available in version 3.2.0

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

No branches or pull requests

5 participants