Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Necuima

STRIPE Capturing Charges

Recommended Posts

Thanks to the advice received, I am making progress.  I can send a charge for payment and receive confirmation that it is marked as 'paid'.

But I have a puzzlement re page 518 re 'capturing charges'.  Firstly, it seems that the charge_id is the token - is my understanding on this point correct?  I used that anyway in the 'retrieve' statement and it did not object.  (I am adapting Larry's code here for my own purposes, in fact a single charge).

The '$charge->paid returns true which I test in my code and I can also see it in the Stripe test log.  It does this whether I invoke the 'retrieve' and 'capture' statements or not.

But the dashboard does not show any $s even though I have now sent dozens of charges all of which have returned true for paid.

Any advice will be most appreciated and thank you in anticipation.

Necuima

zz-stripe-dashboard-2.jpg

Share this post


Link to post
Share on other sites

Mmmm, I have the charge captured now but to be truthful I don't properly understand this.

I retrieved the id from the response body:

$charge__id = $charge->id;
$charge = \Stripe\Charge::retrieve($charge__id);
$charge->capture();

and the id is clearly not the token.  So I hope that I am doing it correctly!

A further query, I cannot see 'response_reason_text' in the log so maybe it is only there if the charge gets rejected?

Again, any advice will be most appreciated.

Thanks, Necuima

Share this post


Link to post
Share on other sites

To clarify, the chard ID is not the same as the token. The token is the representation of the payment method, which is used to create a charge. 

As for not seeing the charges in the Dashboard, you are looking at test data, which should show the results. I'd look at the logs in the Dashboard to see if requests are being made and also confirm you're using the right API keys.

Share this post


Link to post
Share on other sites

Hi Larry,

I can see the test charges now - they don't show in the dashboard until you capture them.

Thanks as always for your insights.

Cheers, Necuima

Share this post


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.

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...
Sign in to follow this  

×
×
  • Create New...