-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpayments_v2.go
35 lines (31 loc) · 1.41 KB
/
payments_v2.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
// ******************************************************************
// Purpose: exported public functions that handles payments functions
// from libindy
// Author: [email protected]
// Notes:
// Copyright (c): Siemens SRL
// This work is licensed under the terms of the Apache License Version 2.0. See
// the LICENSE.txt file in the top-level directory.
// ******************************************************************
*/
package indySDK
import "github.com/joyride9999/IndySdkGoBindings/payments_v2"
// BuildGetPaymentSourcesWithFromRequest purge credential definition cache
func BuildGetPaymentSourcesWithFromRequest(wh int, submitterDID string, paymentAddress string, from int64) (string, string, error) {
channel := payments_v2.BuildGetPaymentSourcesWithFromRequest(wh, submitterDID, paymentAddress, from)
result := <-channel
if result.Error != nil {
return "", "", result.Error
}
return result.Results[0].(string), result.Results[1].(string), result.Error
}
// ParseGetPaymentSourcesWithFromResponse parses response for Indy request for getting sources list
func ParseGetPaymentSourcesWithFromResponse(paymentMethod string, respJs string) (int, string, error) {
channel := payments_v2.ParseGetPaymentSourcesWithFromResponse(paymentMethod, respJs)
result := <-channel
if result.Error != nil {
return 0, "", result.Error
}
return result.Results[0].(int), result.Results[1].(string), result.Error
}