Skip to content

Null exception when do a payment with multiple MID by JWT Authentication Type #181

@non-nattawut

Description

@non-nattawut

Image

Step to reproduce :

  1. after do all setup for JWT do a payment with MID-A, payment working fine
  2. but after switch MID to MID-B and do a second payment (that not associate with first payment) will get error like above picture
  3. then I will get Authorization bearer token = null so I cannot do a second payment

cause :

when I drive through library code and I found that AuthenticationSdk 0.0.34
in Cache.class
Method getMerchantP12KeysFromCache()
this line Identity p12Keys = (Identity)cacheP12.get(this.merchantConfig.getMerchantID());
return NULL because MID-B not contain in cacheP12

so next line call p12Keys.getLastModifiedDate() will get NULL exception

My Interim solution :

I use Cache.cacheP12.clear(); to clear cache everytime I create new payment

What I want to ask is, is this intend to be like this? because my use case need to use multiple MID

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions