#carboncopper_api

1 messages · Page 1 of 1 (latest)

ember aspenBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1393198761794342962

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

unborn crow
#
// Server side PHP

$confirmationToken = $_REQUEST['confirmation_token'];
$product = \Stripe\Product::create([
    'name' => $description
]);
$price = \Stripe\Price::create([
    'unit_amount' => 1000,
    'currency' => 'gbp',
    'recurring' => [
        'interval' => 'month',
        'interval_count' => 1
    ],
    'product' => $product->id,
]);
$customer = \Stripe\Customer::create([
    'email' => 'john.doe@example.com',
    'name' => 'John Doe',
    'description' => 'Hello world',
    'address' => [
        'city' => 'Beverly Hills',
        'country' => 'US',
        'line1' => '123 Main St',
        'line2' => '',
        'postal_code' => '90210',
        'state' => 'CA',
    ]
]);
$subscription = \Stripe\Subscription::create([
    'customer' => $customer->id,
    'description' => 'Hello world',
    'items' => [
        [ 'price' => $price->id ]
    ],
    'collection_method' => 'charge_automatically',
    'payment_behavior' => 'default_incomplete',
    'expand' => [ 'latest_invoice.payment_intent' ],
]);
$subscription->latest_invoice->payment_intent->confirm(
    [
        'confirmation_token' => $confirmationToken,
        'payment_method_types' => [ 'bacs_debit' ],
        'setup_future_usage' => 'off_session',
    ]
);
#

This are the request params I see in my Stripe dashboard log.

{
  "confirmation_token": "ctoken_1Rjf3c01ThkcLeVlVz7nSgCF",
  "payment_method_types": {
    "0": "bacs_debit"
  },
  "setup_future_usage": "off_session"
}

This makes me think the ['bacs_debit'] array got converted into a key-value JSON object by the PHP SDK.

wispy sundial
unborn crow
#

req_EEIaHDFKCnvdL6

wispy sundial
#

Remove payment_method_types from the request req_EEIaHDFKCnvdL6

#

Between, that PaymentIntent can accept only card or link, but not bacs

unborn crow
#

I don't understand what you want me to remove this from.

ember aspenBOT
wispy sundial
short token
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

unborn crow
#

So I see that I cannot use a confirmation token for Bacs subscriptions. I need to use Checkout instead. Is this possible to do without needing to redirect the customer from the site?

short token
#

why not just take the payment?

#

instead of saving the BACS and then creating the subscription

unborn crow
#

Do you mean I should create the subscription on the client side with Stripe.js?

#

This is for an ongoing subscription that debits the customer once a month.

short token
#

instead of saving the BACS and then creating the subscription
actually never mind what I said because that's the only way to do it

#

you need to first save the BACS DD PaymentMethod and then create the subscription

#

this is one of the limitations

#

and you can only do that with the Stripe Hosted Checkout Sessions

#

is to add a free trial to the subscription

#

and then it would be possible to do both things in the same time

unborn crow
#

Ok, thank you. I will need to do more research on Stripe Checkout.

tight panther
#

And How to enable bank transfer?
please help me

#

I run demo project

#

but I can 't see bank transfer

short token
#

@tight panther are you a colleague of @unborn crow ?

tight panther
#

No, But pls help me

short token
#

please open a new thread in #help

#

@unborn crow please let me know if you need any more help

unborn crow
#

I'm good for now, thanks.

tight panther
#

How to open new thread?

short token
#

you click on #help and then you click on one of the buttons there

tight panther
#

already done

short token
#

what did you choose?