#elitemobile0301
1 messages · Page 1 of 1 (latest)
Hello orakaro,
Nice to meet you here
Now I am integrating Stripe API into my Android App
I am calling stripe apis directly with my google firebase functions
For payment methods, if i call stripe api directly, it will make any risk?
It does need PCI compliance?
If you don't expose the card information anywhere then you are good
What do you use in Android app? Stripe SDK?
I am using Stripe API
because Stripe SDK doesn't provide some details for Payment Method such as fingerprint
When I create payment method, I called a function in Stripe SDK, but to retrieve payment method, I called stripe api directly
fun ApiClient.stripeCreatePaymentMethod(
stripeCountry: StripeCountry,
card: Card,
listener: StripePaymentMethodListener?
) {
PaymentConfiguration.init(QEXApplication.context, stripeCountry.publishableKey)
val metadata = mapOf(
"card_mode" to card.cardMode.rawValue,
"card_holder_name" to card.cardHolderName,
"is_pin_verified" to card.isPinVerified.toString()
)
val cardNumber = card.cardNumber
val expMonth = card.expMonth
val expYear = card.expYear
val cardParams = CardParams(cardNumber, expMonth, expYear, metadata = metadata)
val paymentMethodCreateParams = PaymentMethodCreateParams.createCard(cardParams)
val callback = object : ApiResultCallback<PaymentMethod> {
override fun onError(e: Exception) {
// Listener;
listener?.onError(e)
}
override fun onSuccess(result: PaymentMethod) {
GlobalScope.launch(Dispatchers.Main) {
val stripePaymentMethodId = result.id!!
// Stripe Retrieve Payment Method;
val stripeRetrievePaymentMethodResult = stripeRetrievePaymentMethod(stripeCountry, stripePaymentMethodId)
when (stripeRetrievePaymentMethodResult) {
is ApiResult.Success -> {
// Listener;
listener?.onSuccess(stripeRetrievePaymentMethodResult.value)
}
is ApiResult.Failure -> {
// Listener;
listener?.onError(stripeRetrievePaymentMethodResult.exception)
}
}
}
}
}
stripe(stripeCountry).createPaymentMethod(paymentMethodCreateParams, callback = callback)
}
Here is code that I create Stripe Payment Method
Sorry this doesn't look safe. You have access to card.cardNumber here for example
If you accidentally log it somewhere, you will technically be exposed to PCI Compliance
I am using custom card field to get card details
Yes that's where it doesn't comply to PCI
because Stripe SDK doesn't provide some details for Payment Method such as fingerprint
I don't think so. If you use our PaymentSheet component for example, after you receive the webhook event on backend, you should see fingerprint https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-fingerprint
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Would that help?
Yes, but I have some logic
After getting payment method, we need to charge immediately
so I need to get card details once it is created
The PaymentSheet can well do that. It collects and charge right away
We can't use PaymentSheet
Actually we use third party card readers to get card number and exp date from customer's card
My business does need it, so I couldn't use PaymentSheet
This will make any risk?
Actually It is android pos app
Do you have any idea to create pos app using third party card readers?
No I don't, but I get that you retrieve card information from them before touching Stripe APIs.
Yes, I am getting card information from card reader, and then I call Stripe API directly to create Payment Method
However that stills count as API Direct integration here https://stripe.com/docs/security/guide which requires SAQ-D
You could write into Support for more details
hello! if you reach out to Stripe Support - https://support.stripe.com/contact, they'll be able to advise you on that!
Yes, sure
I will contact them too
Before contacting them, I would like to know more things
Do you have any experience with SAQ D?
unfortunately not, we mainly help with developers who want to integrate directly with the Stripe API here on this channel which is why we recommend reaching out to Support with your questions about the SAQ D
Ok, I see
So When I call Stripe API directly for Payment Method, It will make any risk?
It does need any PCI compliance?
I'm sorry but I don't really understand the question. I would really recommend that you reach out to Support for help
ok, I see