#battbot - Terminal Interac Refunds
1 messages ยท Page 1 of 1 (latest)
{
"id": "evt_1LLsr0J93KfFVesbewYvttWj",
"object": "event",
"api_version": "2016-03-07",
"created": 1657908186,
"data": {
"object": {
"id": "tmr_EslGaA0IlxUdzR",
"object": "terminal.reader",
"action": {
"failure_code": null,
"failure_message": null,
"status": "succeeded",
"type": "refund_payment"
},
"device_sw_version": "2.4.2.3",
"device_type": "bbpos_wisepos_e",
"ip_address": "10.0.0.113",
"label": "Frank's Reader",
"livemode": false,
"location": "tml_Er0QQF6mxxwqBF",
"metadata": {
},
"serial_number": "WSC513142030549",
"status": "online"
}
},
"livemode": false,
"pending_webhooks": 3,
"request": null,
"type": "terminal.reader.action_succeeded"
}
this is what we got on the webhook
You should also have a separate charge.refunded event with the details you mentioned.
yeah, but we are hoping to only listen to reader events
for in-person payment
because for our online payments we map a different webhook url
since we have both online and in-person payements, we use different servers to process them
we don't want our online Refund messages to come to the In-Person server
That's not really a practical approach, not if you want to get this information.
The "process_payment_intent" type for the reader message contains the payment_intent id, why doesn't the refund_payment type contain anything about the payment intent or the Refund?
Terminal generates PaymentIntents, which generate Charges, which generate Refunds, and all of those objects have their own events with their own details.
also if it allowed some metadata attached, we can also do something
but the https://api.stripe.com/v1/terminal/readers/tmr_EslGaA0IlxUdzR/refund_payment doesn't document any way to attach metadata
Correct. You really need to listen for the other events. You can filter the ones you care about by looking for things like card_present or interac_present and other things like that which indicate it's related to a Terminal transaction.
ok thanks for the help
i guess it can't be helped
but it would be really convinient if you guys added just payment_intent id to the refund_payment type, like what you already do for the process_payment type
I'll flag that feedback internally!
I just tried:
data": {
"object": {
"id": "re_3LLspxJ93KfFVesb1ZcbTq9M",
"object": "refund",
"amount": 1000,
"balance_transaction": "txn_3LLspxJ93KfFVesb1d5nClDt",
"charge": "ch_3LLspxJ93KfFVesb1x5krrRH",
"created": 1657908183,
"currency": "cad",
"metadata": {
},
"payment_intent": "pi_3LLspxJ93KfFVesb1Wj0XrrZ",
"payment_method_details": {
"interac_present": {
"brand": "visa",
"cardholder_name": "USA INTERAC/Test Card 01",
"country": "CA",
"emv_auth_data": "8A023030",
"exp_month": 12,
"exp_year": 2022,
"fingerprint": "kwhaBRtMRFi693Wo",
"funding": "debit",
"generated_card": null,
"last4": "1933",
"network": "interac",
"read_method": "contact_emv",
"receipt": {
"account_type": "checking",
"application_cryptogram": "6F7FACA425F8AB63",
"application_preferred_name": "Interac",
"authorization_code": null,
"authorization_response_code": "3030",
"cardholder_verification_method": "offline_pin",
"dedicated_file_name": "A0000002771010",
"terminal_verification_results": "8000008000",
"transaction_status_information": "6800"
}
},
"type": "interac_present"
},
the refund object has the "type" interac_present" under the payment_method_details property of the Refund Object
But ironically, your java sdk's Refund object doesn't have the "payment_method_details" property
so when I use your sdk to obtain the Refund object, it doesn't actually contain the information i need to filter
Ah, you're using the Java SDK. Gotcha. Let me dig a little, hang on...
Here we go, you should be able to use this technique to access those properties: https://github.com/stripe/stripe-java#properties
that's very helpful, i'll try it out, thanks
Hi again,
Hello!
continuing from earlier
if i listen to the Refund events, i can handle successful cases
but if the refund wasn't successful on the Reader, only the Reader.failed event happens
at this point again, i need to know the payment_intent or Refund.id so i can know what failed
This is for Interac refunds specifically, correct?
yes
For Interac refunds you need to specify the Charge ID when attempting to create the refund. If the refund fails you can relay the Charge ID to your server from the client when it gets the error.
what do you mean? i'm just using the
https://api.stripe.com/v1/terminal/readers/tmr_EslGaA0IlxUdzR/refund_payment
api
as a parameter i specify the payment_intent id to that API
Not sure I understand. You're not using this approach? https://stripe.com/docs/terminal/payments/regional?integration-country=CA#refund-an-interac-payment
You mean server-driven? That's only available in the US, so I didn't expect someone doing payments in CA to be using it.
We can't talk about unreleased betas here on Discord, you would need to get help from the people who provided you access to the beta.
yeah.. about that, they told me to come to discord to ask
Who told you that?
originally i was asking them via email but they said this Discord channel is the best way to ask questions
Kristen Kalez
This is a great place to get answers to questions about anything public, but we can't help with non-public betas here. I apologize for the miscommunication.
I'm kinda stuck with this then. The stripe support and this channel just bouncing me between
I'll get things sorted out internally. Really sorry about the misdirection!
Can you DM me the email address we sent the email to that you mentioned above?
Your email address. I don't know who you are. ๐
You may want to delete that message, this is a public server. ๐
But I got it, thank you!
yeah sorry forgot this was public
No worries!
You should be getting an email soon with further details. Sorry again about the mixup!
great, thanks for the help