Skip to content

Commit

Permalink
deletions made (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronjarnot1 authored Jul 20, 2021
1 parent d2210ad commit f195993
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 145 deletions.
70 changes: 0 additions & 70 deletions billing_agreements.go

This file was deleted.

30 changes: 0 additions & 30 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,36 +328,6 @@ type (
OverrideMerchantPreferences *MerchantPreferences `json:"override_merchant_preferences,omitempty"`
}

// BillingAgreementToken response struct
BillingAgreementToken struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
StartDate string `json:"start_date,omitempty"`
AgreementDetails *AgreementDetails `json:"agreement_details,omitempty"`
Payer *Payer `json:"payer,omitempty"`
ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"`
OverrideMerchantPreferences *MerchantPreferences `json:"override_merchant_preferences,omitempty"`
OverrideChargeModels *OverrideChargeModel `json:"override_charge_models,omitempty"`
Plan *Plan `json:"plan,omitempty"`
}

//OverrideChargeModel struct
OverrideChargeModel struct {
ChargeID string `json:"charge_id"`
Amount *Amount `json:"amount"`
}

// Plan struct
Plan struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
CreateTime string `json:"create_time,omitempty"`
UpdateTime string `json:"update_time,omitempty"`
PaymentDefinitions []PaymentDefinition `json:"payment_definitions,omitempty"`
}

// BillingInfo struct
BillingInfo struct {
OutstandingBalance AmountPayout `json:"outstanding_balance,omitempty"`
Expand Down
45 changes: 0 additions & 45 deletions unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,16 +392,6 @@ func (ts *webprofileTestServer) ServeHTTP(w http.ResponseWriter, r *http.Request
ts.deleteinvalid(w, r)
}
}
if r.RequestURI == "/v1/billing-agreements/agreement-tokens" {
if r.Method == "POST" {
ts.create(w, r)
}
}
if r.RequestURI == "/v1/billing-agreements/agreements" {
if r.Method == "POST" {
ts.createWithoutName(w, r)
}
}
}

func (ts *webprofileTestServer) create(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -781,39 +771,4 @@ func TestDeleteWebProfile_invalid(t *testing.T) {
t.Fatal(err)
}

}

func TestCreateBillingAgreementToken(t *testing.T) {

ts := httptest.NewServer(&webprofileTestServer{t: t})
defer ts.Close()

c, _ := NewClient("foo", "bar", ts.URL)

_, err := c.CreateBillingAgreementToken(
context.Background(),
"name A",
"description A",
"start date A",
&Payer{PaymentMethod: "paypal"},
&BillingPlan{ID: "id B", Name: "name B", Description: "description B", Type: "type B"})

if err != nil {
t.Fatal(err)
}

}

func TestCreateBillingAgreementFromToken(t *testing.T) {

ts := httptest.NewServer(&webprofileTestServer{t: t})
defer ts.Close()

c, _ := NewClient("foo", "bar", ts.URL)

_, err := c.CreateBillingAgreementFromToken(context.Background(),"BillingAgreementToken")

if err != nil {
t.Fatal(err)
}
}

0 comments on commit f195993

Please sign in to comment.