#aiaone
1 messages ยท Page 1 of 1 (latest)
Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐
What can we help with?
@hallow owl please message here
ok
does golib not support 3ds?
What do you mean exactly? What are you trying to do?
thanks
I trying to access 3ds VerificationData in golang lib.
but your lib looks like not Declare that fields
The code you share in main:
type IssuingAuthorizationVerificationData struct {
// Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`.
AddressLine1Check IssuingAuthorizationVerificationDataCheck `json:"address_line1_check"`
// Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`.
AddressPostalCodeCheck IssuingAuthorizationVerificationDataCheck `json:"address_postal_code_check"`
// Whether the cardholder provided a CVC and if it matched Stripe's record.
CVCCheck IssuingAuthorizationVerificationDataCheck `json:"cvc_check"`
// Whether the cardholder provided an expiry date and if it matched Stripe's record.
ExpiryCheck IssuingAuthorizationVerificationDataCheck `json:"expiry_check"`
}
Yes
How can I access that 3ds fields in golang?
this is php lib, works fine.
this is golang lib
@tired vector
Yep, I'm looking, and what exactly is the issue here?
in golang lib unable access 3ds VerificationData so that i can't handle issuing cards transactions if that transaction trigger 3ds auth.
If the merchant supports 3ds then the issuing transaction is approved or rejected based on the 3ds result.
in golang lib, this is Impossible. Because you didn't parse the 3ds verification results.
Ah, i see
Ok, looking into this to see what's going on, but in the mean time there's another way to get at the data assuming its actually in the response
Can you share an example event/request so I can confirm? Or if you've already looked at the raw data to validate its there, great!
OK, Please hold on, I tell you how fix it. ๐
type IssuingAuthorizationVerificationData struct {
// Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`.
AddressLine1Check IssuingAuthorizationVerificationDataCheck `json:"address_line1_check"`
// Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`.
AddressPostalCodeCheck IssuingAuthorizationVerificationDataCheck `json:"address_postal_code_check"`
// Whether the cardholder provided a CVC and if it matched Stripe's record.
CVCCheck IssuingAuthorizationVerificationDataCheck `json:"cvc_check"`
// Whether the cardholder provided an expiry date and if it matched Stripe's record.
ExpiryCheck IssuingAuthorizationVerificationDataCheck `json:"expiry_check"`
// Add this to parse 3ds result from stripe rest API
// Add the following code to fix this issue.
ThreeDSecure IssuingAuthorizationVerificationThreeDSecure `json:"three_d_secure"`
}
// result is string
type IssuingAuthorizationVerificationThreeDSecureResult string
// parse result of 3ds VerificationData
type IssuingAuthorizationVerificationThreeDSecure struct {
Result IssuingAuthorizationVerificationThreeDSecureResult `json:"result"`
}
๐
added IssuingAuthorizationVerificationThreeDSecure
added IssuingAuthorizationVerificationThreeDSecure
added IssuingAuthorizationVerificationThreeDSecureResult
that's all
Yep, that's what i was expecting to see
๐
You're welcome to make a PR, but I think we'll likely push the fix out using internal tools to correct this missing piece
Pardon?
While we get that sorted out, you should be able to access the data by parsing the raw json, similar to this:
s, _ := sub.Get("sub_123", nil)
var rawData map[string]interface{}
_ = json.Unmarshal(s.LastResponse.RawJSON, &rawData)
int64(rawData["created"].(float64))
transferData, ok := rawData["transfer_data"].(map[string]interface{})
if ok {
transferData["amount_percent"].(float64))
}
Sure, I'll do this. but better way is you fix this. lol.
Sure, I'll parse that raw event in my codebase.
Issue created
