diff --git a/_examples/new_transaction/main.go b/_examples/new_transaction/main.go index 5e682c8..4362d4e 100644 --- a/_examples/new_transaction/main.go +++ b/_examples/new_transaction/main.go @@ -1,9 +1,9 @@ package main import ( + "fmt" auth "github.com/hunterlong/authorizecim" "os" - "fmt" ) var newTransactionId string @@ -13,7 +13,7 @@ func main() { apiName := os.Getenv("apiName") apiKey := os.Getenv("apiKey") - auth.SetAPIInfo(apiName,apiKey,"test") + auth.SetAPIInfo(apiName, apiKey, "test") if auth.IsConnected() { fmt.Println("Connected to Authorize.net!") @@ -26,33 +26,32 @@ func main() { func ChargeCustomer() { - newTransaction := auth.NewTransaction{ - Amount: "13.75", - CreditCard: auth.CreditCard{ - CardNumber: "4012888818888", - ExpirationDate: "08/25", - CardCode: "393", - }, - BillTo: &auth.BillTo{ - FirstName: "Timmy", - LastName: "Jimmy", - Address: "1111 green ct", - City: "los angeles", - State: "CA", - Zip: "43534", - Country: "USA", - PhoneNumber: "8885555555", - }, - } - response := newTransaction.Charge() + newTransaction := auth.NewTransaction{ + Amount: "13.75", + CreditCard: auth.CreditCard{ + CardNumber: "4012888818888", + ExpirationDate: "08/25", + CardCode: "393", + }, + BillTo: &auth.BillTo{ + FirstName: "Timmy", + LastName: "Jimmy", + Address: "1111 green ct", + City: "los angeles", + State: "CA", + Zip: "43534", + Country: "USA", + PhoneNumber: "8885555555", + }, + } + response := newTransaction.Charge() - if response.Approved() { - newTransactionId = response.TransactionID() - fmt.Println("Transaction was Approved! #",response.TransactionID()) - } + if response.Approved() { + newTransactionId = response.TransactionID() + fmt.Println("Transaction was Approved! #", response.TransactionID()) + } } - func VoidTransaction() { newTransaction := auth.PreviousTransaction{ @@ -63,4 +62,4 @@ func VoidTransaction() { fmt.Println("Transaction was Voided!") } -} \ No newline at end of file +}