#Flash-questions

1 messages · Page 1 of 1 (latest)

small hazelBOT
scenic holly
#

Flash-questions

#

Yo how do I make a checkout link with just payment ID
hello, can you clarify what you've integrated so far? like are you just getting started?

pliant pagoda
#

i am using the golang stripe library heres the code i have rn to create the payment intent

func createPaymentIntent(price int, serviceID int, link string, amount int) (*stripe.PaymentIntent, error) {
    c := client.New(utils.StripeKey, nil)

    params := &stripe.PaymentIntentParams{
        Amount:   stripe.Int64(int64(price)),
        Currency: stripe.String("usd"),
    }

    intent, err := c.PaymentIntents.New(params)
    if err != nil {
        return nil, err
    }
    return intent, nil
}

then i got this code where im tryna return the payment url here so someone can make a payment

func HandleBuycommand(serviceID int, link string, amount int) *stripe.PaymentIntent {
    price, ok := prices[amount]
    if !ok {
        return nil
    }
    s, err := createPaymentIntent(price, serviceID, link, amount)
    if s == nil {
        fmt.Println(err)
        return nil
    }
    return s.ID
    
}```
#

rn i just have it returning the ID so how can i get a link to send out from it ig

scenic holly
olive bloom
#

alr

#

do i have to import a specific version of stripe-go cause payment links aint showin up

scenic holly
#

what version of stripe-go are you on

olive bloom
scenic holly
#

yeah it is a typed language so the classes for Payment Links were introduced in a particular release (and you had the release before it presumably)

small hazelBOT
olive bloom
#

ah i see

#

one more question tho i see in the params of the payment link you need price id i was wondering how to get that cuz ive never used stripe

scenic holly