-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Updates #1328
API Updates #1328
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -369,8 +369,8 @@ type ChargePaymentMethodDetailsCard struct { | |
Funding CardFunding `json:"funding"` | ||
Installments *ChargePaymentMethodDetailsCardInstallments `json:"installments"` | ||
Last4 string `json:"last4"` | ||
Network PaymentMethodCardNetwork `json:"network"` | ||
MOTO bool `json:"moto"` | ||
Network PaymentMethodCardNetwork `json:"network"` | ||
ThreeDSecure *ChargePaymentMethodDetailsCardThreeDSecure `json:"three_d_secure"` | ||
Wallet *ChargePaymentMethodDetailsCardWallet `json:"wallet"` | ||
|
||
|
@@ -512,6 +512,11 @@ type ChargePaymentMethodDetailsP24 struct { | |
Reference string `json:"reference"` | ||
VerifiedName string `json:"verified_name"` | ||
} | ||
type ChargePaymentMethodDetailsSepaCreditTransfer struct { | ||
BankName string `json:"bank_name"` | ||
Bic string `json:"bic"` | ||
Iban string `json:"iban"` | ||
} | ||
|
||
// ChargePaymentMethodDetailsSepaDebit represents details about the Sepa Debit PaymentMethod. | ||
type ChargePaymentMethodDetailsSepaDebit struct { | ||
|
@@ -551,32 +556,34 @@ type ChargePaymentMethodDetailsWechatPay struct { | |
// ChargePaymentMethodDetails represents the details about the PaymentMethod associated with the | ||
// charge. | ||
type ChargePaymentMethodDetails struct { | ||
AchCreditTransfer *ChargePaymentMethodDetailsAchCreditTransfer `json:"ach_credit_transfer"` | ||
AchDebit *ChargePaymentMethodDetailsAchDebit `json:"ach_debit"` | ||
AcssDebit *ChargePaymentMethodDetailsAcssDebit `json:"acss_debit"` | ||
AfterpayClearpay *ChargePaymentMethodDetailsAfterpayClearpay `json:"afterpay_clearpay"` | ||
Alipay *ChargePaymentMethodDetailsAlipay `json:"alipay"` | ||
AUBECSDebit *ChargePaymentMethodDetailsAUBECSDebit `json:"au_becs_debit"` | ||
BACSDebit *ChargePaymentMethodDetailsBACSDebit `json:"bacs_debit"` | ||
Bancontact *ChargePaymentMethodDetailsBancontact `json:"bancontact"` | ||
Boleto *ChargePaymentMethodDetailsBoleto `json:"boleto"` | ||
Card *ChargePaymentMethodDetailsCard `json:"card"` | ||
CardPresent *ChargePaymentMethodDetailsCardPresent `json:"card_present"` | ||
Eps *ChargePaymentMethodDetailsEps `json:"eps"` | ||
FPX *ChargePaymentMethodDetailsFPX `json:"fpx"` | ||
Giropay *ChargePaymentMethodDetailsGiropay `json:"giropay"` | ||
Grabpay *ChargePaymentMethodDetailsGrabpay `json:"grabpay"` | ||
Ideal *ChargePaymentMethodDetailsIdeal `json:"ideal"` | ||
Klarna *ChargePaymentMethodDetailsKlarna `json:"klarna"` | ||
Multibanco *ChargePaymentMethodDetailsMultibanco `json:"multibanco"` | ||
OXXO *ChargePaymentMethodDetailsOXXO `json:"oxxo"` | ||
P24 *ChargePaymentMethodDetailsP24 `json:"p24"` | ||
SepaDebit *ChargePaymentMethodDetailsSepaDebit `json:"sepa_debit"` | ||
Sofort *ChargePaymentMethodDetailsSofort `json:"sofort"` | ||
StripeAccount *ChargePaymentMethodDetailsStripeAccount `json:"stripe_account"` | ||
Type ChargePaymentMethodDetailsType `json:"type"` | ||
Wechat *ChargePaymentMethodDetailsWechat `json:"wechat"` | ||
WechatPay *ChargePaymentMethodDetailsWechatPay `json:"wechat_pay"` | ||
AchCreditTransfer *ChargePaymentMethodDetailsAchCreditTransfer `json:"ach_credit_transfer"` | ||
AchDebit *ChargePaymentMethodDetailsAchDebit `json:"ach_debit"` | ||
AcssDebit *ChargePaymentMethodDetailsAcssDebit `json:"acss_debit"` | ||
AfterpayClearpay *ChargePaymentMethodDetailsAfterpayClearpay `json:"afterpay_clearpay"` | ||
Alipay *ChargePaymentMethodDetailsAlipay `json:"alipay"` | ||
AUBECSDebit *ChargePaymentMethodDetailsAUBECSDebit `json:"au_becs_debit"` | ||
BACSDebit *ChargePaymentMethodDetailsBACSDebit `json:"bacs_debit"` | ||
Bancontact *ChargePaymentMethodDetailsBancontact `json:"bancontact"` | ||
Boleto *ChargePaymentMethodDetailsBoleto `json:"boleto"` | ||
Card *ChargePaymentMethodDetailsCard `json:"card"` | ||
CardPresent *ChargePaymentMethodDetailsCardPresent `json:"card_present"` | ||
Eps *ChargePaymentMethodDetailsEps `json:"eps"` | ||
FPX *ChargePaymentMethodDetailsFPX `json:"fpx"` | ||
Giropay *ChargePaymentMethodDetailsGiropay `json:"giropay"` | ||
Grabpay *ChargePaymentMethodDetailsGrabpay `json:"grabpay"` | ||
Ideal *ChargePaymentMethodDetailsIdeal `json:"ideal"` | ||
InteracPresent *ChargePaymentMethodDetailsInteracPresent `json:"interac_present"` | ||
Klarna *ChargePaymentMethodDetailsKlarna `json:"klarna"` | ||
Multibanco *ChargePaymentMethodDetailsMultibanco `json:"multibanco"` | ||
OXXO *ChargePaymentMethodDetailsOXXO `json:"oxxo"` | ||
P24 *ChargePaymentMethodDetailsP24 `json:"p24"` | ||
SepaCreditTransfer *ChargePaymentMethodDetailsSepaCreditTransfer `json:"sepa_credit_transfer"` | ||
SepaDebit *ChargePaymentMethodDetailsSepaDebit `json:"sepa_debit"` | ||
Sofort *ChargePaymentMethodDetailsSofort `json:"sofort"` | ||
StripeAccount *ChargePaymentMethodDetailsStripeAccount `json:"stripe_account"` | ||
Type ChargePaymentMethodDetailsType `json:"type"` | ||
Wechat *ChargePaymentMethodDetailsWechat `json:"wechat"` | ||
WechatPay *ChargePaymentMethodDetailsWechatPay `json:"wechat_pay"` | ||
} | ||
|
||
// ChargeTransferData represents the information for the transfer_data associated with a charge. | ||
|
@@ -615,7 +622,9 @@ type Charge struct { | |
Level3 ChargeLevel3 `json:"level3"` | ||
Livemode bool `json:"livemode"` | ||
Metadata map[string]string `json:"metadata"` | ||
Object string `json:"object"` | ||
OnBehalfOf *Account `json:"on_behalf_of"` | ||
Order *Order `json:"order"` | ||
Outcome *ChargeOutcome `json:"outcome"` | ||
Paid bool `json:"paid"` | ||
PaymentIntent *PaymentIntent `json:"payment_intent"` | ||
|
@@ -638,36 +647,10 @@ type Charge struct { | |
TransferGroup string `json:"transfer_group"` | ||
} | ||
|
||
// UnmarshalJSON handles deserialization of a charge. | ||
// This custom unmarshaling is needed because the resulting | ||
// property may be an ID or the full struct if it was expanded. | ||
func (c *Charge) UnmarshalJSON(data []byte) error { | ||
if id, ok := ParseID(data); ok { | ||
c.ID = id | ||
return nil | ||
} | ||
|
||
type charge Charge | ||
var v charge | ||
if err := json.Unmarshal(data, &v); err != nil { | ||
return err | ||
} | ||
|
||
*c = Charge(v) | ||
return nil | ||
} | ||
|
||
// ChargeList is a list of charges as retrieved from a list endpoint. | ||
type ChargeList struct { | ||
APIResource | ||
ListMeta | ||
Data []*Charge `json:"data"` | ||
} | ||
|
||
// FraudDetails is the structure detailing fraud status. | ||
type FraudDetails struct { | ||
UserReport ChargeFraudUserReport `json:"user_report"` | ||
StripeReport ChargeFraudStripeReport `json:"stripe_report"` | ||
UserReport ChargeFraudUserReport `json:"user_report"` | ||
} | ||
|
||
// ChargeOutcomeRule tells you the Radar rule that blocked the charge, if any. | ||
|
@@ -689,15 +672,6 @@ type ChargeOutcome struct { | |
Type string `json:"type"` | ||
} | ||
|
||
// ShippingDetails is the structure containing shipping information. | ||
type ShippingDetails struct { | ||
Address *Address `json:"address"` | ||
Carrier string `json:"carrier"` | ||
Name string `json:"name"` | ||
Phone string `json:"phone"` | ||
TrackingNumber string `json:"tracking_number"` | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whis is this disappearing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Re-added - it should've been manually specified in address.go. |
||
// UnmarshalJSON handles deserialization of a ChargeOutcomeRule. | ||
// This custom unmarshaling is needed because the resulting | ||
// property may be an id or the full struct if it was expanded. | ||
|
@@ -716,3 +690,29 @@ func (c *ChargeOutcomeRule) UnmarshalJSON(data []byte) error { | |
*c = ChargeOutcomeRule(v) | ||
return nil | ||
} | ||
|
||
// ChargeList is a list of charges as retrieved from a list endpoint. | ||
type ChargeList struct { | ||
APIResource | ||
ListMeta | ||
Data []*Charge `json:"data"` | ||
} | ||
|
||
// UnmarshalJSON handles deserialization of a Charge. | ||
// This custom unmarshaling is needed because the resulting | ||
// property may be an id or the full struct if it was expanded. | ||
func (c *Charge) UnmarshalJSON(data []byte) error { | ||
if id, ok := ParseID(data); ok { | ||
c.ID = id | ||
return nil | ||
} | ||
|
||
type charge Charge | ||
var v charge | ||
if err := json.Unmarshal(data, &v); err != nil { | ||
return err | ||
} | ||
|
||
*c = Charge(v) | ||
return nil | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,6 @@ import ( | |
issuingcardholder "github.com/stripe/stripe-go/v72/issuing/cardholder" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are those changes breaking changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was actually merged in #1323 . |
||
issuingdispute "github.com/stripe/stripe-go/v72/issuing/dispute" | ||
issuingtransaction "github.com/stripe/stripe-go/v72/issuing/transaction" | ||
"github.com/stripe/stripe-go/v72/lineitem" | ||
"github.com/stripe/stripe-go/v72/loginlink" | ||
"github.com/stripe/stripe-go/v72/mandate" | ||
"github.com/stripe/stripe-go/v72/oauth" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually nevermind, we don't capitalize these acronyms anywhere and should be consistent with elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually nevermind, we don't capitalize these acronyms anywhere and should be consistent with elsewhere.