-
Notifications
You must be signed in to change notification settings - Fork 0
/
bank_transfer.go
30 lines (25 loc) · 936 Bytes
/
bank_transfer.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
package budpay
import "fmt"
type BankTransferRequest struct {
Email string `json:"email" binding:"required"`
Amount string `json:"amount" binding:"required"`
Currency string `json:"currency" binding:"required"`
Reference string `json:"reference" binding:"required"`
Name string `json:"name" binding:"required"`
}
type BankTransferResponse struct {
ResponseStatus
Data AccountDetail `json:"data"`
}
type AccountDetail struct {
AccountName string `json:"account_name"`
AccountNumber string `json:"account_number"`
BankName string `json:"bank_name"`
}
func (budpayClient *BudPayClient) BankTransferCheckout(reqBody *BankTransferRequest) (*BankTransferResponse, error) {
var response BankTransferResponse
if err := budpayClient.Post("s2s/banktransfer/initialize", reqBody, &response); err != nil {
return nil, fmt.Errorf("error while making transfer checkout: %v", err)
}
return &response, nil
}