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

PPH iOS SDK Going Live : Code 7 error #335

Closed maulikpat closed 4 years ago

maulikpat commented 4 years ago

Hi,

I have set all Live values and I am able to get access token by https://api.paypal.com/v1/oauth2/token.

But iOS SDK gives Code 7 error: SdkCredential *sdkCreds = [[SdkCredential alloc] initWithAccessToken:token refreshUrl:@"aURL" environment:@"live"]; [PayPalRetailSDK initializeMerchantWithCredentials:(SdkCredential *)sdkCreds completionHandler:^(PPRetailError *error, PPRetailMerchant *merchant)

Is there any settings missing?

ppmtscory commented 4 years ago

Do you have everything enabled on your Live side of your REST App where you get your Live client ID and secret? There are certain fields on there that you need to submit to have enabled as you won't be able to enable those yourself. The check boxes that you've selected for your sandbox environment do not automatically transfer over to the Live environment. Please see here for the boxes that need to be checked. There should be a notice on the Live version of your REST App that tells you where to submit to enable the ones that you don't have access to do on your own.

maulikpat commented 4 years ago

@ppmtscory I am not able to check below options for Live app image

Is this causing the issue?

maulikpat commented 4 years ago

@ppmtscory But I really don't need any of the scopes in my app. But I think it's mandatory to select any of them? What if I don't require any?

ppmtscory commented 4 years ago

Yes, that's causing your issue. Even though you don't use them, the PPH SDK uses them to set up the merchant object that's included in the invoice you create for the payment.

maulikpat commented 4 years ago

@ppmtscory ok thanks. So I need to send mail to PayPal with app information for this right?

ppmtscory commented 4 years ago

That's correct. There should be instructions on your REST App for who to send the email to and what to include in said email.

maulikpat commented 3 years ago

@ppmtscory I just received approval from PayPal. image

But I am still facing same issue. Error Code 7

Am I missing anything?

ppmtscory commented 3 years ago

Yes, you have to have all the address information too. Name, email, and all address information. Also you have to have PayPal Here checked on there which I'm sure you probably already do. https://developer.paypal.com/docs/integration/paypal-here/sandbox-testing/configuring-accounts/#create-a-rest-application

maulikpat commented 3 years ago

@ppmtscory These are the selections image

maulikpat commented 3 years ago

@ppmtscory As mentioned here image

I have only asked for Email scope. And PayPal has enabled that only. But as you I need all of the scopes so do I need to email again to PayPal for other attributes? But I am not using any of the attributes from PayPal in my App.

So I need to do here now?

ppmtscory commented 3 years ago

Yes, you'll need to go through the same process to enable the remaining scopes. Even though your app is not using them explicitly, the PPH SDK is using them to gather merchant info. You can put that in your request to enabled all of the scopes listed in the link I provided earlier. Full name, email, and all address fields.

maulikpat commented 3 years ago

@ppmtscory thanks I mailed paypal and they enable it now.

maulikpat commented 3 years ago

@ppmtscory if I create a new App under my account, do I need to again send an email to the PayPal team to enable those scopes?

ppmtscory commented 3 years ago

Yes, for production you will have to email your business justification for each REST App that you create and want to use.