func meDemo(svc *api.Service, argv []string) { res, err := svc.Me() if err != nil { fmt.Printf("Error getting me info: %v\n", err) return } fmt.Printf("Sucess! Got response: %+v\n", res) }
func listDemo(svc *api.Service, argv []string) { listReq := &api.ListPaymentsRequest{ Limit: "1", } res, err := svc.ListPayments(listReq) if err != nil { fmt.Printf("Error listing payments: %v\n", err) return } fmt.Printf("Sucess! Got response: %+v\n", res) }
func friendsDemo(svc *api.Service, argv []string) { meInfo, err := svc.Me() if err != nil { fmt.Printf("Error getting me info: %v\n", err) return } res, err := svc.ListFriends(meInfo.Data.User.ID, &api.ListFriendsRequest{}) if err != nil { fmt.Printf("Error getting friends info: %v\n", err) return } fmt.Printf("Sucess! Got response: %+v\n", res) }
func makePaymentDemo(svc *api.Service, argv []string) { paymentReq := &api.MakePaymentRequest{ Phone: "15555555555", Note: "testing!", Amount: "0.10", Audience: "private", } res, err := svc.MakePayment(paymentReq) if err != nil { fmt.Printf("Error making payment: %v\n", err) return } fmt.Printf("Sucess! Got response: %+v\n", res) }