Skip to content

Commit

Permalink
fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Kachit committed Jun 16, 2022
1 parent c92990d commit c076fe8
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions banks.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (bbf *BanksBranchesFilter) buildPath() string {

//BanksResponse struct
type BanksResponse struct {
*ResponseBody
ResponseBody
Data *BanksResponseData `json:"data,omitempty"`
}

Expand Down Expand Up @@ -95,7 +95,7 @@ type BanksResponseDataItem struct {

//BanksBranchesResponse struct
type BanksBranchesResponse struct {
*ResponseBody
ResponseBody
Data *BanksBranchesResponseData `json:"data,omitempty"`
}

Expand Down Expand Up @@ -124,7 +124,7 @@ type BanksBranchesResponseDataItem struct {

//BanksResource wrapper
type BanksResource struct {
*ResourceAbstract
ResourceAbstract
}

//GetList get banks list (see https://docs.dusupay.com/sending-money/payouts/bank-codes)
Expand Down
14 changes: 7 additions & 7 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,35 @@ func NewClientFromConfig(config *Config, cl *http.Client) (*Client, error) {

//Collections resource
func (c *Client) Collections() *CollectionsResource {
return &CollectionsResource{ResourceAbstract: NewResourceAbstract(c.transport, c.config)}
return &CollectionsResource{NewResourceAbstract(c.transport, c.config)}
}

//Payouts resource
func (c *Client) Payouts() *PayoutsResource {
return &PayoutsResource{ResourceAbstract: NewResourceAbstract(c.transport, c.config)}
return &PayoutsResource{NewResourceAbstract(c.transport, c.config)}
}

//Providers resource
func (c *Client) Providers() *ProvidersResource {
return &ProvidersResource{ResourceAbstract: NewResourceAbstract(c.transport, c.config)}
return &ProvidersResource{NewResourceAbstract(c.transport, c.config)}
}

//Merchants resource
func (c *Client) Merchants() *MerchantsResource {
return &MerchantsResource{ResourceAbstract: NewResourceAbstract(c.transport, c.config)}
return &MerchantsResource{NewResourceAbstract(c.transport, c.config)}
}

//Refunds resource
func (c *Client) Refunds() *RefundsResource {
return &RefundsResource{ResourceAbstract: NewResourceAbstract(c.transport, c.config)}
return &RefundsResource{NewResourceAbstract(c.transport, c.config)}
}

//Banks resource
func (c *Client) Banks() *BanksResource {
return &BanksResource{ResourceAbstract: NewResourceAbstract(c.transport, c.config)}
return &BanksResource{NewResourceAbstract(c.transport, c.config)}
}

//Webhooks resource
func (c *Client) Webhooks() *WebhooksResource {
return &WebhooksResource{ResourceAbstract: NewResourceAbstract(c.transport, c.config)}
return &WebhooksResource{NewResourceAbstract(c.transport, c.config)}
}
4 changes: 2 additions & 2 deletions collections.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (cr *CollectionRequest) isValid() error {

//CollectionResponse struct
type CollectionResponse struct {
*ResponseBody
ResponseBody
Data *CollectionResponseData `json:"data,omitempty"`
}

Expand Down Expand Up @@ -77,7 +77,7 @@ type CollectionResponseData struct {

//CollectionsResource wrapper
type CollectionsResource struct {
*ResourceAbstract
ResourceAbstract
}

//Create collection request (see https://docs.dusupay.com/receiving-money/collections/post-collection-request)
Expand Down
4 changes: 2 additions & 2 deletions merchants.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

//BalancesResponse struct
type BalancesResponse struct {
*ResponseBody
ResponseBody
Data *BalancesResponseData `json:"data,omitempty"`
}

Expand Down Expand Up @@ -39,7 +39,7 @@ type BalancesResponseDataItem struct {

//MerchantsResource wrapper
type MerchantsResource struct {
*ResourceAbstract
ResourceAbstract
}

//GetBalances get balances list (see https://docs.dusupay.com/appendix/account-balance)
Expand Down
4 changes: 2 additions & 2 deletions payouts.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (pr *PayoutRequest) isValid() error {

//PayoutResponse struct
type PayoutResponse struct {
*ResponseBody
ResponseBody
Data *PayoutResponseData `json:"data,omitempty"`
}

Expand All @@ -72,7 +72,7 @@ type PayoutResponseData struct {

//PayoutsResource wrapper
type PayoutsResource struct {
*ResourceAbstract
ResourceAbstract
}

//Create payout request (see https://docs.dusupay.com/sending-money/payouts/post-payout-request)
Expand Down
4 changes: 2 additions & 2 deletions providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (pf *ProvidersFilter) buildPath() string {

//ProvidersResponse struct
type ProvidersResponse struct {
*ResponseBody
ResponseBody
Data *ProvidersResponseData `json:"data,omitempty"`
}

Expand Down Expand Up @@ -73,7 +73,7 @@ type ProvidersResponseDataItem struct {

//ProvidersResource wrapper
type ProvidersResource struct {
*ResourceAbstract
ResourceAbstract
}

//GetList Get providers list (see https://docs.dusupay.com/appendix/payment-options/payment-providers)
Expand Down
4 changes: 2 additions & 2 deletions refunds.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (rr *RefundRequest) isValid() error {

//RefundResponse struct
type RefundResponse struct {
*ResponseBody
ResponseBody
Data *RefundResponseData `json:"data,omitempty"`
}

Expand All @@ -47,7 +47,7 @@ type RefundResponseData struct {

//RefundsResource wrapper
type RefundsResource struct {
*ResourceAbstract
ResourceAbstract
}

//Create refund request (see https://docs.dusupay.com/appendix/refunds)
Expand Down
4 changes: 2 additions & 2 deletions resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ type ResourceAbstract struct {
}

//NewResourceAbstract Create new resource abstract
func NewResourceAbstract(transport *Transport, config *Config) *ResourceAbstract {
return &ResourceAbstract{tr: transport, cfg: config}
func NewResourceAbstract(transport *Transport, config *Config) ResourceAbstract {
return ResourceAbstract{tr: transport, cfg: config}
}
4 changes: 2 additions & 2 deletions webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ type RefundWebhook struct {

//WebhookResponse struct
type WebhookResponse struct {
*ResponseBody
ResponseBody
Data *WebhookResponseData `json:"data,omitempty"`
}

Expand All @@ -98,7 +98,7 @@ type WebhookResponsePayload struct {

//WebhooksResource wrapper
type WebhooksResource struct {
*ResourceAbstract
ResourceAbstract
}

//SendCallback (see https://docs.dusupay.com/appendix/webhooks/webhook-trigger)
Expand Down
6 changes: 3 additions & 3 deletions webhooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type WebhooksTestSuite struct {
suite.Suite
}

func (suite *WebhooksTestSuite) TestCollectionWebhook_UnmarshalSuccess() {
func (suite *WebhooksTestSuite) TestCollectionWebhookUnmarshalSuccess() {
var webhook CollectionWebhook
body, _ := LoadStubResponseData("stubs/webhooks/request/collection-success.json")
err := json.Unmarshal(body, &webhook)
Expand All @@ -39,7 +39,7 @@ func (suite *WebhooksTestSuite) TestCollectionWebhook_UnmarshalSuccess() {
assert.Equal(suite.T(), "MTN Mobile Money - Optional", webhook.InstitutionName)
}

func (suite *WebhooksTestSuite) TestPayoutWebhook_UnmarshalSuccess() {
func (suite *WebhooksTestSuite) TestPayoutWebhookUnmarshalSuccess() {
var webhook PayoutWebhook
body, _ := LoadStubResponseData("stubs/webhooks/request/payout-success.json")
err := json.Unmarshal(body, &webhook)
Expand All @@ -62,7 +62,7 @@ func (suite *WebhooksTestSuite) TestPayoutWebhook_UnmarshalSuccess() {
assert.Equal(suite.T(), "MTN Mobile Money - Optional", webhook.InstitutionName)
}

func (suite *WebhooksTestSuite) TestRefundWebhook_UnmarshalSuccess() {
func (suite *WebhooksTestSuite) TestRefundWebhookUnmarshalSuccess() {
var webhook RefundWebhook
body, _ := LoadStubResponseData("stubs/webhooks/request/refund-success.json")
err := json.Unmarshal(body, &webhook)
Expand Down

0 comments on commit c076fe8

Please sign in to comment.