func (client *Client) CreateInvoice(i Invoice) (inv Invoice, err error) {
	match, _ := regexp.MatchString("^[[:upper:]]{3}$", i.Currency)
	if !match {
		err = errors.New("BitPayArgumentError: invalid currency code")
		return inv, err
	}

	i.Token = client.Token.Token
	response, _ := client.Post("invoices", i)
	var invoice Invoice
	invoice, err = processInvoice(response)
	return invoice, err
}
// CreateInvoice returns an invoice type or pass the error from the server. The method will create an invoice on the BitPay server.
CreateInvoice returns an invoice type or pass the error from the server. The method will create an invoice on the BitPay server.
// CreateInvoice returns an invoice type or pass the error from the server . The method will create an invoice on the BitPay server .
func (client *Client) CreateInvoice(i Invoice) (inv Invoice, err error) {
	match, _ := regexp.MatchString("^[[:upper:]]{3}$", i.Currency)
	if !match {
		err = errors.New("BitPayArgumentError: invalid currency code")
		return inv, err
	}
	i.Token = client.Token.Token
	response, _ := client.Post("invoices", i)
	var invoice Invoice
	invoice, err = processInvoice(response)
	return invoice, err
}
func ( client * Client ) CreateInvoice ( i Invoice ) ( inv Invoice , err error ) { match , _ := regexp . MatchString ( " " , i . Currency ) if ! match { err = errors . New ( " " ) return inv , err } i . Token = client . Token . Token response , _ := client . Post ( " " , i ) var invoice Invoice invoice , err = processInvoice ( response ) return invoice , err }
CreateInvoice returns an invoice type or pass the error from the server.
CreateInvoice returns an invoice type or pass the error from the server .