sumup / sumup-ios-sdk

Other
46 stars 24 forks source link

Not presenting checkout as user is not logged in. #27

Closed raghubb4444 closed 7 years ago

raghubb4444 commented 7 years ago

i want to present card terminal view after i click my login button.This is my code: https://gist.github.com/pradeepkumari/f5e6f78e8085d70d1a19d1141424d84a

felixLam commented 7 years ago

Hello Raghub, Are you using two accounts to comment on issues? This is confusing and increases our work load. Kind regards

Felix

raghubb4444 commented 7 years ago

One of my colleague also working on that. Now i newly started. This is my code. Just go through

raghubb4444 commented 7 years ago

We stuck with this issue for the past 4 days.Just a help..

mollidor commented 7 years ago

Hi Raghub.

As we tried to outline in a different issue you or one of your co-workers opened you can either 1) call presentLogin... which will show a login view controller where the merchant has to manually enter his username and password, then tap "Login". This is what the sample app provided does. Build and run and you will see it in action. 2) Advanced: Acquire a token from SumUp's API, which is what you seem to be doing here. You will then have to call loginWithToken: providing this token. Once the completion block has run indicating success you can go ahead and call checkoutWithRequest just like the sample app does.

So either presentLogin... OR acquire token and call loginWithToken:..

felixLam commented 7 years ago

Please clarify these questions for us:

  1. do you want to open the SumUp app or do you want to present SumUp screens within your app?
  2. did you integrate your backend with the SumUp backend so that you receive an authentication token or do you want your users to manually login in?
  3. which version of Swift do you use?
  4. which iOS SDK is your base SDK?
  5. which iOS Version is the lowest that you plan on supporting?

Please stop opening support issues under multiple user names on multiple repositories. We are trying to help you, receiving a barrage of issues and comments does not speed up the process. To the contrary.

Kind regards

Felix

raghubb4444 commented 7 years ago

@felixLam sorry for my mistake.

  1. Want to present sumup screens within my app and also integration.
  2. I didn't get you what you are asking? just i added sumup libraries in my project and also opened account in sumup and linked my project to that account.also added api key to my appDelegate.
  3. swift 2.2
  4. sumup-ios-sdk(currently we are commenting know, that sdk only am integrated)
  5. 6
raghubb4444 commented 7 years ago
  1. i am getting accesstoken and merchant code in my response. Just check my gist.
mollidor commented 7 years ago

okay, so you are at (2) in my comment above

You will then have to call loginWithToken: providing this token. Once the completion block has run indicating success you can go ahead and call checkoutWithRequest just like the sample app does.

raghubb4444 commented 7 years ago

After passing Username and password to sumup request am getting response with accesstoken and merchant code. After that, I have to call present login method or login with token.

mollidor commented 7 years ago

You have to call loginWithToken: with that token, not presentLogin.... Just read my comment above https://github.com/sumup/sumup-ios-sdk/issues/27#issuecomment-260595475 once again.

raghubb4444 commented 7 years ago

ok.what should i pass in that completion argument? is it Right? SumupSDK.loginWithToken(Appconstant.access_token, completion:{ [weak self](success, error) in guard error == nil else { return }
})

raghubb4444 commented 7 years ago

If i click login means, It shows same error.Not presenting checkout as user is not logged in.

raghubb4444 commented 7 years ago

@felixLam small help. Just am clicking login button first time it shows card terminal view. Then if i click cancel in card terminal view, it comes back and shows login view. But now if i click login(second time) means, it enters into error loop in completion block

raghubb4444 commented 7 years ago

@felixLam @mollidor small issue? After the card terminal view, If i connect t device and type the value, it closes the app.what may be the issue?

felixLam commented 7 years ago

Have the other issues been resolved then? Please provide a crash log.

raghubb4444 commented 7 years ago

@felixLam Other issues are solved. I didn't have Device with me. Client is only having device. Just i sent the .ipa.He is saying that, after the card insertion it closes the app like that.What may be the problem?

mollidor commented 7 years ago

@raghubb4444 Please provide a crash log.

felixLam commented 7 years ago

Without a crash log it is really hard to say. The crash is most likely in your code. Previously you had many lines where you force unwrap an optional variable (using !). This is always bad. Use guard let or if let instead and check that the variable is not nil before accessing any of its properties/methods otherwise you will receive a lot of crashes.

felixLam commented 7 years ago

Given that you reported the initial issues as resolved I am closing this issue. For the crash: please follow common swift debugging practices. This is not an issue with the SDK.

raghubb4444 commented 7 years ago

I didn't have device. I am able to check using the device.Card insertion closes the app like he is saying

felixLam commented 7 years ago

I did not deny that you are witnessing crashes, however without a symbolicated crash report it will be impossible to help you.

raghubb4444 commented 7 years ago

@felixLam There? please go through my code for sumup. https://gist.github.com/raghubb4444/3e780ce8a1f772b860c2345b79ee4f6b

felixLam commented 7 years ago

The only think that strikes me is that you do not use the merchant's currencycode and instead always use USD. We had discussed this earlier and the sample app provides appropriate sample code. Does your IPA have assertions enabled? Again without the crash logs we will not be able to help you in any meaningful way. Please learn how to collect, symbolicate and interpret crash reports.

felixLam commented 7 years ago

This is also possible with external installations and is not limited to debugging sessions. Have a look at crashlytics or hockeyapp

raghubb4444 commented 7 years ago

This is my app. App closes after inserting card. https://www.youtube.com/watch?v=t14Y_bt7mPU

raghubb4444 commented 7 years ago

Crashlytics shows error. Am not able to integrate crashlytics in my app.

mollidor commented 7 years ago

Can you please provide the crash log. You can download it from the device using Xcode if you don't want to integrate HockeyApp/Crashlytics.

raghubb4444 commented 7 years ago

@felixLam there?Please helpout.

mollidor commented 7 years ago

Which version of the SDK are you using? If you are using 1.3 please make sure to follow the steps here: https://github.com/sumup/sumup-ios-sdk#supported-device-orientation

Feel free to move to 1.3.1b which doesn't need you to support landscape anymore: https://github.com/sumup/sumup-ios-sdk/tree/develop

https://github.com/sumup/sumup-ios-sdk/blob/develop/CHANGELOG.md#version-131b1

raghubb4444 commented 7 years ago

App executed by client. just i sent .ipa and he executed the app. That is that video. Am not able to get crash log. I installed crashlytics. But its not showing crash report. Please helpout as a individual.

raghubb4444 commented 7 years ago

Do you have teamViewer? Please helpout. My client scolding lot.

mollidor commented 7 years ago

Did you read and follow my thoughts in https://github.com/sumup/sumup-ios-sdk/issues/27#issuecomment-261263867 ?

You should at least be able to tell us a) which version of the SDK you are integrating b) if the app you built support a landscape orientation https://github.com/sumup/sumup-ios-sdk/blob/master/SumupSDKSampleApp/SumupSDKSampleApp-Info.plist#L54-L60 (if on SDK 1.3)

raghubb4444 commented 7 years ago

Following 1.3 only. No support for landscape orientation.

mollidor commented 7 years ago

You will have to support one of the two landscape orientations if you are using 1.3 See Readme and sample app: https://github.com/sumup/sumup-ios-sdk#supported-device-orientation https://github.com/sumup/sumup-ios-sdk/blob/master/SumupSDKSampleApp/SumupSDKSampleApp-Info.plist#L54-L60

If you can not support a landscape orientation I would suggest to integrate the latest 1.3.1 Beta version to be found here: https://github.com/sumup/sumup-ios-sdk/tree/develop

It should be a drop in replacement.

raghubb4444 commented 7 years ago

It is in my info.plist

UISupportedInterfaceOrientations~ipad
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

mollidor commented 7 years ago

Yes, that's iPad. The video you shared is an iPhone.

raghubb4444 commented 7 years ago

I have to run it in iphone. I selected only potrait orientation. Don't need landscape. But i used 1.3. What can i do now?

mollidor commented 7 years ago

I outlined your options 10 minutes ago: https://github.com/sumup/sumup-ios-sdk/issues/27#issuecomment-261274481

raghubb4444 commented 7 years ago

Ok. but i already did 1.3. What is the difference?Or i have to add this 1.3.b framework from the first

mollidor commented 7 years ago

Just drop in 1.3.1b2 from the develop branch of this repo. There's a changelog which I've linked to before: https://github.com/sumup/sumup-ios-sdk/blob/develop/CHANGELOG.md

raghubb4444 commented 7 years ago

in xcode, what i have to change?

raghubb4444 commented 7 years ago

Still getting error. If i insert a card, app closes.

raghubb4444 commented 7 years ago

https://gist.github.com/raghubb4444/3e780ce8a1f772b860c2345b79ee4f6b

mollidor commented 7 years ago

Did you make changes to your app? Did you move to SDK 1.3.1b2 ?