github.com/stripe/stripe-go/v76@v76.25.0/testhelpers/treasury/outboundpayment/client.go (about)

     1  //
     2  //
     3  // File generated from our OpenAPI spec
     4  //
     5  //
     6  
     7  // Package outboundpayment provides the /treasury/outbound_payments APIs
     8  package outboundpayment
     9  
    10  import (
    11  	"net/http"
    12  
    13  	stripe "github.com/stripe/stripe-go/v76"
    14  )
    15  
    16  // Client is used to invoke /treasury/outbound_payments APIs.
    17  type Client struct {
    18  	B   stripe.Backend
    19  	Key string
    20  }
    21  
    22  // Fail is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/fail` API.
    23  func Fail(id string, params *stripe.TestHelpersTreasuryOutboundPaymentFailParams) (*stripe.TreasuryOutboundPayment, error) {
    24  	return getC().Fail(id, params)
    25  }
    26  
    27  // Fail is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/fail` API.
    28  func (c Client) Fail(id string, params *stripe.TestHelpersTreasuryOutboundPaymentFailParams) (*stripe.TreasuryOutboundPayment, error) {
    29  	path := stripe.FormatURLPath(
    30  		"/v1/test_helpers/treasury/outbound_payments/%s/fail",
    31  		id,
    32  	)
    33  	outboundpayment := &stripe.TreasuryOutboundPayment{}
    34  	err := c.B.Call(http.MethodPost, path, c.Key, params, outboundpayment)
    35  	return outboundpayment, err
    36  }
    37  
    38  // Post is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/post` API.
    39  func Post(id string, params *stripe.TestHelpersTreasuryOutboundPaymentPostParams) (*stripe.TreasuryOutboundPayment, error) {
    40  	return getC().Post(id, params)
    41  }
    42  
    43  // Post is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/post` API.
    44  func (c Client) Post(id string, params *stripe.TestHelpersTreasuryOutboundPaymentPostParams) (*stripe.TreasuryOutboundPayment, error) {
    45  	path := stripe.FormatURLPath(
    46  		"/v1/test_helpers/treasury/outbound_payments/%s/post",
    47  		id,
    48  	)
    49  	outboundpayment := &stripe.TreasuryOutboundPayment{}
    50  	err := c.B.Call(http.MethodPost, path, c.Key, params, outboundpayment)
    51  	return outboundpayment, err
    52  }
    53  
    54  // ReturnOutboundPayment is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/return` API.
    55  func ReturnOutboundPayment(id string, params *stripe.TestHelpersTreasuryOutboundPaymentReturnOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) {
    56  	return getC().ReturnOutboundPayment(id, params)
    57  }
    58  
    59  // ReturnOutboundPayment is the method for the `POST /v1/test_helpers/treasury/outbound_payments/{id}/return` API.
    60  func (c Client) ReturnOutboundPayment(id string, params *stripe.TestHelpersTreasuryOutboundPaymentReturnOutboundPaymentParams) (*stripe.TreasuryOutboundPayment, error) {
    61  	path := stripe.FormatURLPath(
    62  		"/v1/test_helpers/treasury/outbound_payments/%s/return",
    63  		id,
    64  	)
    65  	outboundpayment := &stripe.TreasuryOutboundPayment{}
    66  	err := c.B.Call(http.MethodPost, path, c.Key, params, outboundpayment)
    67  	return outboundpayment, err
    68  }
    69  
    70  func getC() Client {
    71  	return Client{stripe.GetBackend(stripe.APIBackend), stripe.Key}
    72  }