#DaanVDH

1 messages · Page 1 of 1 (latest)

shrewd deltaBOT
open forum
#

Yeah we have a few hosted solutions: Checkout, Payment Links and Invoices

crystal perch
#

Do all of these support hooks?

open forum
#

Webhooks?

crystal perch
#

Yes

open forum
#

Yeah they do. Under the hood they use all the same Stripe objects

crystal perch
#

I'm having a bit of trouble because for every other payment method type I'm creating the payment method on the server and then create an intent with that payment method and if successful send the redirect URL to the client side to confirm their payment. But if i want to do that for cards is need to fill in the SAQ D,

is there a way to create a payment method without prefilling the card information and creating a redirect URL like you do with all the other payment method types?

#

I don't want to change the whole payment flow only for card payments

open forum
#

I'm a bit confused on your flow. If you use one of the hosted solutions, there's no need to create a Payment Method explicitly. Your customer checking out will have that done for them automatically

crystal perch
#

I'm not using any of the hosted solutions right now, I'm doing it on my server.

#

go

    switch method {
    case Card:
        params := &stripe.PaymentMethodParams{
            Card: &stripe.PaymentMethodCardParams{
                Number:   stripe.String(fmt.Sprintf("%v", cardParams.CardNumber)),
                ExpMonth: stripe.String(fmt.Sprintf("%v", cardParams.ExpireMonth)),
                ExpYear:  stripe.String(fmt.Sprintf("%v", cardParams.ExpireYear)),
                CVC:      stripe.String(fmt.Sprintf("%v", cardParams.CVC)),
            },
            Type: stripe.String("card"),
            BillingDetails: &stripe.BillingDetailsParams{
                Address: &stripe.AddressParams{
                    City:       stripe.String(order.BillingInfo.City),
                    Country:    stripe.String(order.BillingInfo.Country),
                    Line1:      stripe.String(fmt.Sprintf("%v %v", order.BillingInfo.Street, order.BillingInfo.HouseNumber)),
                    PostalCode: stripe.String(order.BillingInfo.PostalCode),
                    State:      stripe.String(order.BillingInfo.State),
                },
                Email: stripe.String(order.OrderEmail),
                Name:  stripe.String(fmt.Sprintf("%v %v", order.BillingInfo.FirstName, order.BillingInfo.LastName)),
                Phone: stripe.String(fmt.Sprintf("%v", order.BillingInfo.PhoneNumber)),
            },
        }
        params.SetStripeAccount(accountId)
        pm, err := paymentmethod.New(params)
        if err != nil {
            return nil, err
        }
        return pm, nil

this is the example for a card payment right now

open forum