#cachopinn

1 messages · Page 1 of 1 (latest)

strong hamletBOT
clear monolith
#

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?

grim moat
#

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=)!

clear monolith
#

@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

grim moat
#

no please do not worry, I am new to the server and do not know the dynamics, of course! i wait. thank you

clear monolith
#

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

grim moat
#

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

clear monolith
#

Ah, so you're not planning on using the API? YOu're only planning on using the dashboard?

grim moat
#

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?

clear monolith
#

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?

grim moat
#

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;
    }
}
clear monolith
#

had to delete that message because you put your api keys in there (you should roll those right away)

grim moat
#

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'] = '#';

clear monolith
#

Your code comment mentions Checkout - is that what you're planning on using?

grim moat
#

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

clear monolith
#

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?

grim moat
#

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

clear monolith
grim moat
#

mmmm

clear monolith
grim moat
#

$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

clear monolith
#

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

strong hamletBOT
grim moat
#

and no have any pre-code already ready ?

#

im no 100% expert developer

heady delta
#

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:

grim moat
#

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 [?

heady delta
#

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

grim moat
#

the problem if the user paid and redirect to my thankyou page for give the download

heady delta
#

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.

grim moat
#

but the link paid dont have for put first 0.50$ and next day charge 19.99$ and next month charge continue charge 19.99$

heady delta
#

You should be able to "add a product" to a recurring subscription price via payment link:

#

one recurring item and one fixed price

#

Note my screenshot is from my own dashboard while creating a payment link, the preview UI you're looking at does not allow this