#lordcyber - Issuing Laravel PHP
1 messages · Page 1 of 1 (latest)
I have not personally but am happy to look in to it and consult my colleagues who would be more familiar with that if need be
What are you running in to?
am having issues connecting my controller with the server to retrieve the cardholders i have created and also create a cardholder directly through the API
this is the function I was using to access the data.
public function list()
{
Stripe\Stripe::setApiKey(env('STRIPE_SECRET'));
$data = \Stripe\Issuing\Cardholder::list()->json();
return view('backend.list',['data'=> $data]);
}
Gotcha. And what error are you seeing?
With this normally its supposed to work but am getting $data not declared whiles its already been declared and passed to the view to display as a json format
Is the \Stripe\Issuing\Cardholder::list() call failing then?
Or you are getting this error despite that resolving successfully?
Yes, i have tried several times with every method I know of working with Stripe packages have failed
The only tutorial on YouTube that talks about this is in Ruby of which am not an expect in that, but since the development uses MVC model i understood the concept.
What is the error that the call is returning?
Here is the only YouTube video that talks about this plase https://www.youtube.com/watch?v=knBWhYMqLds&t=2271s
Do you see the request failing in your dashboard logs? https://dashboard.stripe.com/test/logs
$data not declared
No test record is showing there
If you make just the list call what error do you see?
Here is the code please
Understood. But if you break that code out in to just calling Stripe\Stripe::setApiKey(env('STRIPE_SECRET')); $data = \Stripe\Issuing\Cardholder::list()->json();
Do you see any errors?
We've narrowed down where the error is likely happening but it is important to see the error itself to address it
the error before then rather
yes please. This is the error am getting.
Is it possible to hit this endpoint
/v1/issuing/cardholders with the stripe library installed and how would it be done please
that's exactly what Pompey said above
Really you seem to be mixing things up with your own templating system but the first step is to call Stripe's API and look at the response
Still facing the same issues
If its possible can you please spear some few seconds of your time and make a quick demo on that so we know how to get things up and running.
Laravel cashier doesn't come along with this feature .
We gave you the exact PHP code to use above, there's not much more to it than this though. I don't understand the problem you have
the data thing in your screenshot is purely due to your own template
you need to ignore that completely for a few minutes and just focus purely on the PHP code that calls our API and log the information you get back
does that make sense?
@gusty talon did that make sense? Are you making progress?
@rugged heron please am still working on it please
sounds good!
@gusty talon please talk here, no reason to DM with the same question
and I already explained above, I gave you the exact doc and my colleague gave you the exact PHP code
Ok Snr
You shouldn't think about a "url" or anything like that
It's really simple PHP. If you could share your exact code that would really help I think
Can i share via GitHub ?
please here is the exact code . A cardholder has already been created but retrieving the cardholders details in a json format that's where the issue is still for me. When I work with the stripe payment and other features with this same method it works but for the stripe issuing it doesn't .
please don't share pictures of code
and move away from Laravel completely for a bit
you need to focus on the basics of PHP first
just write a one-off PHP script that does any API Request with Stripe as you don't seem to have used it before
but really as the developer, you should be logging the content of what is returned on line 18 of your 3rd screenshot
Ok Snr
that's what's blocking your right now, you call Stripe and have no idea if that call worked
I'd also remove the ->json() entirely
let me know if that doesn't make sense
Am refactoring my code now based on your information please
sounds good
whiles trying to retrieve the data which is been stored inside my variable with the new method am using. Am getting the error $data not defined. What I did was clear the foreach statement and also removed the ->json() and that's when this error came up again please.
yeah you're still deep in Laravel and not really understanding the code
you really need to stop for a few minutes. Don't look at Laravel, UIs, templates
just add good old echo and var_dump calls to your PHP please
Alright
there is no error appearing now but the data from the api is not showing up when i call the function inside the var_dump(list());
what does var_dump(list()); mean? What even is list();?
Please share real code (not pictures) of that exact part
What I meant to say was I tried dumping the data from the Api to my view using the print_r($list); The $list is the name i gave to my controller.
Am going to pause the development with laravel and use the normal php structure for now and see if that would work. After it does then I redevelop it with laravel . Thanks very much for your support.