Closed rleiwang closed 8 years ago
I used the following to setup PPH SDK
[PayPalHereSDK setupWithCredentials: [JSON objectForKey:@"access_token"]
refreshUrl: @"http://192.168.2.9:9090/paypal/refresh"
tokenExpiryOrNil: [JSON objectForKey:@"expires_in"]
thenCompletionHandler:^(PPHInitResultType status, PPHError *error, PPHMerchantInfo *info)
{
if (status == ePPHAccessResultSuccess)
{
self.merchant = info;
}
}];
it should get setup by setupWithCredentials. Do you see a call to a URL with "userInfo" in it between the setup call and the create invoice call?
Yes, I saw the the following after setupWithCredentials, before processing payment
2015-10-03 09:40:47.347 [1304:175641] 16:40:46.0872 <NSThread: 0x174e7e940>{number = 11, name = (null)} | PayPalHere:
--- _OBSCURO_EMFJSONResponse https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/userinfo?schema=openid
Headers: {
"Server" : "Apache",
"Set-Cookie" : "X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D880%26app%3Didentityspartaweb%26TIME%3D201658454; domain=.paypal.com; path=\/; Secure; HttpOnly, X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT",
"Strict-Transport-Security" : "max-age=14400",
"Content-Type" : "application\/json;charset=UTF-8",
"Date" : "Sat, 03 Oct 2015 16:40:44 GMT",
"Paypal-Debug-Id" : "6857d28f3b146, 89fef8bbb17e0",
"Content-Length" : "150",
"Connection" : "Keep-Alive, Keep-Alive",
"Content-Encoding" : "gzip",
"Vary" : "Accept-Encoding,Authorization",
"Keep-Alive" : "timeout=5, max=99"
}
Error: (null)
Data: {"email":"biz@gmail.com","user_id":"https://www.paypal.com/webapps/auth/identity/user/uOzMMmHE7a5YnrJqxhCtaREg9r4TXvvT-3Y9D942ElY"}
Hmmm. That seems like too little info. What scopes are you requesting for your token?
Only three
https://uri.paypal.com/services/paypalhere openid email
Our samples request: "email openid https://uri.paypal.com/services/paypalhere https://uri.paypal.com/services/paypalattributes/business address phone profile" which is why we get a bunch more stuff back. I think you could set it manually also, but if the additional scopes work for you, that's probably the better route.
Thanks @djMax for the quick response. I will try with the same scope.
I just want to learn the alternative you mentioned, do you mind to show the code snippet on how to set it manually?
@djMax just to confirm the transaction went through with scope "email openid https://uri.paypal.com/services/paypalhere https://uri.paypal.com/services/paypalattributes/business address phone profile". Thanks for your help
Thanks for the confirmation, @rleiwang.
I've got the following error. I didn't find where to set merchantInfo in PPHInvoice