0

I am working on a project where I have integrated stripe connect which is working fine, but now the problem is how I can check that returned details on redirect url are for a specific project.

Projects functions as follows. 1.Registered users add Non-Profit. 2.Connect to their stripe account to accept payments.

Stripe connect button has been placed on project addition page, users clicks on it and returned to a url (given in application) with connected users details, but on this page I have lost the project id for which user was connecting stripe account so I cant save it in database ( i assume that they needs to be saved in database to use at time of donation).

Am I doing something wrong ? Is there any other way to get it done ?

I have used https://gist.github.com/amfeng/3507366 as reference.

Vikram
  • 3,171
  • 7
  • 37
  • 67
  • 1
    Store the info in the session or use the `state` parameter when redirecting to the authorize URL: https://stripe.com/docs/connect/reference#get-authorize-request – koopajah Mar 04 '15 at 13:22

1 Answers1

0

After trying different code approaches and code samples available on net I found that we can use state parameter to get the respective id to which you want to connect the stripe account.

On my application iu https://connect.stripe.com/oauth/authorize?response_type=code&scope=read_write&client_id=CLIENT_ID&state=705 where state is the user ID to connect with.

To open authorization window I used window popup and connect to stripe account by filling details after authorization popup window is closed and then I used $_GET to get user id and saved it in database.

Vikram
  • 3,171
  • 7
  • 37
  • 67