Closed vipmonkey closed 2 years ago
"201 Created: Returned when Payment request was successfully created. Will return a Location header and if it is Swish m-commerce case, it will also return PaymentRequestToken header." on page 25 https://developer.getswish.se/content/uploads/2018/08/MerchantsAPI_Getswish_180814_v1.92.pdf
Good idea. Using an reference parameter is not ideal though. We should refactor this method to return an object with both the ID and the PaymentRequestToken.
yes ofc is that the best option. However with this pr i wanted to change as little as possible to not force others to have to refactor their codes implementing this function. This way it is optional and will not affect existing implementations.
Understandable. I might refactor this method and then tag a 1.0 release. If you have more ideas for m-commerce, please post them. I have hardly touched that use case at all.
gr8! just started implementing so will keep an eye open for other changes. but i don't think there will be any other problems since the difference is a token returned instead of a payer sent.
I've also needed this functionality and would love for this to get merged. Any plans for that?
I just realized that the id return from createPaymentRequest() is not the same thing as the token needed when triggering the Swish app. So now I'm in bad need for this to get merged. I get the feeling that I shouldn't be holding my breath though, is that right?
I created #20 to replace this PR, following the earlier suggestion to return an object instead.
I'm unable to test it beyond making sure that the tests still passes, but if someone here could confirm that it does the job and if there are no other objections, we can hopefully get it included in a new 3.0.0 release.
That's great news! I think I may be able to test within a couple of days and report back.
Closing this as I have merged #20 and tagged version 3.0.0.
When creating a payment without a payer a paymentToken is returned in header. Added ability to optionaly get this header