title: Stripe and Parse SDK to store credit card
body: <p>I am attempting to store a users credit card into stripe. I have a form all setup using Payment Kits <code>PTKView</code>. Then once the user taps the save button, I create a <code>STPToken</code> which is required by <code>Stripe</code>. Once the token is made, I attempt to save the token with the users objectId to <code>Stripe</code> as a customer. I am sure the problem lies within the server code.</p>
  
  <p>A bit of background, I am using Parse SDK's cloud code as my server, so there I'm dealing with javascript :(.</p>
  
  <p>Here I take the information from the form, create a <code>STPCard</code>, then generate a token. </p>
  
  <pre><code>PTKCard* card = self.cardView.card; // self.cardView is the PTKView
  STPCard *stpcard = [[STPCard alloc] init];
  stpcard.number = card.number;
  stpcard.expMonth = card.expMonth;
  stpcard.expYear = card.expYear;
  stpcard.cvc = card.cvc;
  
  [[STPAPIClient sharedClient] createTokenWithCard:stpcard
                                        completion:^(STPToken *token, NSError *error) {
                                            if (error) {
                                                NSLog(@"error");
                                            } else {
                                                [self createBackendChargeWithToken:token];
                                            }
                                        }];
  </code></pre>
  
  <p>Once the token is made, I send it to Parse where I implemented the server side code to handle creating the customer and saving it to Stripe.</p>
  
  <pre><code>- (void)createBackendChargeWithToken:(STPToken *)token
  {
  
      NSDictionary *productInfo = @{@"cardToken": [NSString stringWithFormat:@"%@",token],
                                    @"objectId": [[PFUser currentUser] objectId]};
  
  
      [PFCloud callFunctionInBackground:@"saveCardInformation"
                         withParameters:productInfo
                                  block:^(id object, NSError *error) {
                                      if (error) {
                                          NSLog(@"error");
                                          return ;
                                      }
  
                                      [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Success", @"Success")
                                                                  message:nil
                                                                 delegate:nil
                                                        cancelButtonTitle:NSLocalizedString(@"OK", @"OK")
                                                        otherButtonTitles:nil] show];
  
                                  }];
  }
  </code></pre>
  
  <p>Now I handle the token passed within the cloud code:</p>
  
  <pre><code>var Stripe = require('stripe');
  Stripe.initialize(my_key);
  
  
  Parse.Cloud.define("saveCardInformation", function(request, response) {
  
      Stripe.Customers.create({
        source: request.params.cardToken,
      },{
        success: function(httpResponse) {
          response.success("Customer created!");
        },
        error: function(httpResponse) {
          response.error(httpResponse.message);
        }
      });
  
  });
  </code></pre>
  
  <p>I then get a response back saying this: </p>
  
  <pre><code>Error: There is no token with ID tok_15afWSDOYfVZdgZvh6qSvmmm (test mode). (Code: 141, Version: 1.6.0)
  </code></pre>
  
  <p>Why is it saying this? To my understanding, I am just creating a user so of course there is no token with the specified id. I understand it is mainly in the javascript cloud code but I am unsure how to handle this... Anyone got any ideas?</p>