#cachopinn
1 messages · Page 1 of 1 (latest)
Hello! Feel free to ask here
@grim moat please ask your question in the thread
Copy-pasting your question here:
I need to create the following type of subscription!
it is a membership,
I offer the user to make a first payment of $ 0.50 at the time of signing up for the membership, and after 24h if he is happy and accepts, I charge him automatically in the form of subscription (membership) $ 19.99 each month.
how do i create or design this rule or this configuration in stripe?
greetings and thank you
P.S this configuration is for all customers the same. and these variants must be connected so that first 0.50$ is charged and after 24h of that single payment, the 19.99$ is charged and at the time of charging it automatically renews after 30 days if the customer agrees with the membership.
How do I do it?
thank you, ! I have the following question,
I need to create the following type of subscription!
it is a membership,
I offer the user to make a first payment of $ 0.50 at the time of signing up for the membership, and after 24h if he is happy and accepts, I charge him automatically in the form of subscription (membership) $ 19.99 each month.
how do i create or design this rule or this configuration in stripe?
greetings and thank you
P.S this configuration is for all customers the same. and these variants must be connected so that first 0.50$ is charged and after 24h of that single payment, the 19.99$ is charged and at the time of charging it automatically renews after 30 days if the customer agrees with the membership.
How do I do it? i repeat here=)!
@grim moat I'm talking to multiple folks at once here - sorry if there's some lag time between messages
Again, if you have a thread that's open you can expect responses here - no need to go back to the main channel
Let me try one thing to make sure what I'm about to suggest works
no please do not worry, I am new to the server and do not know the dynamics, of course! i wait. thank you
So what you can do is create a Subscription with trial_period_days: 1 , give it the 19.99 price, and set add_invoice_items to include a 0.50 price - this will give you a first invoice that charges $0.50 and when the trial is over after 24 hours it'll charge the full 19.99
ok, and how do I create it, how do I create it where the product is created, how do I configure it, (I'm going to show you in English) a screenshot.
spanish*
is it created in the product configuration? or what would be the routing, thanks for your help in advance
Ah, so you're not planning on using the API? YOu're only planning on using the dashboard?
yes of course, yes i use the api, in fact it is configured like that, where do i use it? in a script made in html. i don't use wordpress or any other platform.
my question is where and how do I make this configuration according to these rules?
You mention a script made in html - do you not have a backend server that's calling stripe's API? That's not somethign that you would write in html
Are you planning on using somethign like checkout? Payment links? Or are you using the dashboard?
hey sorry im used codeigniter this is php not html
public function verify($type)
{
$this->load->model('payment_model');
switch ($type) {
case 'paypal':
$this->_verify_paypal();
break;
case 'stripe':
$this->_verify_stripe();
break;
default:
redirect();
break;
}
}
had to delete that message because you put your api keys in there (you should roll those right away)
ok im delete apis
this is the second part of code
and this is config of api
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/*
|--------------------------------------------------------------------------
| Stripe Config |
|---|
| Create a subscription signup form using Checkout, and use the Stripe API to complete the signup process. |
| site: https://stripe.com/docs/recipes/subscription-signup |
| user: https://dashboard.stripe.com/account/apikeys |
| */ |
$config['stripe_publishable_key'] = '#';
$config['stripe_secret_key'] = '#';
$config['stripe_plan_id'] = '#';
Your code comment mentions Checkout - is that what you're planning on using?
the problem is im testing and everithing ok price etc and in the moment paid no execute 3d verification and redirect to home page
im need used first payment 0.50$ and in 24 hours get 19,99$ per example
but i dont know for what the code not work and in stripe cant see for create stripe plan
only give me ID price
what need add for work with my requeriments
Let's back up for a second
Are you planning on using Checkout (as hosted UI built by us) or are you collecting payment details in your own UI?
in the code shows a checkout I imagine that is yours, what I need is to be able to make or create a plan that charges $ 0.50 and is susbrcriot to the platform and in 24 hours you are charged example $ 19.99 and then month to month $ 19.99 and that I send you is the code I have, which currently does not work because when you make the payment with the credit card does not open the 3D verification and returns to the home does not deliver the product because the payment was not made correctly
If you're using Checkout Sessions then you can still do what I described - you'd include both prices (the 19.99 recurring one and the 0.50 one) in line_items (https://stripe.com/docs/api/checkout/sessions/create) and you'd set subscription_data.trial_period_end: 1 (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-trial_period_days)
mmmm
Are you following specific docs? right now it looks like you're using a really old legacy version of checkout (https://stripe.com/docs/payments/checkout/migration) that we don't recommend
$site_product = $this->config->item('site_product');
// Create a Customer:
$customer = \Stripe\Customer::create(array(
"email" => $email,
"source" => $token,
));
/** @var \Stripe\Subscription $subscription */
$subscription = \Stripe\Subscription::create(array(
'customer' => $customer->id,
'items' => array(
array(
'plan' => $stripe_plan_id
)
),
));
if ($subscription->status == 'active') {
if (ENVIRONMENT === 'production' || ENVIRONMENT === 'testing') {
$this->_send_email($email, $site_product['pdf']);
}
$site_product = $this->config->item('site_product');
$price_stripe = $site_product['price_stripe'];
$price_stripe = $price_stripe / 100;
// Register payment
$data = array(
'amount' => $price_stripe,
'method' => 'Stripe',
'status' => 'paid'
);
in this code have sub for stripe plan id
Yeah as I mentioned already you're using Subscriptons with a VERY old, deprecated version of CHeckout we don't recommend. If you want to continue using this and create the Subscription yourself then you need to do what I recommended and update your subscription creation code to set trial_period_days: 1 and add_invoice_items[0][price] to a price ID for your $0.50 one time price
If you want to move to the newer version of CHeckout (which I STRONGLY recommend) then you should look into our migration guide (https://stripe.com/docs/payments/checkout/migration) and how to use Chkecout w/ subscriptoins (https://stripe.com/docs/billing/subscriptions/build-subscriptions).
If you want to be able to have customer sign up for subscriptions with the least development work possible, you should evaluate whether Payment Links can meet your needs:
the problem is that I already have this code in my old script and the thing is to add these new variables in the code that I already have but I do not know where to start can you help me ? or is it very complex [?
This allows you to share a link or put a button (or Pricing Table) on your site with a pre-made snippet that your customer can use to visit checkout and sign up
the problem if the user paid and redirect to my thankyou page for give the download
Is that something you need mroe help with? We can guide you on integration work you're doing but we do need you to be a bit more specific in what you're trying to achieve in order to help.
karbi explained above how to achieve an up front payment and trial, which you can implement in your code if needed, but there is no ready-made snippet for this for a custom integration. If you want lower development effort, something like Payment Links offers that.