#matiullahpro-transfer

1 messages · Page 1 of 1 (latest)

swift sequoia
#

Hi there! Can you clarify what you mean by transaction id here?

#

Do you mean you want the transfer ID itself?

rich sedge
#

transfer ID...

#

i wan to revarsal with the help of that ID

swift sequoia
#

Gotcha, so you want to set your request to a variable. Like:
$transfer = $stripepayout->transfers->create([...

#

Then after the request the id will be $transfer->id

rich sedge
#

ok

#

let me check it

rich sedge
#

but it not returning error... how can i achieve this?

swift sequoia
#

That error means that your account you are trying to transfer to is not fully enabled to receive transfers.

#

You should see that error in your server logs when you attempt the transfer

rich sedge
#

but i want to access these errors response on my website...

swift sequoia
rich sedge
#

unable to caught exception or error

#

return empty object only...

swift sequoia
#

Can you add an error_log to your server and see if it is catching it there?

rich sedge
#

storing $api_raw_response in database...

bronze badge
#

@rich sedge I'm not sure I understand what you are saying

rich sedge
#

stripeLog.png shows you permission error... in Code.png i add permission exception but it doesn't returning error in $api_raw_response variable...

bronze badge
#

@rich sedge I'm sorry but this doesn't really make sense to me right now. what even is $api_raw_response where does that come from?

rich sedge
#

$api_raw_response is a variable where i am trying to store stripe server response..

#

kindly reply...

#

how can i get error response "code": "insufficient_capabilities_for_transfer",

bronze badge
#

@rich sedge I am trying to help but I don't understand your question

rich sedge
#

Did you see permission error in stripeLog.png

#

I want that response... How can i get that response on my website?

bronze badge
#

You catch the error in PHP and you log the relevant information

#

that's exactly what the doc I linked you to tells you to do

rich sedge
#

A user has not submitted his information... So he is not able to receive payments/transfer from anyone...

bronze badge
#

that's why I'm asking to read that doc carefully

rich sedge
bronze badge
#

it feels like you are not reading my words

#

you're just saying many times it doesn't work

#

Can you please share your exact code for the Transfer creation? Not a picture, real code here in Discord

rich sedge
#

Ok

#

Ok

#

try {
$stripepayout = new \Stripe\StripeClient($stripe['secret_key']);
$transfers = $stripepayout->transfers->create([
'amount' => $val['amount']*100,
'currency' => 'usd',
'destination' => $val['account'],
]);

							$api_raw_response=json_encode($transfers);
							$status_msg='paid';
						  } catch(\Stripe\Exception\CardException $e) {
							$api_raw_response=json_encode($e);
							$status_msg='pending';
						  } catch (\Stripe\Exception\RateLimitException $e) {
							$api_raw_response=json_encode($e);
							$status_msg='pending';
						  } catch (\Stripe\Exception\RateLimitException $e) {
							  $api_raw_response=json_encode($e);
							$status_msg='pending';
							
						  } catch (\Stripe\Exception\ApiConnectionException $e) {
							  $api_raw_response=json_encode($e);
							$status_msg='pending';
						  } catch (\Stripe\Exception\PermissionException $e) {
							  $api_raw_response=json_encode($e);
							$status_msg='pending';
						  } catch (\Stripe\Exception\ApiErrorException $e) {
							  $api_raw_response=json_encode($e);
							$status_msg='pending';
						  } catch (Exception $e) {
							  $api_raw_response=json_encode($e);
							$status_msg='pending';
						  }
bronze badge
#

where does that json_encode come from? It's not on any of the PHP example on the entire page I gave you to look at first

#

which is why I keep asking if you can try and read that doc first

rich sedge
#

Ok .. that means i don't need to use json_encode for getting error and store into api_raw_response?

bronze badge
#

correct you don't

#
try {
  echo "Trying to create a Payout<br>";
  $stripepayout = new \Stripe\StripeClient($stripe['secret_key']);
  $transfers = $stripepayout->transfers->create([
      'amount' => $val['amount']*100,
      'currency' => 'usd',
      'destination' => $val['account'],
    ]);
  echo "succeeded!<br>";
} catch(\Stripe\Exception\CardException $e) {
  echo "an error occurred " .$e->getError()->message;
} catch (\Stripe\Exception\InvalidRequestException $e) {
  error_log("An invalid request occuurred.");
  echo "an error occurred " . $e->getError()->message;
} catch (Exception $e) {
  echo "an error occurred that isn't Stripe";
  var_dump($e);
}```
#

example try this ^

#

that will display the error message from $e->getError()->message and you can use $e->getError()->code to get the code

rich sedge
#

Ok Sir, it's really help me... That you Sir.

bronze badge
#

of course

#

let me know if you are still blocked