Closed kami4ka closed 3 years ago
Hey there,
Without knowing more about the code it's hard to see the issue clearly, but out the top of my head I can see a few things.
1- Maybe WeChat app is not installed, and you are not checking for availablity, there is an example in the Docs specific to Android here
2- Maybe there is some issue related with the presenter, can you add a Log on the observer itself to see if that is triggered?
3- Make sure you are using the correct Payment Method object from the response with type wechatpaySDK
Hello.
Thanks for the answer.
So a bit of details:
1) WeChat app is installed and I'm checking the availability on another screen, as I'm doing it with Google Pay via Adyen.
2) The same behavior reproduces with logging function instead of presenter call as well. As well, I'm debugging this line, and debugger is not stoped there.
WeChatPayComponent.PROVIDER.get
returns component as expected.
3) Type is wechatpaySDK
as expected.
The only thing was changed in my implementation is described here: https://github.com/Adyen/adyen-android/issues/170
But, as I understand, it should not affect this part of the flow.
I'm only aware of the part with an immediate return for the observer. I will appreciate any clues for further debugging.
Hmm, indeed this looks weird. I'll investigate this further since it could be a bug, but in the mean time you can add this line after the observe to trigger the callback that should have been sent.
component.inputDataChanged(EmptyInputData())
Thanks. It works like a charm. But I've faced another one problem: I'm receiving the following action:
{
"action":{
"paymentData":"***",
"paymentMethodType":"wechatpaySDK",
"sdkData":{
"appid":"***",
"noncestr":"***",
"packageValue":"***",
"partnerid":"***",
"prepayid":"***",
"sign":"***",
"timestamp":"1589884598"
},
"type":"sdk"
}
}
But looks like there is no such Action with that type
.
As well, tutorial sais about another type
:
{
"action":{
"paymentData":"***",
"paymentMethodType":"wechatpaySDK",
"sdkData":{
"appid":"***",
"noncestr":"***",
"packageValue":"***",
"partnerid":"***",
"prepayid":"***",
"sign":"***",
"timestamp":"1589884598"
},
"type":"sdk"
}
}
PS: my excuses for asking this here, but can not figure out how to raise this question, because it looks like not an Android SDK problem, but kind of related to WeChat integration and Android tutorial for it implementation
No worries, this action type issue is related to the SDK as well.
Seems like there was a change in the backend system with the action types that we didn't update in the SDK, so this change will require a new release to fix. I'll try to fix both issues and make a release next week.
Great, thanks for the estimated timelines and help!
Hey man, just wanted to let you know the release might take a bit longer, in order to properly test the WeChat flow I need a device that was in the office, so I don't have it available right now.
I'll keep you posted.
Thanks for the info. The feature is really important for us to implement all the available payment methods in the app with using Adyen and get rid of all other libraries :-)
Hi, @caiofaustino. Any updates regarding the upcoming release?
Hey @kami4ka, the change is already tested and merged, we are in the release process so it shouldn't take long. Sorry for the delay.
Awesome, thanks for such good news.
Hey man, 3.6.6
was just released. Can you please test and let me know how it goes? Sorry for taking so long, we had a few delays.
Thanks! Will get back to you ASAP!
@caiofaustino Am I right, that I can not longer use PolymorphicJsonAdapterFactory
for new SdkAction as I did it for all other actions:
PolymorphicJsonAdapterFactory.of(Action::class.java, Action.TYPE)
.withSubtype(RedirectAction::class.java, RedirectAction.ACTION_TYPE)
.withSubtype(Threeds2FingerprintAction::class.java, Threeds2FingerprintAction.ACTION_TYPE)
.withSubtype(Threeds2ChallengeAction::class.java, Threeds2ChallengeAction.ACTION_TYPE)
.withSubtype(QrCodeAction::class.java, QrCodeAction.ACTION_TYPE)
.withSubtype(VoucherAction::class.java, VoucherAction.ACTION_TYPE)
?
Yeah unfortunately I don't think that's possible. Before only the Action.TYPE
could identify the type of action class to be used, but since they generalised the API we need both the type to be "sdk" and the payment method, so there are 2 keys used in the diferentiation.
You can still use our SERIALIZER
class thought, something like this
val action = Action.SERIALIZER.deserialize(JSONObject("action_object_string"))
Thanks. Will try to modify the code to be able to fit a new approach.
Looks like the updated SDK is working for SDK action. Thanks for the update.
Hi. I'm trying to implement Wechat Pay with Android component by a guide from site.
My code is the following:
The problem is that
presenter.onWechatPayComponentStateChanged
is not triggered.Maybe it somehow related with #182