AuthorizeCIM

package module
Version: v0.0.0-...-39ec4eb Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 6 Imported by: 0

README

alt tag

Authorize.net CIM, AIM, and ARB for Go Language

Build Status Code Climate Coverage Status GoDoc Go Report Card

Give your Go Language applications the ability to store and retrieve credit cards from Authorize.net CIM, AIM, and ARB API. This golang package lets you create recurring subscriptions, AUTH only transactions, voids, refunds, and other functionality connected to the Authorize.net API.


Features

customer := AuthorizeCIM.Customer{
        ID: "13838",
    }

customerInfo := customer.Info()

paymentProfiles := customerInfo.PaymentProfiles()
shippingProfiles := customerInfo.ShippingProfiles()
subscriptions := customerInfo.Subscriptions()

Usage

  • Import package
go get gopkg.in/hunterlong/authorizecim.v1
import "gopkg.in/hunterlong/authorizecim.v1"
Or Shorten the Package Name
import auth "gopkg.in/hunterlong/authorizecim.v1"
// auth.SetAPIInfo(apiName,apiKey,"test")

Set Authorize.net API Keys

You can get Sandbox Access at: https://developer.authorize.net/hello_world/sandbox/

apiName := "auth_name_here"
apiKey := "auth_transaction_key_here"
AuthorizeCIM.SetAPIInfo(apiName,apiKey,"test")
// use "live" to do transactions on production server

Included API References

✅ Set API Creds

func main() {

    apiName := "PQO38FSL"
    apiKey := "OQ8NFBAPA9DS"
    apiMode := "test"

    AuthorizeCIM.SetAPIInfo(apiName,apiKey,apiMode)

}

Payment Transactions

✅ chargeCard

newTransaction := AuthorizeCIM.NewTransaction{
		Amount: "15.90",
		CreditCard: CreditCard{
			CardNumber:     "4007000000027",
			ExpirationDate: "10/23",
		},
	}
response, err := newTransaction.Charge()
if response.Approved() {

}

✅ authorizeCard

newTransaction := AuthorizeCIM.NewTransaction{
		Amount: "100.00",
		CreditCard: CreditCard{
			CardNumber:     "4012888818888",
			ExpirationDate: "10/27",
		},
	}
response, err := newTransaction.AuthOnly()
if response.Approved() {

}

✅ capturePreviousCard

oldTransaction := AuthorizeCIM.PreviousTransaction{
		Amount: "49.99",
		RefId:  "AUTHCODEHERE001",
	}
response, err := oldTransaction.Capture()
if response.Approved() {

}

✅ captureAuthorizedCardChannel

newTransaction := AuthorizeCIM.NewTransaction{
		Amount: "38.00",
		CreditCard: CreditCard{
			CardNumber:     "4012888818888",
			ExpirationDate: "10/24",
		},
		AuthCode: "YOURAUTHCODE",
	}
response, err := newTransaction.Charge()
if response.Approved() {

}

✅ refundTransaction

newTransaction := AuthorizeCIM.NewTransaction{
		Amount: "15.00",
		CreditCard: CreditCard{
			CardNumber:     "4012888818888",
			ExpirationDate: "10/24",
		},
		RefTransId: "0392482938402",
	}
response, err := newTransaction.Refund()
if response.Approved() {

}

✅ voidTransaction

oldTransaction := AuthorizeCIM.PreviousTransaction{
		RefId: "3987324293834",
	}
response, err := oldTransaction.Void()
if response.Approved() {

}

◻️ updateSplitTenderGround

◻️ debitBankAccount

◻️ creditBankAccount

✅ chargeCustomerProfile

customer := AuthorizeCIM.Customer{
		ID: "49587345",
		PaymentID: "84392124324",
	}

newTransaction := AuthorizeCIM.NewTransaction{
		Amount: "35.00",
	}

response, err := newTransaction.ChargeProfile(customer)

if response.Ok() {

}

◻️ chargeTokenCard

◻️ creditAcceptPaymentTransaction

◻️ getAccessPaymentPage

◻️ getHostedPaymentPageRequest

Transaction Responses

response.Ok()                   // bool
response.Approved()             // bool
response.Message()              // string
response.ErrorMessage()         // string
response.TransactionID()        // string
response.AVS()                  // [avsResultCode,cavvResultCode,cvvResultCode]

Fraud Management

✅ getUnsettledTransactionListRequest

transactions := AuthorizeCIM.UnsettledBatchList()
fmt.Println("Unsettled Count: ", transactions.Count)

✅ updateHeldTransactionRequest

oldTransaction := AuthorizeCIM.PreviousTransaction{
		Amount: "49.99",
		RefId:  "39824723983",
	}

	response, err := oldTransaction.Approve()
	//response := oldTransaction.Decline()

	if response.Ok() {

	}

Recurring Billing

✅ ARBCreateSubscriptionRequest

subscription := AuthorizeCIM.Subscription{
		Name:        "New Subscription",
		Amount:      "9.00",
		TrialAmount: "0.00",
		PaymentSchedule: &PaymentSchedule{
			StartDate:        CurrentDate(),
			TotalOccurrences: "9999",
			TrialOccurrences: "0",
			Interval: AuthorizeCIM.IntervalMonthly(),
		},
		Payment: &Payment{
			CreditCard: CreditCard{
				CardNumber:     "4007000000027",
				ExpirationDate: "10/23",
			},
		},
		BillTo: &BillTo{
			FirstName: "Test",
			LastName:  "User",
		},
	}

response, err := subscription.Charge()

if response.Approved() {
    fmt.Println("New Subscription ID: ",response.SubscriptionID)
}
For Intervals, you can use simple methods
AuthorizeCIM.IntervalWeekly()      // runs every week (7 days)
AuthorizeCIM.IntervalMonthly()     // runs every Month
AuthorizeCIM.IntervalQuarterly()   // runs every 3 months
AuthorizeCIM.IntervalYearly()      // runs every 1 year
AuthorizeCIM.IntervalDays("15")    // runs every 15 days
AuthorizeCIM.IntervalMonths("6")   // runs every 6 months

✅ ARBCreateSubscriptionRequest from Customer Profile

subscription := AuthorizeCIM.Subscription{
		Name:        "New Customer Subscription",
		Amount:      "12.00",
		TrialAmount: "0.00",
		PaymentSchedule: &PaymentSchedule{
			StartDate:        CurrentDate(),
			TotalOccurrences: "9999",
			TrialOccurrences: "0",
			Interval: AuthorizeCIM.IntervalDays("15"),
		},
		Profile: &CustomerProfiler{
			CustomerProfileID: "823928379",
			CustomerPaymentProfileID: "183949200",
			//CustomerShippingProfileID: "310282443",
		},
	}

	response, err := subscription.Charge()

	if response.Approved() {
		newSubscriptionId = response.SubscriptionID
		fmt.Println("Customer #",response.CustomerProfileId(), " Created a New Subscription: ", response.SubscriptionID)
	}

✅ ARBGetSubscriptionRequest

sub := AuthorizeCIM.SetSubscription{
		Id: "2973984693",
	}

subscriptionInfo := sub.Info()

✅ ARBGetSubscriptionStatusRequest

sub := AuthorizeCIM.SetSubscription{
		Id: "2973984693",
	}

subscriptionInfo, err := sub.Status()

fmt.Println("Subscription ID has status: ",subscriptionInfo.Status)

✅ ARBUpdateSubscriptionRequest

subscription := AuthorizeCIM.Subscription{
		Payment: Payment{
			CreditCard: CreditCard{
				CardNumber:     "5424000000000015",
				ExpirationDate: "06/25",
			},
		},
		SubscriptionId: newSubscriptionId,
	}

response, err := subscription.Update()

if response.Ok() {

}

✅ ARBCancelSubscriptionRequest

sub := AuthorizeCIM.SetSubscription{
		Id: "2973984693",
	}

subscriptionInfo, err := sub.Cancel()

fmt.Println("Subscription ID has been canceled: ", sub.Id, "\n")

✅ ARBGetSubscriptionListRequest

inactive := AuthorizeCIM.SubscriptionList("subscriptionInactive")
fmt.Println("Amount of Inactive Subscriptions: ", inactive.Count())

active := AuthorizeCIM.SubscriptionList("subscriptionActive")
fmt.Println("Amount of Active Subscriptions: ", active.Count())

Customer Profile (CIM)

✅ createCustomerProfileRequest

customer := AuthorizeCIM.Profile{
		MerchantCustomerID: "86437",
		Email:              "info@emailhereooooo.com",
		PaymentProfiles: &PaymentProfiles{
			CustomerType: "individual",
			Payment: Payment{
				CreditCard: CreditCard{
					CardNumber:     "4007000000027",
					ExpirationDate: "10/23",
				},
			},
		},
	}

	response, err := customer.Create()

if response.Ok() {
    fmt.Println("New Customer Profile Created #",response.CustomerProfileID)
    fmt.Println("New Customer Payment Profile Created #",response.CustomerPaymentProfileID)
} else {
       fmt.Println(response.ErrorMessage())
   }

✅ getCustomerProfileRequest

customer := AuthorizeCIM.Customer{
		ID: "13838",
	}

customerInfo, err := customer.Info()

paymentProfiles := customerInfo.PaymentProfiles()
shippingProfiles := customerInfo.ShippingProfiles()
subscriptions := customerInfo.Subscriptions()

✅ getCustomerProfileIdsRequest

profiles, _ := AuthorizeCIM.GetProfileIds()
fmt.Println(profiles)

✅ updateCustomerProfileRequest

customer := AuthorizeCIM.Profile{
		MerchantCustomerID: "13838",
		CustomerProfileId: "13838",
		Description: "Updated Account",
		Email:       "info@updatedemail.com",
	}

	response := customer.Update()

if response.Ok() {

}

✅ deleteCustomerProfileRequest

customer := AuthorizeCIM.Customer{
		ID: "13838",
	}

	response, err := customer.Delete()

if response.Ok() {

}

Customer Payment Profile

✅ createCustomerPaymentProfileRequest

paymentProfile := AuthorizeCIM.CustomerPaymentProfile{
		CustomerProfileID: "32948234232",
		PaymentProfile: PaymentProfile{
			BillTo: BillTo{
				FirstName: "okokk",
				LastName: "okok",
				Address: "1111 white ct",
				City: "los angeles",
				Country: "USA",
				PhoneNumber: "8885555555",
			},
			Payment: Payment{
				CreditCard: CreditCard{
					CardNumber: "5424000000000015",
					ExpirationDate: "04/22",
				},
			},
			DefaultPaymentProfile: "true",
		},
	}

response, err := paymentProfile.Add()

if response.Ok() {

} else {
    fmt.Println(response.ErrorMessage())
}

✅ getCustomerPaymentProfileRequest

customer := AuthorizeCIM.Customer{
		ID: "3923482487",
	}

response, err := customer.Info()

paymentProfiles := response.PaymentProfiles()

✅ getCustomerPaymentProfileListRequest

profileIds := AuthorizeCIM.GetPaymentProfileIds("2017-03","cardsExpiringInMonth")

✅ validateCustomerPaymentProfileRequest

customerProfile := AuthorizeCIM.Customer{
		ID: "127723778",
		PaymentID: "984583934",
	}

response, err := customerProfile.Validate()

if response.Ok() {

}

✅ updateCustomerPaymentProfileRequest

customer := AuthorizeCIM.Profile{
		CustomerProfileId:  "3838238293",
		PaymentProfileId: "83929382739",
		Email:              "info@updatedemail.com",
		PaymentProfiles: &PaymentProfiles{
			Payment: Payment{
				CreditCard: CreditCard{
					CardNumber: "4007000000027",
					ExpirationDate: "01/26",
				},
			},
			BillTo: &BillTo{
				FirstName:   "newname",
				LastName:    "golang",
				Address:     "2841 purple ct",
				City:        "los angeles",
				State:		  "CA",
				Zip:            "93939",
				Country:     "USA",
				PhoneNumber: "8885555555",
			},
		},
	}

response, err := customer.UpdatePaymentProfile()

if response.Ok() {
    fmt.Println("Customer Payment Profile was Updated")
} else {
    fmt.Println(response.ErrorMessage())
}

✅ deleteCustomerPaymentProfileRequest

customer := AuthorizeCIM.Customer{
		ID: "3724823472",
		PaymentID: "98238472349",
	}

response, err := customer.DeletePaymentProfile()

if response.Ok() {
    fmt.Println("Payment Profile was Deleted")
} else {
    fmt.Println(response.ErrorMessage())
}

Customer Shipping Profile

✅ createCustomerShippingAddressRequest

customer := AuthorizeCIM.Profile{
		MerchantCustomerID: "86437",
		CustomerProfileId:  "7832642387",
		Email:              "info@emailhereooooo.com",
		Shipping: &Address{
			FirstName:   "My",
			LastName:    "Name",
			Company:     "none",
			Address:     "1111 yellow ave.",
			City:        "Los Angeles",
			State:       "CA",
			Zip:         "92039",
			Country:     "USA",
			PhoneNumber: "8885555555",
		},
	}

response, err := customer.CreateShipping()

if response.Ok() {
    fmt.Println("New Shipping Added: #",response.CustomerAddressID)
} else {
    fmt.Println(response.ErrorMessage())
}

✅ getCustomerShippingAddressRequest

customer := AuthorizeCIM.Customer{
		ID: "3842934233",
	}

response, err := customer.Info()

shippingProfiles := response.ShippingProfiles()

fmt.Println("Customer Shipping Profiles", shippingProfiles)

✅ updateCustomerShippingAddressRequest

customer := AuthorizeCIM.Profile{
		CustomerProfileId:  "398432389",
		CustomerAddressId: "848388438",
		Shipping: &Address{
			FirstName:   "My",
			LastName:    "Name",
			Company:     "none",
			Address:     "1111 yellow ave.",
			City:        "Los Angeles",
			State:       "CA",
			Zip:         "92039",
			Country:     "USA",
			PhoneNumber: "8885555555",
		},
	}

response, err := customer.UpdateShippingProfile()

if response.Ok() {
    fmt.Println("Shipping Profile was updated")
}

✅ deleteCustomerShippingAddressRequest

customer := AuthorizeCIM.Customer{
		ID: "128749382",
		ShippingID: "34892734829",
	}

	response, err := customer.DeleteShippingProfile()

	if response.Ok() {
		fmt.Println("Shipping Profile was Deleted")
	} else {
		fmt.Println(response.ErrorMessage())
	}

◻️ getHostedProfilePageRequest

◻️ createCustomerProfileFromTransactionRequest

Transaction Reporting

✅ getSettledBatchListRequest

list := AuthorizeCIM.Range{
		Start: LastWeek(),
		End:   Now(),
	}

batches := list.SettledBatch().List()

for _, v := range batches {
    t.Log("Batch ID: ", v.BatchID, "\n")
    t.Log("Payment Method: ", v.PaymentMethod, "\n")
    t.Log("State: ", v.SettlementState, "\n")
}

✅ getUnSettledBatchListRequest

batches := AuthorizeCIM.UnSettledBatch().List()

for _, v := range batches {
    t.Log("Status: ",v.TransactionStatus, "\n")
    t.Log("Amount: ",v.Amount, "\n")
    t.Log("Transaction ID: #",v.TransID, "\n")
}


✅ getTransactionListRequest

list := AuthorizeCIM.Range{
		BatchId: "6933560",
	}

batches := list.Transactions().List()

for _, v := range batches {
    t.Log("Transaction ID: ", v.TransID, "\n")
    t.Log("Amount: ", v.Amount, "\n")
    t.Log("Account: ", v.AccountNumber, "\n")
}

✅ getTransactionDetails

oldTransaction := AuthorizeCIM.PreviousTransaction{
		RefId: "60019493304",
	}
response := oldTransaction.Info()

fmt.PrintLn("Transaction Status: ",response.TransactionStatus,"\n")

✅ getBatchStatistics

list := AuthorizeCIM.Range{
		BatchId: "6933560",
	}

batch := list.Statistics()

fmt.PrintLn("Refund Count: ", batch.RefundCount, "\n")
fmt.PrintLn("Charge Count: ", batch.ChargeCount, "\n")
fmt.PrintLn("Void Count: ", batch.VoidCount, "\n")
fmt.PrintLn("Charge Amount: ", batch.ChargeAmount, "\n")
fmt.PrintLn("Refund Amount: ", batch.RefundAmount, "\n")

✅ getMerchantDetails

info := AuthorizeCIM.GetMerchantDetails()

fmt.PrintLn("Test Mode: ", info.IsTestMode, "\n")
fmt.PrintLn("Merchant Name: ", info.MerchantName, "\n")
fmt.PrintLn("Gateway ID: ", info.GatewayID, "\n")

ToDo

  • Organize and refactor some areas
  • Add Bank Account Support
  • Make tests fail if transactions fail (skipping 'duplicate transaction')
Authorize.net CIM Documentation

http://developer.authorize.net/api/reference/#customer-profiles

Authorize.net Sandbox Access

https://developer.authorize.net/hello_world/sandbox/

License

This golang package is release under MIT license. Feel free to submit a Pull Request if you have updates!

This software gets reponses in JSON, but Authorize.net currently says "JSON Support is in BETA, please contact us if you intend to use it in production." Make sure you test in sandbox mode!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChargeTokenCard

func ChargeTokenCard()

func CreditAcceptPaymentTransaction

func CreditAcceptPaymentTransaction()

func CreditBankAccount

func CreditBankAccount()

func CurrentDate

func CurrentDate() string

func DebitBankAccount

func DebitBankAccount()

func GetAccessPaymentPage

func GetAccessPaymentPage()

func GetHostedPaymentPage

func GetHostedPaymentPage()

func GetProfileIds

func GetProfileIds() ([]string, error)

func IsConnected

func IsConnected() (bool, error)

func LastMonth

func LastMonth() time.Time

func LastWeek

func LastWeek() time.Time

func LastYear

func LastYear() time.Time

func Now

func Now() time.Time

func SendRequest

func SendRequest(input []byte) ([]byte, error)

func SetAPIInfo

func SetAPIInfo(name string, key string, mode string)

func UpdateSplitTenderGround

func UpdateSplitTenderGround()

Types

type ARBCreateSubscriptionRequest

type ARBCreateSubscriptionRequest struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	RefID                  string                 `json:"refId,omitempty"`
	Subscription           Subscription           `json:"subscription"`
}

type ARBGetSubscriptionListRequest

type ARBGetSubscriptionListRequest struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	SearchType             string                 `json:"searchType"`
	Sorting                Sorting                `json:"sorting"`
	Paging                 Paging                 `json:"paging"`
}

type ARBGetSubscriptionRequest

type ARBGetSubscriptionRequest struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	RefID                  string                 `json:"refId"`
	SubscriptionID         string                 `json:"subscriptionId"`
}

type ARBUpdateSubscriptionRequest

type ARBUpdateSubscriptionRequest struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	RefID                  string                 `json:"refId,omitempty"`
	SubscriptionId         string                 `json:"subscriptionId,omitempty"`
	Subscription           Subscription           `json:"subscription,omitempty"`
}

type AVS

type AVS struct {
	// contains filtered or unexported fields
}

func (AVS) Text

func (r AVS) Text() string

type Address

type Address struct {
	FirstName         string `json:"firstName,omitempty"`
	LastName          string `json:"lastName,omitempty"`
	Company           string `json:"company,omitempty"`
	Address           string `json:"address,omitempty"`
	City              string `json:"city,omitempty"`
	State             string `json:"state,omitempty"`
	Zip               string `json:"zip,omitempty"`
	Country           string `json:"country,omitempty"`
	PhoneNumber       string `json:"phoneNumber,omitempty"`
	FaxNumber         string `json:"faxNumber,omitempty"`
	CustomerAddressID string `json:"customerAddressId,omitempty"`
}

type BatchList

type BatchList struct {
	BatchID                      string    `json:"batchId"`
	SettlementTimeUTC            time.Time `json:"settlementTimeUTC"`
	SettlementTimeUTCSpecified   bool      `json:"settlementTimeUTCSpecified"`
	SettlementTimeLocal          string    `json:"settlementTimeLocal"`
	SettlementTimeLocalSpecified bool      `json:"settlementTimeLocalSpecified"`
	SettlementState              string    `json:"settlementState"`
	PaymentMethod                string    `json:"paymentMethod"`
}

type BatchListResponse

type BatchListResponse struct {
	MessagesResponse
	BatchList []BatchList `json:"batchList,omitempty"`
}

func (BatchListResponse) List

func (r BatchListResponse) List() []BatchList

type BatchStatisticsResponse

type BatchStatisticsResponse struct {
	Batch struct {
		BatchID                      string       `json:"batchId"`
		SettlementTimeUTC            time.Time    `json:"settlementTimeUTC"`
		SettlementTimeUTCSpecified   bool         `json:"settlementTimeUTCSpecified"`
		SettlementTimeLocal          string       `json:"settlementTimeLocal"`
		SettlementTimeLocalSpecified bool         `json:"settlementTimeLocalSpecified"`
		SettlementState              string       `json:"settlementState"`
		PaymentMethod                string       `json:"paymentMethod"`
		Statistics                   []Statistics `json:"statistics"`
	} `json:"batch"`
	MessagesResponse
}

type BatchTransaction

type BatchTransaction struct {
	TransID           string    `json:"transId"`
	SubmitTimeUTC     time.Time `json:"submitTimeUTC"`
	SubmitTimeLocal   string    `json:"submitTimeLocal"`
	TransactionStatus string    `json:"transactionStatus"`
	InvoiceNumber     string    `json:"invoiceNumber"`
	FirstName         string    `json:"firstName"`
	LastName          string    `json:"lastName"`
	AccountType       string    `json:"accountType"`
	AccountNumber     string    `json:"accountNumber"`
	SettleAmount      float64   `json:"settleAmount"`
	MarketType        string    `json:"marketType"`
	Product           string    `json:"product"`
	FraudInformation  struct {
		FraudFilterList []string `json:"fraudFilterList"`
		FraudAction     string   `json:"fraudAction"`
	} `json:"fraudInformation"`
}

type BillTo

type BillTo struct {
	FirstName   string `json:"firstName,omitempty"`
	LastName    string `json:"lastName,omitempty"`
	Address     string `json:"address,omitempty"`
	City        string `json:"city,omitempty"`
	State       string `json:"state,omitempty"`
	Zip         string `json:"zip,omitempty"`
	Country     string `json:"country,omitempty"`
	PhoneNumber string `json:"phoneNumber,omitempty"`
}

type CVV

type CVV struct {
	// contains filtered or unexported fields
}

func (CVV) Text

func (r CVV) Text() string

type CreateCustomerPaymentProfile

type CreateCustomerPaymentProfile struct {
	CreateCustomerPaymentProfileRequest CreateCustomerPaymentProfileRequest `json:"createCustomerPaymentProfileRequest"`
}

type CreateCustomerPaymentProfileRequest

type CreateCustomerPaymentProfileRequest struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	CustomerProfileID      string                 `json:"customerProfileId"`
	PaymentProfile         PaymentProfile         `json:"paymentProfile"`
}

type CreateCustomerProfile

type CreateCustomerProfile struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	Profile                Profile                `json:"profile"`
	ValidationMode         string                 `json:"validationMode"`
}

type CreateCustomerProfileRequest

type CreateCustomerProfileRequest struct {
	CreateCustomerProfile CreateCustomerProfile `json:"createCustomerProfileRequest"`
}

type CreateCustomerShippingAddress

type CreateCustomerShippingAddress struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	CustomerProfileID      string                 `json:"customerProfileId,omitempty"`
	Address                *Address               `json:"address,omitempty"`
}

type CreateCustomerShippingAddressRequest

type CreateCustomerShippingAddressRequest struct {
	CreateCustomerShippingAddress CreateCustomerShippingAddress `json:"createCustomerShippingAddressRequest"`
}

type CreateCustomerShippingAddressResponse

type CreateCustomerShippingAddressResponse struct {
	CustomerAddressID string `json:"customerAddressId,omitempty"`
	MessagesResponse
}

func CreateShipping

func CreateShipping(profile Profile) (*CreateCustomerShippingAddressResponse, error)

type CreatePayment

type CreatePayment struct {
	CreateTransactionRequest CreateTransactionRequest `json:"createTransactionRequest,omitempty"`
}

type CreateSubscriptionRequest

type CreateSubscriptionRequest struct {
	ARBCreateSubscriptionRequest ARBCreateSubscriptionRequest `json:"ARBCreateSubscriptionRequest"`
}

type CreateTransactionRequest

type CreateTransactionRequest struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication,omitempty"`
	RefID                  string                 `json:"refId,omitempty"`
	TransactionRequest     TransactionRequest     `json:"transactionRequest,omitempty"`
}

type CreditCard

type CreditCard struct {
	CardNumber     string `json:"cardNumber,omitempty"`
	ExpirationDate string `json:"expirationDate,omitempty"`
	CardCode       string `json:"cardCode,omitempty"`
}

type CustomProfileResponse

type CustomProfileResponse struct {
	CustomerProfileID             string        `json:"customerProfileId"`
	CustomerPaymentProfileIDList  []string      `json:"customerPaymentProfileIdList"`
	CustomerShippingAddressIDList []interface{} `json:"customerShippingAddressIdList"`
	ValidationDirectResponseList  []string      `json:"validationDirectResponseList"`
	MessagesResponse
}

func CreateProfile

func CreateProfile(profile Profile) (*CustomProfileResponse, error)

type Customer

type Customer struct {
	ID          string `json:"id,omitempty"`
	Type        string `json:"type,omitempty"`
	Email       string `json:"email,omitempty"`
	PaymentID   string `json:"paymentId,omitempty"`
	ShippingID  string `json:"shippingId,omitempty"`
	PhoneNumber string `json:"phoneNumber,omitempty"`
}

func (Customer) DeletePaymentProfile

func (customer Customer) DeletePaymentProfile() (*MessagesResponse, error)

func (Customer) DeleteProfile

func (customer Customer) DeleteProfile() (*MessagesResponse, error)

func (Customer) DeleteShippingProfile

func (customer Customer) DeleteShippingProfile() (*MessagesResponse, error)

func (Customer) Info

func (customer Customer) Info() (*GetCustomerProfileResponse, error)

func (Customer) Validate

func (customer Customer) Validate() (*ValidateCustomerPaymentProfileResponse, error)

type CustomerPaymentProfile

type CustomerPaymentProfile struct {
	CustomerProfileID string         `json:"customerProfileId"`
	PaymentProfile    PaymentProfile `json:"paymentProfile"`
}

func (CustomerPaymentProfile) Add

type CustomerPaymentProfileResponse

type CustomerPaymentProfileResponse struct {
	CustomerProfileId        string `json:"customerProfileId"`
	CustomerPaymentProfileID string `json:"customerPaymentProfileId"`
	ValidationDirectResponse string `json:"validationDirectResponse"`
	MessagesResponse
}

type CustomerProfileIdsRequest

type CustomerProfileIdsRequest struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
}

type CustomerProfileIdsResponse

type CustomerProfileIdsResponse struct {
	Ids      []string `json:"ids"`
	Messages struct {
		ResultCode string `json:"resultCode"`
		Message    []struct {
			Code string `json:"code"`
			Text string `json:"text"`
		} `json:"message"`
	} `json:"messages"`
}

type CustomerProfileRequest

type CustomerProfileRequest struct {
	GetCustomerProfile GetCustomerProfile `json:"getCustomerProfileRequest"`
}

type CustomerProfiler

type CustomerProfiler struct {
	CustomerProfileID         string `json:"customerProfileId,omitempty"`
	CustomerPaymentProfileID  string `json:"customerPaymentProfileId,omitempty"`
	CustomerShippingProfileID string `json:"customerAddressId,omitempty"`
}

type DeleteCustomerPaymentProfile

type DeleteCustomerPaymentProfile struct {
	MerchantAuthentication   MerchantAuthentication `json:"merchantAuthentication"`
	CustomerProfileID        string                 `json:"customerProfileId"`
	CustomerPaymentProfileID string                 `json:"customerPaymentProfileId"`
}

type DeleteCustomerPaymentProfileRequest

type DeleteCustomerPaymentProfileRequest struct {
	DeleteCustomerPaymentProfile DeleteCustomerPaymentProfile `json:"deleteCustomerPaymentProfileRequest"`
}

type DeleteCustomerProfile

type DeleteCustomerProfile struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	CustomerProfileID      string                 `json:"customerProfileId"`
}

type DeleteCustomerProfileRequest

type DeleteCustomerProfileRequest struct {
	DeleteCustomerProfile DeleteCustomerProfile `json:"deleteCustomerProfileRequest"`
}

type DeleteCustomerShippingProfile

type DeleteCustomerShippingProfile struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	CustomerProfileID      string                 `json:"customerProfileId"`
	CustomerShippingID     string                 `json:"customerAddressId"`
}

type DeleteCustomerShippingProfileRequest

type DeleteCustomerShippingProfileRequest struct {
	DeleteCustomerShippingProfile DeleteCustomerShippingProfile `json:"deleteCustomerShippingAddressRequest"`
}

type Duty

type Duty struct {
	Amount      string `json:"amount,omitempty"`
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

type FullTransaction

type FullTransaction struct {
	TransID                   string    `json:"transId"`
	SubmitTimeUTC             time.Time `json:"submitTimeUTC"`
	SubmitTimeLocal           string    `json:"submitTimeLocal"`
	TransactionType           string    `json:"transactionType"`
	TransactionStatus         string    `json:"transactionStatus"`
	ResponseCode              int       `json:"responseCode"`
	ResponseReasonCode        int       `json:"responseReasonCode"`
	ResponseReasonDescription string    `json:"responseReasonDescription"`
	AVSResponse               string    `json:"AVSResponse"`
	Batch                     struct {
		BatchID                      string    `json:"batchId"`
		SettlementTimeUTC            time.Time `json:"settlementTimeUTC"`
		SettlementTimeUTCSpecified   bool      `json:"settlementTimeUTCSpecified"`
		SettlementTimeLocal          string    `json:"settlementTimeLocal"`
		SettlementTimeLocalSpecified bool      `json:"settlementTimeLocalSpecified"`
		SettlementState              string    `json:"settlementState"`
	} `json:"batch"`
	Order struct {
		InvoiceNumber string `json:"invoiceNumber"`
	} `json:"order"`
	RequestedAmountSpecified         bool    `json:"requestedAmountSpecified"`
	AuthAmount                       float64 `json:"authAmount"`
	SettleAmount                     float64 `json:"settleAmount"`
	PrepaidBalanceRemainingSpecified bool    `json:"prepaidBalanceRemainingSpecified"`
	TaxExempt                        bool    `json:"taxExempt"`
	TaxExemptSpecified               bool    `json:"taxExemptSpecified"`
	Payment                          struct {
		BankAccount struct {
			AccountType          int         `json:"accountType"`
			AccountTypeSpecified bool        `json:"accountTypeSpecified"`
			RoutingNumber        string      `json:"routingNumber"`
			AccountNumber        string      `json:"accountNumber"`
			NameOnAccount        string      `json:"nameOnAccount"`
			EcheckType           int         `json:"echeckType"`
			EcheckTypeSpecified  bool        `json:"echeckTypeSpecified"`
			BankName             interface{} `json:"bankName"`
		} `json:"bankAccount"`
		CreditCard CreditCard `json:"creditCard"`
	} `json:"payment"`
	RecurringBilling          bool `json:"recurringBilling"`
	RecurringBillingSpecified bool `json:"recurringBillingSpecified"`
	ReturnedItems             []struct {
		ID          string    `json:"id"`
		DateUTC     time.Time `json:"dateUTC"`
		DateLocal   string    `json:"dateLocal"`
		Code        string    `json:"code"`
		Description string    `json:"description"`
	} `json:"returnedItems"`
}

type GetBatchStatistics

type GetBatchStatistics struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	BatchID                string                 `json:"batchId"`
}

type GetBatchStatisticsRequest

type GetBatchStatisticsRequest struct {
	GetBatchStatistics GetBatchStatistics `json:"getBatchStatisticsRequest"`
}

type GetCustomerPaymentProfileList

type GetCustomerPaymentProfileList struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	SearchType             string                 `json:"searchType"`
	Month                  string                 `json:"month"`
	Sorting                Sorting                `json:"sorting"`
	Paging                 Paging                 `json:"paging"`
}

type GetCustomerPaymentProfileListRequest

type GetCustomerPaymentProfileListRequest struct {
	GetCustomerPaymentProfileList GetCustomerPaymentProfileList `json:"getCustomerPaymentProfileListRequest"`
}

type GetCustomerPaymentProfileListResponse

type GetCustomerPaymentProfileListResponse struct {
	GetCustomerPaymentProfileList struct {
		MessagesResponse
		TotalNumInResultSet string `json:"totalNumInResultSet"`
		PaymentProfiles     struct {
			PaymentProfile []PaymentProfile `json:"paymentProfile"`
		} `json:"paymentProfiles"`
	} `json:"getCustomerPaymentProfileListResponse"`
}

func GetPaymentProfileIds

func GetPaymentProfileIds(month string, method string) (*GetCustomerPaymentProfileListResponse, error)

type GetCustomerProfile

type GetCustomerProfile struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	CustomerProfileID      string                 `json:"customerProfileId"`
}

type GetCustomerProfileIdsRequest

type GetCustomerProfileIdsRequest struct {
	CustomerProfileIdsRequest CustomerProfileIdsRequest `json:"getCustomerProfileIdsRequest"`
}

type GetCustomerProfileResponse

type GetCustomerProfileResponse struct {
	Profile struct {
		PaymentProfiles    []GetPaymentProfiles  `json:"paymentProfiles,omitempty"`
		ShippingProfiles   []GetShippingProfiles `json:"shipToList,omitempty"`
		CustomerProfileID  string                `json:"customerProfileId"`
		MerchantCustomerID string                `json:"merchantCustomerId,omitempty"`
		Description        string                `json:"description,omitempty"`
		Email              string                `json:"email,omitempty"`
	} `json:"profile"`
	SubscriptionIds []string `json:"subscriptionIds"`
	MessagesResponse
}

func GetProfile

func GetProfile(customer Customer) (*GetCustomerProfileResponse, error)

func (GetCustomerProfileResponse) PaymentProfiles

func (response GetCustomerProfileResponse) PaymentProfiles() []GetPaymentProfiles

func (GetCustomerProfileResponse) ShippingProfiles

func (response GetCustomerProfileResponse) ShippingProfiles() []GetShippingProfiles

func (GetCustomerProfileResponse) Subscriptions

func (response GetCustomerProfileResponse) Subscriptions() []string

type GetMerchantDetailsReq

type GetMerchantDetailsReq struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
}

type GetMerchantDetailsRequest

type GetMerchantDetailsRequest struct {
	GetMerchantDetailsReq GetMerchantDetailsReq `json:"getMerchantDetailsRequest"`
}

type GetPaymentProfiles

type GetPaymentProfiles struct {
	CustomerPaymentProfileID string `json:"customerPaymentProfileId"`
	Payment                  struct {
		CreditCard struct {
			CardNumber     string `json:"cardNumber"`
			ExpirationDate string `json:"expirationDate"`
		} `json:"creditCard"`
	} `json:"payment"`
	CustomerType string `json:"customerType"`
	BillTo       struct {
		FirstName string `json:"firstName"`
		LastName  string `json:"lastName"`
	} `json:"billTo"`
}

type GetSettledBatchList

type GetSettledBatchList struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	IncludeStatistics      string                 `json:"includeStatistics"`
	FirstSettlementDate    time.Time              `json:"firstSettlementDate"`
	LastSettlementDate     time.Time              `json:"lastSettlementDate"`
}

type GetSettledBatchListRequest

type GetSettledBatchListRequest struct {
	GetSettledBatchList GetSettledBatchList `json:"getSettledBatchListRequest"`
}

type GetShippingProfiles

type GetShippingProfiles struct {
	CustomerAddressID string `json:"customerAddressId"`
	FirstName         string `json:"firstName,omitempty"`
	LastName          string `json:"lastName,omitempty"`
	Company           string `json:"company,omitempty"`
	Address           string `json:"address,omitempty"`
	City              string `json:"city,omitempty"`
	State             string `json:"state,omitempty"`
	Zip               string `json:"zip,omitempty"`
	Country           string `json:"country,omitempty"`
	PhoneNumber       string `json:"phoneNumber,omitempty"`
}

type GetSubscriptionCancelRequest

type GetSubscriptionCancelRequest struct {
	ARBCancelSubscriptionRequest ARBGetSubscriptionRequest `json:"ARBCancelSubscriptionRequest"`
}

type GetSubscriptionList

type GetSubscriptionList struct {
	TotalNumInResultSet int `json:"totalNumInResultSet"`
	SubscriptionDetails []struct {
		ID                        int     `json:"id"`
		Name                      string  `json:"name"`
		Status                    string  `json:"status"`
		CreateTimeStampUTC        string  `json:"createTimeStampUTC"`
		FirstName                 string  `json:"firstName"`
		LastName                  string  `json:"lastName"`
		TotalOccurrences          int     `json:"totalOccurrences"`
		PastOccurrences           int     `json:"pastOccurrences"`
		PaymentMethod             string  `json:"paymentMethod"`
		AccountNumber             string  `json:"accountNumber"`
		Invoice                   string  `json:"invoice"`
		Amount                    float64 `json:"amount"`
		CurrencyCode              string  `json:"currencyCode"`
		CustomerProfileID         int     `json:"customerProfileId"`
		CustomerPaymentProfileID  int     `json:"customerPaymentProfileId,omitempty"`
		CustomerShippingProfileID int     `json:"customerShippingProfileId,omitempty"`
	} `json:"subscriptionDetails"`
	MessagesResponse
}

func SubscriptionList

func SubscriptionList(search string) (*GetSubscriptionList, error)

func (GetSubscriptionList) Count

func (sub GetSubscriptionList) Count() int

type GetSubscriptionListRequest

type GetSubscriptionListRequest struct {
	ARBGetSubscriptionListRequest ARBGetSubscriptionListRequest `json:"ARBGetSubscriptionListRequest"`
}

type GetSubscriptionRequest

type GetSubscriptionRequest struct {
	ARBGetSubscriptionRequest ARBGetSubscriptionRequest `json:"ARBGetSubscriptionRequest"`
}

type GetSubscriptionResponse

type GetSubscriptionResponse struct {
	Subscription struct {
		Name            string `json:"name"`
		PaymentSchedule struct {
			Interval struct {
				Length int    `json:"length"`
				Unit   string `json:"unit"`
			} `json:"interval"`
			StartDate        string `json:"startDate"`
			TotalOccurrences int    `json:"totalOccurrences"`
			TrialOccurrences int    `json:"trialOccurrences"`
		} `json:"paymentSchedule"`
		Amount      float64 `json:"amount"`
		TrialAmount float64 `json:"trialAmount"`
		Status      string  `json:"status"`
		Profile     struct {
			PaymentProfile struct {
				CustomerPaymentProfileID string `json:"customerPaymentProfileId"`
				Payment                  struct {
					CreditCard struct {
						CardNumber     string `json:"cardNumber"`
						ExpirationDate string `json:"expirationDate"`
					} `json:"creditCard"`
				} `json:"payment"`
				CustomerType string `json:"customerType"`
				BillTo       struct {
					FirstName string `json:"firstName"`
					LastName  string `json:"lastName"`
				} `json:"billTo"`
			} `json:"paymentProfile"`
			CustomerProfileID string `json:"customerProfileId"`
			Description       string `json:"description"`
		} `json:"profile"`
	} `json:"subscription"`
	RefID string `json:"refId"`
	MessagesResponse
}

func (GetSubscriptionResponse) ErrorMessage

func (sub GetSubscriptionResponse) ErrorMessage() string

type GetSubscriptionStatusRequest

type GetSubscriptionStatusRequest struct {
	ARBGetSubscriptionStatusRequest ARBGetSubscriptionRequest `json:"ARBGetSubscriptionStatusRequest"`
}

type GetTransactionDetails

type GetTransactionDetails struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	TransID                string                 `json:"transId"`
}

type GetTransactionDetailsRequest

type GetTransactionDetailsRequest struct {
	GetTransactionDetails GetTransactionDetails `json:"getTransactionDetailsRequest"`
}

type GetTransactionList

type GetTransactionList struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	BatchID                string                 `json:"batchId,omitempty"`
	Sorting                *Sorting               `json:"sorting,omitempty"`
	Paging                 *Paging                `json:"paging,omitempty"`
}

type GetTransactionListRequest

type GetTransactionListRequest struct {
	GetTransactionList GetTransactionList `json:"getTransactionListRequest"`
}

type GetTransactionListResponse

type GetTransactionListResponse struct {
	GetTransactionList struct {
		MessagesResponse
		Transactions        Transactions `json:"transactions"`
		TotalNumInResultSet int          `json:"totalNumInResultSet"`
	} `json:"getTransactionListResponse"`
}

func (*GetTransactionListResponse) Count

func (r *GetTransactionListResponse) Count() int

func (*GetTransactionListResponse) List

type GetUnsettledBatchTransactionListRequest

type GetUnsettledBatchTransactionListRequest struct {
	GetUnsettledTransactionList GetUnsettledTransactionList `json:"getUnsettledTransactionListRequest"`
}

type GetUnsettledTransactionList

type GetUnsettledTransactionList struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	Sorting                *Sorting               `json:"sorting,omitempty"`
	Paging                 *Paging                `json:"paging,omitempty"`
}

type GetUnsettledTransactionListRequest

type GetUnsettledTransactionListRequest struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication,omitempty"`
	Status                 string                 `json:"status,omitempty"`
}

type HeldTransactionRequest

type HeldTransactionRequest struct {
	Action     string `json:"action"`
	RefTransID string `json:"refTransId"`
}

type Interval

type Interval struct {
	Length string `json:"length,omitempty"`
	Unit   string `json:"unit,omitempty"`
}

func IntervalDays

func IntervalDays(amount string) Interval

func IntervalMonthly

func IntervalMonthly() Interval

func IntervalMonths

func IntervalMonths(amount string) Interval

func IntervalQuarterly

func IntervalQuarterly() Interval

func IntervalWeekly

func IntervalWeekly() Interval

func IntervalYearly

func IntervalYearly() Interval

type LineItem

type LineItem struct {
	ItemID      *string `json:"itemId,omitempty"`
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
	Quantity    *string `json:"quantity,omitempty"`
	UnitPrice   *string `json:"unitPrice,omitempty"`
}

type LineItems

type LineItems struct {
	LineItem []LineItem `json:"lineItem,omitempty"`
}

type MerchantAuthentication

type MerchantAuthentication struct {
	Name           *string `json:"name,omitempty"`
	TransactionKey *string `json:"transactionKey,omitempty"`
}

func GetAuthentication

func GetAuthentication() MerchantAuthentication

type MerchantDetailsResponse

type MerchantDetailsResponse struct {
	IsTestMode bool `json:"isTestMode"`
	Processors []struct {
		Name string `json:"name"`
	} `json:"processors"`
	MerchantName   string   `json:"merchantName"`
	GatewayID      string   `json:"gatewayId"`
	MarketTypes    []string `json:"marketTypes"`
	ProductCodes   []string `json:"productCodes"`
	PaymentMethods []string `json:"paymentMethods"`
	Currencies     []string `json:"currencies"`
	MessagesResponse
}

func GetMerchantDetails

func GetMerchantDetails() (*MerchantDetailsResponse, error)

type Message

type Message struct {
	Code string `json:"code"`
	Text string `json:"text"`
}

type MessageResponse

type MessageResponse struct {
	ResultCode string `json:"resultCode"`
	Message    struct {
		Code string `json:"code"`
		Text string `json:"text"`
	} `json:"message"`
}

type MessagesResponse

type MessagesResponse struct {
	Messages struct {
		ResultCode string `json:"resultCode"`
		Message    []struct {
			Code string `json:"code"`
			Text string `json:"text"`
		} `json:"message"`
	} `json:"messages"`
}

func DeletePaymentProfile

func DeletePaymentProfile(customer Customer) (*MessagesResponse, error)

func DeleteProfile

func DeleteProfile(customer Customer) (*MessagesResponse, error)

func DeleteShippingProfile

func DeleteShippingProfile(customer Customer) (*MessagesResponse, error)

func MessageResponder

func MessageResponder(d interface{}) (*MessagesResponse, error)

func UpdatePaymentProfile

func UpdatePaymentProfile(profile Profile) (*MessagesResponse, error)

func UpdateProfile

func UpdateProfile(profile Profile) (*MessagesResponse, error)

func UpdateShippingProfile

func UpdateShippingProfile(profile Profile) (*MessagesResponse, error)

func (MessagesResponse) ErrorMessage

func (r MessagesResponse) ErrorMessage() string

func (MessagesResponse) Ok

func (r MessagesResponse) Ok() bool

type NewTransaction

type NewTransaction struct {
	Amount     string   `json:"amount,omitempty"`
	InvoiceId  string   `json:"invoiceId,omitempty"`
	RefTransId string   `json:"refTransId,omitempty"`
	Payment    *Payment `json:"payment,omitempty"`
	Retail     *Retail  `json:"retail,omitempty"`
	// CreditCard *CreditCard `json:"payment,omitempty"`
	// OpaqueData *OpaqueData `json:"payment,omitempty"`
	AuthCode  string     `json:"authCode,omitempty"`
	BillTo    *BillTo    `json:"billTo,omitempty"`
	Order     *Order     `json:"order,omitempty"`
	LineItems *LineItems `json:"lineItems,omitempty"`
	Tax       *Tax       `json:"tax,omitempty"`
	Shipping  *Shipping  `json:"shipping,omitempty"`
	Customer  *Customer  `json:"customer,omitempty"`
	ShipTo    *Address   `json:"shipTo,omitempty"`
}

func (NewTransaction) AuthOnly

func (tranx NewTransaction) AuthOnly() (*TransactionResponse, error)

func (NewTransaction) Charge

func (tranx NewTransaction) Charge() (*TransactionResponse, error)

func (NewTransaction) ChargeProfile

func (tranx NewTransaction) ChargeProfile(profile Customer) (*TransactionResponse, error)

func (NewTransaction) Refund

func (tranx NewTransaction) Refund() (*TransactionResponse, error)

type OpaqueData

type OpaqueData struct {
	DataDescriptor string `json:"dataDescriptor,omitempty"`
	DataValue      string `json:"dataValue,omitempty"`
}

type Order

type Order struct {
	InvoiceNumber *string `json:"invoiceNumber,omitempty"`
	Description   *string `json:"description,omitempty"`
}

type Paging

type Paging struct {
	Limit  string `json:"limit"`
	Offset string `json:"offset"`
}

type Payment

type Payment struct {
	CreditCard *CreditCard `json:"creditCard,omitempty"`
	OpaqueData *OpaqueData `json:"opaqueData,omitempty"`
	TrackData  *TrackData  `json:"trackData,omitempty"`
}

type PaymentProfile

type PaymentProfile struct {
	BillTo                *BillTo  `json:"billTo,omitempty"`
	Payment               *Payment `json:"payment,omitempty"`
	DefaultPaymentProfile string   `json:"defaultPaymentProfile,omitempty"`
	PaymentProfileId      string   `json:"paymentProfileId,omitempty"`
}

type PaymentProfiles

type PaymentProfiles struct {
	CustomerType string  `json:"customerType,omitempty"`
	Payment      Payment `json:"payment,omitempty"`
	BillTo       *BillTo `json:"billTo,omitempty"`
	PaymentId    string  `json:"paymentProfileId,omitempty"`
}

type PaymentSchedule

type PaymentSchedule struct {
	Interval         Interval `json:"interval,omitempty"`
	StartDate        string   `json:"startDate,omitempty"`
	TotalOccurrences string   `json:"totalOccurrences,omitempty"`
	TrialOccurrences string   `json:"trialOccurrences,omitempty"`
}

type PreviousTransaction

type PreviousTransaction struct {
	RefId  string `json:"refTransId,omitempty"`
	Amount string `json:"amount,omitempty"`
}

func (PreviousTransaction) Approve

func (PreviousTransaction) Capture

func (tranx PreviousTransaction) Capture() (*TransactionResponse, error)

func (PreviousTransaction) Decline

func (PreviousTransaction) Info

func (tranx PreviousTransaction) Info() (*FullTransaction, error)

func (PreviousTransaction) Void

type Profile

type Profile struct {
	MerchantCustomerID string           `json:"merchantCustomerId,omitempty"`
	Description        string           `json:"description,omitempty"`
	Email              string           `json:"email,omitempty"`
	CustomerProfileId  string           `json:"customerProfileId,omitempty"`
	PaymentProfiles    *PaymentProfiles `json:"paymentProfiles,omitempty"`
	PaymentProfileId   string           `json:"customerPaymentProfileId,omitempty"`
	Shipping           *Address         `json:"address,omitempty"`
	CustomerAddressId  string           `json:"customerAddressId,omitempty"`
	PaymentProfile     *PaymentProfile  `json:"paymentProfile,omitempty"`
}

func (Profile) CreateProfile

func (profile Profile) CreateProfile() (*CustomProfileResponse, error)

func (Profile) CreateShipping

func (profile Profile) CreateShipping() (*CreateCustomerShippingAddressResponse, error)

func (Profile) UpdatePaymentProfile

func (profile Profile) UpdatePaymentProfile() (*MessagesResponse, error)

func (Profile) UpdateProfile

func (profile Profile) UpdateProfile() (*MessagesResponse, error)

func (Profile) UpdateShippingProfile

func (profile Profile) UpdateShippingProfile() (*MessagesResponse, error)

type Range

type Range struct {
	Start   time.Time `"omitempty"`
	End     time.Time `"omitempty"`
	BatchId string    `"omitempty"`
	Sorting Sorting   `"omitempty"`
	Paging  Paging    `"omitempty"`
}

func (Range) SettledBatch

func (r Range) SettledBatch() (*BatchListResponse, error)

func (Range) Statistics

func (r Range) Statistics() (*Statistics, error)

func (Range) Transactions

func (r Range) Transactions() (*GetTransactionListResponse, error)

type Retail

type Retail struct {
	MarketType int `json:"marketType,omitempty"`
}

type SetSubscription

type SetSubscription struct {
	Id string `json:"subscriptionId"`
}

func (SetSubscription) Cancel

func (sub SetSubscription) Cancel() (*SubscriptionCancel, error)

func (SetSubscription) Info

func (SetSubscription) Status

func (sub SetSubscription) Status() (*SubscriptionStatus, error)

type Setting

type Setting struct {
	SettingName  string `json:"settingName,omitempty"`
	SettingValue string `json:"settingValue,omitempty"`
}

type Shipping

type Shipping struct {
	Amount      *string `json:"amount,omitempty"`
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
}

type Sorting

type Sorting struct {
	OrderBy         string `json:"orderBy"`
	OrderDescending string `json:"orderDescending"`
}

type Statistics

type Statistics struct {
	AccountType                        string  `json:"accountType"`
	ChargeAmount                       float64 `json:"chargeAmount"`
	ChargeCount                        int     `json:"chargeCount"`
	RefundAmount                       float64 `json:"refundAmount"`
	RefundCount                        int     `json:"refundCount"`
	VoidCount                          int     `json:"voidCount"`
	DeclineCount                       int     `json:"declineCount"`
	ErrorCount                         int     `json:"errorCount"`
	ReturnedItemAmount                 int     `json:"returnedItemAmount"`
	ReturnedItemAmountSpecified        bool    `json:"returnedItemAmountSpecified"`
	ReturnedItemCount                  int     `json:"returnedItemCount"`
	ReturnedItemCountSpecified         bool    `json:"returnedItemCountSpecified"`
	ChargebackAmount                   int     `json:"chargebackAmount"`
	ChargebackAmountSpecified          bool    `json:"chargebackAmountSpecified"`
	ChargebackCount                    int     `json:"chargebackCount"`
	ChargebackCountSpecified           bool    `json:"chargebackCountSpecified"`
	CorrectionNoticeCount              int     `json:"correctionNoticeCount"`
	CorrectionNoticeCountSpecified     bool    `json:"correctionNoticeCountSpecified"`
	ChargeChargeBackAmount             int     `json:"chargeChargeBackAmount"`
	ChargeChargeBackAmountSpecified    bool    `json:"chargeChargeBackAmountSpecified"`
	ChargeChargeBackCount              int     `json:"chargeChargeBackCount"`
	ChargeChargeBackCountSpecified     bool    `json:"chargeChargeBackCountSpecified"`
	RefundChargeBackAmount             int     `json:"refundChargeBackAmount"`
	RefundChargeBackAmountSpecified    bool    `json:"refundChargeBackAmountSpecified"`
	RefundChargeBackCount              int     `json:"refundChargeBackCount"`
	RefundChargeBackCountSpecified     bool    `json:"refundChargeBackCountSpecified"`
	ChargeReturnedItemsAmount          float64 `json:"chargeReturnedItemsAmount"`
	ChargeReturnedItemsAmountSpecified bool    `json:"chargeReturnedItemsAmountSpecified"`
	ChargeReturnedItemsCount           int     `json:"chargeReturnedItemsCount"`
	ChargeReturnedItemsCountSpecified  bool    `json:"chargeReturnedItemsCountSpecified"`
	RefundReturnedItemsAmount          int     `json:"refundReturnedItemsAmount"`
	RefundReturnedItemsAmountSpecified bool    `json:"refundReturnedItemsAmountSpecified"`
	RefundReturnedItemsCount           int     `json:"refundReturnedItemsCount"`
	RefundReturnedItemsCountSpecified  bool    `json:"refundReturnedItemsCountSpecified"`
}

type Subscription

type Subscription struct {
	Name            string            `json:"name,omitempty"`
	PaymentSchedule *PaymentSchedule  `json:"paymentSchedule,omitempty"`
	Amount          string            `json:"amount,omitempty"`
	TrialAmount     string            `json:"trialAmount,omitempty"`
	Payment         *Payment          `json:"payment,omitempty"`
	BillTo          *BillTo           `json:"billTo,omitempty"`
	SubscriptionId  string            `json:"subscriptionId,omitempty"`
	Profile         *CustomerProfiler `json:"profile,omitempty"`
}

func (Subscription) Charge

func (sub Subscription) Charge() (*SubscriptionResponse, error)

func (Subscription) Update

func (sub Subscription) Update() (*SubscriptionResponse, error)

type SubscriptionCancel

type SubscriptionCancel struct {
	RefID string `json:"refId"`
	MessagesResponse
}

type SubscriptionResponse

type SubscriptionResponse struct {
	SubscriptionID string `json:"subscriptionId"`
	Profile        struct {
		CustomerProfileID        string `json:"customerProfileId"`
		CustomerPaymentProfileID string `json:"customerPaymentProfileId"`
	} `json:"profile"`
	Messages struct {
		ResultCode string `json:"resultCode"`
		Message    []struct {
			Code string `json:"code"`
			Text string `json:"text"`
		} `json:"message"`
	} `json:"messages"`
}

func SendSubscription

func SendSubscription(sub Subscription) (*SubscriptionResponse, error)

func UpdateSubscription

func UpdateSubscription(sub Subscription) (*SubscriptionResponse, error)

func (SubscriptionResponse) Approved

func (response SubscriptionResponse) Approved() bool

func (SubscriptionResponse) CustomerPaymentProfileId

func (response SubscriptionResponse) CustomerPaymentProfileId() string

func (SubscriptionResponse) CustomerProfileId

func (response SubscriptionResponse) CustomerProfileId() string

func (SubscriptionResponse) ErrorMessage

func (response SubscriptionResponse) ErrorMessage() string

func (SubscriptionResponse) Info

func (response SubscriptionResponse) Info() string

type SubscriptionStatus

type SubscriptionStatus struct {
	Note            string `json:"note"`
	Status          string `json:"status"`
	StatusSpecified bool   `json:"statusSpecified"`
	RefID           string `json:"refId"`
	MessagesResponse
}

func (SubscriptionStatus) Active

func (s SubscriptionStatus) Active() bool

type Tax

type Tax struct {
	Amount      *string `json:"amount,omitempty"`
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
}

type TrackData

type TrackData struct {
	Track1 string `json:"track1,omitempty"`
}

type Transaction

type Transaction struct {
	TransID           string  `json:"transId"`
	SubmitTimeUTC     string  `json:"submitTimeUTC"`
	SubmitTimeLocal   string  `json:"submitTimeLocal"`
	TransactionStatus string  `json:"transactionStatus"`
	Invoice           string  `json:"invoice,omitempty"`
	FirstName         string  `json:"firstName,omitempty"`
	LastName          string  `json:"lastName,omitempty"`
	Amount            string  `json:"amount,omitempty"`
	AccountType       string  `json:"accountType,omitempty"`
	AccountNumber     string  `json:"accountNumber,omitempty"`
	SettleAmount      float64 `json:"settleAmount,omitempty"`
	Subscription      struct {
		ID     int `json:"id"`
		PayNum int `json:"payNum,omitempty"`
	} `json:"subscription,omitempty"`
	MarketType     string `json:"marketType,omitempty"`
	Product        string `json:"product,omitempty"`
	MobileDeviceID string `json:"mobileDeviceId,omitempty"`
}

type TransactionDetailsResponse

type TransactionDetailsResponse struct {
	Transaction FullTransaction `json:"transaction"`
	MessagesResponse
}

type TransactionMessages

type TransactionMessages struct {
	Message []struct {
		Code        string `json:"code"`
		Description string `json:"description"`
	} `json:"messages"`
}

type TransactionRequest

type TransactionRequest struct {
	TransactionType string   `json:"transactionType,omitempty"`
	Amount          string   `json:"amount,omitempty"`
	Payment         *Payment `json:"payment,omitempty"`
	Retail          *Retail  `json:"retail,omitempty"`
	RefTransId      string   `json:"refTransId,omitempty"`
	AuthCode        string   `json:"authCode,omitempty"`
	Profile         *Profile `json:"profile,omitempty"`

	CustomerIP string     `json:"customerIP,omitempty"`
	Order      *Order     `json:"order,omitempty"`
	LineItems  *LineItems `json:"lineItems,omitempty"`
	Tax        *Tax       `json:"tax,omitempty"`
	Shipping   *Shipping  `json:"shipping,omitempty"`
	Customer   *Customer  `json:"customer,omitempty"`
	BillTo     *BillTo    `json:"billTo,omitempty"`
	ShipTo     *Address   `json:"shipTo,omitempty"`
}

type TransactionResponse

type TransactionResponse struct {
	Response TranxResponse `json:"transactionResponse"`
	MessagesResponse
}

func SendTransactionRequest

func SendTransactionRequest(input TransactionRequest) (*TransactionResponse, error)

func SendTransactionUpdate

func SendTransactionUpdate(tranx PreviousTransaction, method string) (*TransactionResponse, error)

func (TransactionResponse) AVS

func (transx TransactionResponse) AVS() AVS

func (TransactionResponse) Approved

func (r TransactionResponse) Approved() bool

func (TransactionResponse) CVV

func (transx TransactionResponse) CVV() CVV

func (TransactionResponse) Held

func (r TransactionResponse) Held() bool

func (TransactionResponse) Message

func (transx TransactionResponse) Message() string

func (TransactionResponse) TransactionID

func (transx TransactionResponse) TransactionID() string

type TransactionSettings

type TransactionSettings struct {
	Setting Setting `json:"setting,omitempty"`
}

type Transactions

type Transactions struct {
	Transaction []Transaction `json:"transaction"`
}

type TransactionsList

type TransactionsList struct {
	Transactions        []BatchTransaction `json:"transactions"`
	TotalNumInResultSet int                `json:"totalNumInResultSet"`
	MessagesResponse
}

func SendGetUnsettled

func SendGetUnsettled() (*TransactionsList, error)

func UnsettledBatchList

func UnsettledBatchList() (*TransactionsList, error)

func (TransactionsList) Count

func (input TransactionsList) Count() int

func (TransactionsList) List

func (input TransactionsList) List() ([]BatchTransaction, error)

type TransxReponse

type TransxReponse interface {
	ErrorMessage()
	Approved()
}

type TranxResponse

type TranxResponse struct {
	ResponseCode   string `json:"responseCode"`
	AuthCode       string `json:"authCode"`
	AvsResultCode  string `json:"avsResultCode"`
	CvvResultCode  string `json:"cvvResultCode"`
	CavvResultCode string `json:"cavvResultCode"`
	TransID        string `json:"transId"`
	RefTransID     string `json:"refTransID"`
	TransHash      string `json:"transHash"`
	TestRequest    string `json:"testRequest"`
	AccountNumber  string `json:"accountNumber"`
	AccountType    string `json:"accountType"`
	Errors         []struct {
		ErrorCode string `json:"errorCode"`
		ErrorText string `json:"errorText"`
	} `json:"errors"`
	TransactionMessages
	TransHashSha2 string `json:"transHashSha2"`
	Message       TransactionMessages
}

type UnsettledTransactionListResponse

type UnsettledTransactionListResponse struct {
	Transactions []Transaction `json:"transactions"`
	MessagesResponse
}

func UnSettledBatch

func UnSettledBatch() (*UnsettledTransactionListResponse, error)

func (UnsettledTransactionListResponse) List

type UnsettledTransactionsRequest

type UnsettledTransactionsRequest struct {
	GetUnsettledTransactionListRequest GetUnsettledTransactionListRequest `json:"getUnsettledTransactionListRequest"`
}

type UpPaymentProfile

type UpPaymentProfile struct {
	BillTo                   *BillTo `json:"billTo"`
	Payment                  Payment `json:"payment"`
	CustomerPaymentProfileID string  `json:"customerPaymentProfileId"`
}

type UpdateCustomerPaymentProfile

type UpdateCustomerPaymentProfile struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	CustomerProfileID      string                 `json:"customerProfileId"`
	UpPaymentProfile       UpPaymentProfile       `json:"paymentProfile"`
	ValidationMode         string                 `json:"validationMode"`
}

type UpdateCustomerPaymentProfileRequest

type UpdateCustomerPaymentProfileRequest struct {
	UpdateCustomerPaymentProfile UpdateCustomerPaymentProfile `json:"updateCustomerPaymentProfileRequest"`
}

type UpdateCustomerProfile

type UpdateCustomerProfile struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	Profile                Profile                `json:"profile"`
}

type UpdateCustomerProfileRequest

type UpdateCustomerProfileRequest struct {
	UpdateCustomerProfile UpdateCustomerProfile `json:"updateCustomerProfileRequest"`
}

type UpdateCustomerShippingAddress

type UpdateCustomerShippingAddress struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	CustomerProfileID      string                 `json:"customerProfileId"`
	Address                Address                `json:"address"`
}

type UpdateCustomerShippingAddressRequest

type UpdateCustomerShippingAddressRequest struct {
	UpdateCustomerShippingAddress UpdateCustomerShippingAddress `json:"updateCustomerShippingAddressRequest"`
}

type UpdateHeldTransaction

type UpdateHeldTransaction struct {
	MerchantAuthentication MerchantAuthentication `json:"merchantAuthentication"`
	RefID                  string                 `json:"refId"`
	HeldTransactionRequest HeldTransactionRequest `json:"heldTransactionRequest"`
}

type UpdateHeldTransactionRequest

type UpdateHeldTransactionRequest struct {
	UpdateHeldTransaction UpdateHeldTransaction `json:"updateHeldTransactionRequest"`
}

type UpdateSubscriptionRequest

type UpdateSubscriptionRequest struct {
	ARBUpdateSubscriptionRequest ARBUpdateSubscriptionRequest `json:"ARBUpdateSubscriptionRequest"`
}

type UserField

type UserField struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

type UserFields

type UserFields struct {
	UserField []UserField `json:"userField,omitempty"`
}

type ValidateCustomerPaymentProfile

type ValidateCustomerPaymentProfile struct {
	MerchantAuthentication   MerchantAuthentication `json:"merchantAuthentication"`
	CustomerProfileID        string                 `json:"customerProfileId"`
	CustomerPaymentProfileID string                 `json:"customerPaymentProfileId"`
	ValidationMode           string                 `json:"validationMode"`
}

type ValidateCustomerPaymentProfileRequest

type ValidateCustomerPaymentProfileRequest struct {
	ValidateCustomerPaymentProfile ValidateCustomerPaymentProfile `json:"validateCustomerPaymentProfileRequest"`
}

type ValidateCustomerPaymentProfileResponse

type ValidateCustomerPaymentProfileResponse struct {
	DirectResponse string `json:"directResponse"`
	MessagesResponse
}

func ValidatePaymentProfile

func ValidatePaymentProfile(customer Customer) (*ValidateCustomerPaymentProfileResponse, error)

Directories

Path Synopsis
_examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL