paypal / paypal-here-sdk-ios-distribution

Add credit card (tap, insert, swipe & key-in) capabilities to your iOS app
Other
81 stars 91 forks source link

How to get new expiry time? #332

Closed maulikpat closed 4 years ago

maulikpat commented 4 years ago

Hello,

Once we authenticate the user and initialize merchant by

[PayPalRetailSDK initializeMerchantWithCredentials:(SdkCredential *)sdkCreds completionHandler:^(PPRetailError *error, PPRetailMerchant *merchant) with refresh URL, the SDK will automatically refresh the token from the URL. When SDK refreshes the token, can I get a new expiry date from the SDK?

I want to check the expiry time before the payment process and some other stuff as well. I have 1 more payment gateway so I need to maintain manually this thing. So if I can check the expiry date so I can reinitialize SDK.

OR

Is there any way to check if the token is valid with SDK before opening my payment page?

ppmtscory commented 4 years ago

The expiry isn't a parameter that the SDK makes available. Since your system handles the code for generating a new access token, you would have that information available at that time and can do with that information what you need. The SDK utilizes the refreshUrl and also a tokenExpiredHandler so that it can get a refreshed access token on its own. The access token has an expiry of 8 hours.