Skip to content

remisb/stripeuse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API keys

Key publishable: pk_test_48VYROIMG5lQXPPvE7lFGdOg007hVI6jfGKey secret:sk_test_n287Bossh5n9yH7zyC6mXZIf00guWEHwUL`

go get -u github.com/stripe/stripe-go

import (
  "github.com/stripe/stripe-go/v71"
)

Notes

  • Accept a payment - Payment Intents API
    • steps:
      • creating an object to track a payment | PaymentIntent
      • collecting card information
      • submitting the payment to stripe for processing

Objects

PaymentIntent

PaymentIntent is used to track and handle all the states of the payment until it's completed. It represents your intent to collect payment from a customer, tracking charge attempts and payment state changes throughout process.

Steps:

  1. Setup a Stripe / Server-side

Use go get -u github.com/stripe/stripe-go and import "github.com/stripe/stripe-go/v71".

  1. Create a PaymentIntent / Server-side

Create a PaymentIntent on your server with an amount and currency.

  1. Collect card details / Client - side

JavaScript side documentation stripe.confirmPayment(...) Client Side Stripe UI elements - Stripe Elements Stipe Checkout Forms - Custom Forms

Finding solution

a) required data.publishableKey from the response b) returned data = {client_secret: "pi_1GvRVvGo53Y1bozf8Vz2dWCk_secret_WgwbYcMXsJGgAE9YDslVh8p16"}

//on line 42
var setupElements = function(data) {...}

Questions

  • When to use ChargeParams?
params := &stripe.ChargeParams{
  Amount: stripe.Int64(2000),
  Currency: stripe.String("eur"),
}
...
charge.New(params)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages