stripego

package module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 4 Imported by: 0

README

stripego

CodeQL Go Linter MIT license Codecov Go Reference

Made stripe integration easy based on the official Stripe Go client library.

Requirements

Go 1.19 or later

Installation

Use Go Modules in your project:

go mod init <project>

Then, reference stripego in your code:

import (
	"github.com/pilinux/stripego"
)

Add the missing dependencies by tidying up go.mod file:

go mod tidy

Features

PaymentIntent
  • create a new PaymentIntent object
  • update the amount of an existing PaymentIntent object
  • update the payment method of an existing PaymentIntent object
  • cancel an existing PaymentIntent object
Transfer
  • transfer balance to a connected Stripe account
Transaction
  • get details of a balance transaction

Usage

Please check the test files.

Documentation

Overview

Package stripego makes stripe integration easy in go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancelPaymentIntent

func CancelPaymentIntent(sk, paymentIntentID string) (piRes *stripe.PaymentIntent, err error)

CancelPaymentIntent - cancel an existing PaymentIntent object in stripe

func CreatePaymentIntent

func CreatePaymentIntent(sk string, piReq stripe.PaymentIntentParams) (piRes *stripe.PaymentIntent, err error)

CreatePaymentIntent - create a new PaymentIntent object in stripe

func GetBalanceTx added in v0.1.2

func GetBalanceTx(sk, bTxID string) (txn *stripe.BalanceTransaction, err error)

GetBalanceTx - get details of a balance transaction in Stripe

func TransferBalance

func TransferBalance(sk string, tp *stripe.TransferParams) (tRes *stripe.Transfer, err error)

TransferBalance - transfer balance to a connected Stripe account

func UpdateAmountPaymentIntent

func UpdateAmountPaymentIntent(sk, paymentIntentID string, newAmount int64) (piRes *stripe.PaymentIntent, err error)

UpdateAmountPaymentIntent - update the amount of an existing PaymentIntent object in stripe

func UpdateMethodPaymentIntent

func UpdateMethodPaymentIntent(sk, paymentIntentID string, pm *stripe.PaymentMethod) (piRes *stripe.PaymentIntent, err error)

UpdateMethodPaymentIntent - update the payment method of an existing PaymentIntent object in stripe

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL