Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

submitPayment returns error "Invalid scope" #11

Open
Perjan opened this issue Mar 31, 2017 · 12 comments
Open

submitPayment returns error "Invalid scope" #11

Perjan opened this issue Mar 31, 2017 · 12 comments

Comments

@Perjan
Copy link

Perjan commented Mar 31, 2017

Hello guys,
I am having an issue submitting a payment. I am trying to submit a demo payment with the demo account provided by you.

Steps:

  1. I call createPayment(_ parameters: CreatePaymentParameters, _ completionHandler: @escaping (FigoResult<Payment>) -> Void)
  2. I get a Payment object back
  3. I pass that object and the tanSchemeID = "111111" to submitPayment(_ payment: Payment, tanSchemeID: String, pinHandler: @escaping PinResponder, challengeHandler: @escaping ChallengeResponder, _ completionHandler: @escaping VoidCompletionHandler)

After that I get the error "Invalid scope" with the code "90000"

What am I doing wrong?
Maybe the tanSchemeID is wrong?

Thanks in advance.

@CodeStage
Copy link
Collaborator

Hi @Perjan,
the tanSchemeID should look something like "M2132899.9". You have to get the ID from the supportedTANSchemes property of your account.

@Perjan
Copy link
Author

Perjan commented Apr 3, 2017 via email

@CodeStage
Copy link
Collaborator

A closure which is called when the server needs a response to a challenge from the user

  • Parameter message: Status message or error message for currently processed account
  • Parameter accountID: Account ID of currently processed account
  • Parameter challenge: Challenge object

public typealias ChallengeResponder = (_ message: String, _ accountID: String, _ challenge: Challenge) -> String

You can check out the test cases, to see how it works. For example testCreateModifyAndSubmitPayment() hast the challenge closure.

@Perjan
Copy link
Author

Perjan commented Apr 7, 2017

Thanks a lot @CodeStage, I will check them out today and tomorrow and let you know.
Have a great weekend!

@Perjan
Copy link
Author

Perjan commented Apr 24, 2017

Hey @CodeStage I changed my method today, created a new ChallengeResponder object, passing the accountID of a demo GiroAccount, and passing the tanSchemeID of an iTAN.

Now I can create a payment successfully, but when I submit it, I still get the "Invalid Scope" error.
Could it be that I am using the demo account?

Please help me resolve this.
Thanks in advance,
P

@CodeStage
Copy link
Collaborator

@Perjan Did you look at the "testCreateModifyAndSubmitPayment" test case?

@Perjan
Copy link
Author

Perjan commented Apr 25, 2017

@CodeStage yes I did, and I took the ChallengeResponder and the PinHandler objects from it, pasted them into my method, but still I am getting an invalid scope.

Could it be that the demo account provided by figo cannot do payments?

Thanks,
P

@Perjan
Copy link
Author

Perjan commented Apr 27, 2017

@CodeStage Can you please help me out with this issue?

Thanks a lot,
P

@CodeStage
Copy link
Collaborator

CodeStage commented Apr 27, 2017

@Perjan I'm afraid I can't help you. I verified that the test case is still working and it is. It uses the demo account to create and submit a payment. So you should be able to setup the demo account with your user and after downloading the account object you should be able to create and submit payments with the IDs from that object.

@Perjan
Copy link
Author

Perjan commented Apr 27, 2017

I am using also the demo account. I can create a payment, and I get a successful response. The issue is with the submitPayment method, I get a failure out of that...

That is why I thought maybe there is an issue withe API keys that I am using.

@CodeStage
Copy link
Collaborator

Yeah, maybe you should try to rule that out by asking [email protected] if you are using the right keys. Plus they might be able to tell you in which case they are sending you the "Invalid Scope" error.

@Perjan
Copy link
Author

Perjan commented Apr 27, 2017

Awesome, thanks for helping me out.
Will talk to the support guys.

Cheers,
P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants