How to convert String into PaymentIntentId #678
-
I would like to update Example:
The above code doesn't work because the second argument to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
let id1: Result<PaymentIntentId, ParseIdError> = PaymentIntentId::from_str("pi_12345");
let id2: Result<PaymentIntentId, ParseIdError> = "pi_12345".parse(); Here is the definition: Lines 92 to 98 in 84461ce And here is a test example: Lines 733 to 743 in 84461ce |
Beta Was this translation helpful? Give feedback.
PaymentIntentId
(and all the***Id
) implementFromStr
, so you should be able to do one of these:Here is the definition:
async-stripe/src/ids.rs
Lines 92 to 98 in 84461ce
And here is a test example:
async-stripe/src/ids.rs
Lines 733 to 743 in 84461ce