#ferdinand-achct
1 messages · Page 1 of 1 (latest)
do you have the src_xxx ID of the ACT CT source you're testing with and got the error with?
yes i store it the source ID. but no problem
just only made a charge that couse error
can you post it here?
this : src_1LGJDUJsUSqCav3DIP5LupCp
can be track? because i still use testing mode
so you can see all information and logs on https://dashboard.stripe.com/test/sources/src_1LGJDUJsUSqCav3DIP5LupCp , to start with
you can see the source has 80 cents on it ($0.80)
you do a bunch of API request to try to charge it that don't work because for example
- you try to charge 40 cents, but there's a minimum amount of 50 cents for any charge in Stripe , so that's not possible
- you try to charge 8000 cents, which is more than what is on the source
does that help?
ahhhhh
understand. i still have a another question
now i'm trying to test with other amount. "amount_5000@example.com" this mean $50 right?
return Source id = src_1LGJr4JsUSqCav3DwheSjqmb
then i run only 1 time this code. for test a transfer from customer
$stripe = new \Stripe\StripeClient('sk_test_xxx');
$data = $stripe->sources->update(
'src_1LGJr4JsUSqCav3DwheSjqmb',
['owner' => ['email' => 'amount_5000@example.com']]
);
but when i check the history list witxxh this code :
\Stripe\Stripe::setApiKey('sk_test_x');
$data = Stripe\Source::allSourceTransactions('src_1LGJr4JsUSqCav3DwheSjqmb');
seems it transfer 2 times
object(Stripe\Collection)#565 (4) {
["object"]=>
string(4) "list"
["data"]=>
array(2) {
[0]=>
object(Stripe\SourceTransaction)#1499 (10) {
["id"]=>
string(31) "srctxn_1LGJtFJsUSqCav3Dk0UAdmc3"
["object"]=>
string(18) "source_transaction"
["ach_credit_transfer"]=>
object(Stripe\StripeObject)#1504 (3) {
["fingerprint"]=>
string(16) "EjosqeE61lIAJmPV"
["last4"]=>
string(4) "e72a"
["routing_number"]=>
string(9) "110000000"
}
["amount"]=>
int(5000)
["created"]=>
int(1656582145)
["currency"]=>
string(3) "usd"
["livemode"]=>
bool(false)
["source"]=>
string(28) "src_1LGJr4JsUSqCav3DwheSjqmb"
["status"]=>
string(9) "succeeded"
["type"]=>
string(19) "ach_credit_transfer"
}
[1]=>
object(Stripe\SourceTransaction)#1500 (10) {
["id"]=>
string(31) "srctxn_1LGJr7JsUSqCav3DzRCG7Omq"
["object"]=>
string(18) "source_transaction"
["ach_credit_transfer"]=>
object(Stripe\StripeObject)#1512 (3) {
["fingerprint"]=>
string(16) "EjosqeE61lIAJmPV"
["last4"]=>
string(4) "e72a"
["routing_number"]=>
string(9) "110000000"
}
["amount"]=>
int(5000)
["created"]=>
int(1656582013)
["currency"]=>
string(3) "usd"
["livemode"]=>
bool(false)
["source"]=>
string(28) "src_1LGJr4JsUSqCav3DwheSjqmb"
["status"]=>
string(9) "succeeded"
["type"]=>
string(19) "ach_credit_transfer"
}
}
["has_more"]=>
bool(false)
["url"]=>
string(60) "/v1/sources/src_1LGJr4JsUSqCav3DwheSjqmb/source_transactions"
i confuse. why it can transfer 2 times.
i just want to charge $50.
yeah that seems a little unusual
but you passed $100 in your API request? (https://dashboard.stripe.com/test/logs/req_LG07BRxRxNyV6G)
I'm not sure why it shows two transactions for $50 though instead of one for $100, I really don't know
i use laravel for this.. i tried setup new laravel and only test for this. and result is same. transfer 2 times.
how do i can prevent this?
does it matter really?
like you called the API to charge $100 and $100 was charged, I'm not sure internally why it creates two source transactions but if it's not causing an issue it might be possible to ignore it
maybe this only testing. the real case, customer will transfer with correct amount. isn't?
ah can ask about webhook for this?
on my understanding. the flow for webhook is triggered after customer transfer a money. isn't?
https://stripe.com/docs/sources/ach-credit-transfer#charge-confirmation should help with that
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!
hi @south bronze
thank you for you response.. i still confuse how to integrate the webhook
i already registered the link for webhook
i mean endpoint
So you've created the webhook it in your Dashboard?
have you built the webhook handler?
yes.. already. i already tested on my local and work for that webhook handler.. like this
<?php
namespace App\Http\Controllers\API;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Stripe;
class StripeController extends Controller
{
public function index(Request $request)
{
\Log::info("WEBHOOK STRIPE ACH Credit");
\Log::info($request);
}
}
just a simple code to detect any response that come from stripe
Ok, and what's the exact issue? It's just not receiving any events?
i registered this endpoint https://2f01-111-95-148-143.ap.ngrok.io/api/stripe to webhook stripe and add all event on charge
yes..
Can you share an evt_xxx ID that you're expecting to receive?
Also, I'd recommend trying out the Stripe CLI for forwarding events locally (rather than an ngrok tunnel): https://stripe.com/docs/stripe-cli
Can you paste one of those evt_xxx IDs?
evt_1LGKUoJsUSqCav3DeXDUHnG5
evt_1LGKTPJsUSqCav3DS0U7CA0B
evt_1LGKSSJsUSqCav3DM8OzFxmL
evt_1LGKSSJsUSqCav3D1C6Ucu9v
evt_1LGKSSJsUSqCav3D7dSaV47t
ahhh
because of this?
Your endpoint is returning a 405. You can see the full error in the Dashboard
Yeah, expand those events and it'll log the response
Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException: The POST method is not supported for this route. Supported methods: GET, HEAD. in file /Users/ferdinandgushcloud/Desktop/bankably/vendor/laravel/framework/src/Illuminate/Routing/AbstractRouteCollection.php on line 118
Sounds like you need to allow your endpoint to handle POST requests
ehm.. can i delete my registered endpoint?
Yep, in the Dashboard
But you need to fix your code, this isn't an issue with the Stripe webhook
ahhh that button. ok i try
ah sorry. i still confuse
base on this documentation https://stripe.com/docs/sources/ach-credit-transfer#testing-ach-credit-transfer-payments
after i make a source.
e.g. case i charge to customer with $50.. after a create a source.. and send back to customer information about amount and routing and account number.
currenct status: "pending"
Is this a different issue to the webhook?
still same.
but when i run this code
so i run this code
$stripe = new \Stripe\StripeClient('xxxx');
$stripe->sources->update(
'src_18cPLvAHEMiOZZp1YBngt6En',
['owner' => ['email' => 'amount_5000@example.com']]
);
this is update the source to receivce amount $50 right
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
sorry bit confuse
which event name for me to set it to my endpoint for capture this event evt_1LGKoxJsUSqCav3D9HIDF5S6
?
source.transaction.created
because the flow is, i need to wait the customer to transfer their money, so later it will trigger charge code. isn't?
ahh let me set it
You're setting amount_6500: https://dashboard.stripe.com/test/logs/req_Q1soN2Vz3b8eDs
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
The code you shared references a different src_xxx ID
ah sorry. i just test with email amount_6500@example.com and got source ID src_1LGKoUJsUSqCav3DgkCKWWYB
im not sure what happen. but when i run this code
$stripe = new \Stripe\StripeClient('xxx');
$data = $stripe->sources->update(
'src_1LGKoUJsUSqCav3DgkCKWWYB',
['owner' => ['email' => 'amount_6500@example.com']]
);
it run twice
evt_1LGKoxJsUSqCav3D9HIDF5S6
evt_1LGKoWJsUSqCav3DEr3m7z1t
i was asked this also with @pallid wave before
To be clear, the API call isn't being made twice but for some reason it's firing the event twice
And creating 2x Source Transactions yeah. Weird
Why do you not pass the amount_xxx on creation?
Just like you would on update:
owner: {email: 'amount_6500@example.com'},
Not in testing no
ok i still trying the code. i will update if i have an issue
sorry i got this error
ocal.ERROR: The source type ach_credit_transfer is not immediately chargeable. Only immediately chargeable sources can be created through /v1/charges
after i added event "source.transaction.created" on my endpoint.. it able to trigger my function to run a charge
but display that error..
i use laravel to integrate that. i just only build a simple code
$source_id = $request->data['object']['source'];
$stripe = Stripe::where('source_id', $source_id)->first();
if($stripe){
\Stripe\Stripe::setApiKey('xxx');
$charge = \Stripe\Charge::create([
'amount' => 1000,
'currency' => 'usd',
'customer' => $stripe->toArray()['customer_stripe_id'],
'source' => $source_id,
]);
}
when create charge. i store the sourec_id, register the customer id. on table "stripe"..
after identify the payment from the customer. i will check the source_id. if true.. will direct run the stripe charge. but display that error
oh Hi! @glass pollen thank you
Ah. ok.. so now i'm integrating ACH Credit transfer. i use laravel.
now. i on step https://stripe.com/docs/sources/ach-credit-transfer#testing-ach-credit-transfer-payments
so what i'm trying to do is, when customer deposit their money. it will trigger my endpoint to run a charge function..
but i got this error =
local.ERROR: The source type ach_credit_transfer is not immediately chargeable. Only immediately chargeable sources can be created through /v1/charges.
so im confuse
can check the source_id = src_1LGLukJsUSqCav3Dlsc0Np8v
Can you share the request ID (req_xxx) that generates the error message? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request