Jump to content
Larry Ullman's Book Forums

Recommended Posts

Thank you, Larry, for your online resource explaining the process of making a charge through Stripe. It was very thorough and super helpful.

 

Using the following code to create the charge object:


$charge = Stripe_Charge::create(array(
  "amount" => $amount,
  "currency" => "usd",
  "card" => $token,
  "description" => $email
 )
);

I'm using the 'description' key to provide the email address, but when trying to setup email receipts within the Stripe dashboard, does Stripe know to send the receipt to the email found in the 'description'? If not, what can I do differently?

 

I was also wondering about the card holder's name, and how I can send that to Stripe as well to be part of the data for that charge.

 

Thanks!

Link to post
Share on other sites

I now understand that I can add the 'receipt_email' key to the Charge array in PHP and the receipt option works great:

"receipt_email" => $email,

I'm still wondering how I can add the card holders name to the Card Details section of the Stripe page under Payments. Using the methods Larry provided, a new charge reads "Name: no name provided"

Link to post
Share on other sites

I've got this one too. This has to be added to the Stripe token. When retrieving the token in jQuery, Larry's example code did this:

// Get the Stripe token:
Stripe.createToken({
  number: ccNum,
  cvc: cvcNum,
  exp_month: expMonth,
  exp_year: expYear,
}, stripeResponseHandler);

There are move key:value pairs that Stripe is looking for when creating the token. You can find them here, though this confused me at first.

 

We can add the card holder name to the token array like so:

// Get the Stripe token:
Stripe.createToken({
  number: ccNum,
  cvc: cvcNum,
  exp_month: expMonth,
  exp_year: expYear,
  name: your_name_var
}, stripeResponseHandler);

And 'your_name_var' will appear in the Dashboard under Name.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...