sheenam12

Untitled

May 30th, 2017
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public static function AccountDetails($input){
  2.  
  3.  
  4. $parts = parse_url($_SERVER['REQUEST_URI']);
  5.  
  6. parse_str($parts['query'], $query);
  7.  
  8. $x = $query['code'];
  9.  
  10.  
  11. $a = shell_exec('curl -X POST https://connect.stripe.com/oauth/token \
  12. -d client_secret=sk_test_YcUzE9uT99GetAy79DB4FOiY \
  13. -d code='.$x.' \
  14. -d grant_type=authorization_code');
  15.  
  16. $b = json_decode($a,true);
  17.  
  18. $insertuser = DB::table('guard_stripe_account_details')
  19. ->insertGetId(array(
  20. 'code' => $x,
  21. 'account_id' => $b['stripe_user_id'],
  22. 'stripe_publish_key' => $b['stripe_publishable_key'],
  23. 'stripe_secret_key' => $b['access_token'],
  24. 'created_at' => new DateTime,
  25. 'updated_at' => new DateTime
  26. )
  27. );
  28.  
  29. return 'Bank Account activated successfully';
  30.  
  31. } //end function
Add Comment
Please, Sign In to add comment