#ferdinand-achct

1 messages · Page 1 of 1 (latest)

pallid wave
#

do you have the src_xxx ID of the ACT CT source you're testing with and got the error with?

stoic oxide
#

yes i store it the source ID. but no problem

#

just only made a charge that couse error

pallid wave
#

can you post it here?

stoic oxide
#

this : src_1LGJDUJsUSqCav3DIP5LupCp
can be track? because i still use testing mode

pallid wave
#

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?

stoic oxide
#

ahh... 80 cents?

#

not $40?

pallid wave
#

yes

#

it's 40 cents

stoic oxide
#

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.

pallid wave
#

yeah that seems a little unusual

pallid wave
#

I'm not sure why it shows two transactions for $50 though instead of one for $100, I really don't know

stoic oxide
#

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?

pallid wave
#

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

stoic oxide
#

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?

pallid wave
south bronze
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!

stoic oxide
#

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

south bronze
#

So you've created the webhook it in your Dashboard?

#

have you built the webhook handler?

stoic oxide
#

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

south bronze
#

Ok, and what's the exact issue? It's just not receiving any events?

stoic oxide
south bronze
#

Can you share an evt_xxx ID that you're expecting to receive?

stoic oxide
#

ahh. is the same as my last upload pic?

south bronze
south bronze
stoic oxide
#

evt_1LGKUoJsUSqCav3DeXDUHnG5
evt_1LGKTPJsUSqCav3DS0U7CA0B
evt_1LGKSSJsUSqCav3DM8OzFxmL
evt_1LGKSSJsUSqCav3D1C6Ucu9v
evt_1LGKSSJsUSqCav3D7dSaV47t

#

ahhh

#

because of this?

south bronze
#

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

stoic oxide
#

ehm.. can i delete my registered endpoint?

south bronze
#

Yep, in the Dashboard

#

But you need to fix your code, this isn't an issue with the Stripe webhook

stoic oxide
#

ahhh that button. ok i try

#

ah sorry. i still confuse

#

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"

south bronze
#

Is this a different issue to the webhook?

stoic oxide
#

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

south bronze
#

It should do yep. What's the issue?

#

Can you share the src_xxx?

stoic oxide
#

sorry bit confuse

#

which event name for me to set it to my endpoint for capture this event evt_1LGKoxJsUSqCav3D9HIDF5S6

#

?

south bronze
#

source.transaction.created

stoic oxide
#

because the flow is, i need to wait the customer to transfer their money, so later it will trigger charge code. isn't?

stoic oxide
south bronze
south bronze
stoic oxide
#

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

south bronze
#

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

stoic oxide
#

is this stripe issue?

#

ah~~ so that is event name?

south bronze
#

Why do you not pass the amount_xxx on creation?

stoic oxide
#

oh how?

#

can i?

south bronze
#

Just like you would on update:

owner: {email: 'amount_6500@example.com'},
stoic oxide
#

oh already

#

is there any method to pass the amount?

south bronze
#

Not in testing no

stoic oxide
#

ok i still trying the code. i will update if i have an issue

stoic oxide
#

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

glass pollen
#

Hi! I'm taking over this thread.

#

Could you try to summarize your question/issue?

stoic oxide
#

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

Use Sources to accept ACH payments sent directly from your customers.

#

can check the source_id = src_1LGLukJsUSqCav3Dlsc0Np8v

glass pollen
stoic oxide
#

ah i fixed. just only my code

#

no problem. now ok

#

thakn you for your help

#

and teams

#

i can integrate the ACH Credit transfer now