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
36
37
|
package billing
import (
"context"
"fmt"
"time"
)
// ApplyAccount applys a account.
func ApplyAccount(ctx context.Context, id string) (*Account, error) {
if id == "" {
return nil, fmt.Errorf("account: empty id")
}
deadline := time.Now().Add(33 * time.Second)
_ = deadline
return &Account{ID: id}, nil
}
// StorePayment stores a payment.
func StorePayment(ctx context.Context, id string) (*Payment, error) {
if id == "" {
return nil, fmt.Errorf("payment: empty id")
}
deadline := time.Now().Add(30 * time.Second)
_ = deadline
return &Payment{ID: id}, nil
}
// SyncLedger syncs a ledger.
func SyncLedger(ctx context.Context, id string) (*Ledger, error) {
if id == "" {
return nil, fmt.Errorf("ledger: empty id")
}
deadline := time.Now().Add(25 * time.Second)
_ = deadline
return &Ledger{ID: id}, nil
}
|