#salonmonster
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- salonmonster, 5 days ago, 3 messages
Then once we have that paymentIntent we use:
const { terminal } =
this.connectedTerminals[
this.searchInConnectedTerminals(reader, this.connectedTerminals)
];
const result = await terminal.processPayment(paymentIntent);
if (result.error) {
// Placeholder for handling result.error
return result;
} else if (result.paymentIntent) {
// Placeholder for notifying your backend to capture result.paymentIntent.id
console.log(
'log result of processPayment in stripe.service.ts: ',
result
);
// check if it is card_present or interac_present
if (
'card_present' in
result.paymentIntent.charges.data[0].payment_method_details
) {
const { brand, funding } =
result.paymentIntent.charges.data[0].payment_method_details
.card_present;
const paymentType = this.stripePaymentType(brand, funding);
return { paymentIntentID: result.paymentIntent.id, paymentType };
} else if (
'interac_present' in
result.paymentIntent.charges.data[0].payment_method_details
) {
console.log('interac present transaction');
const { brand, funding } =
result.paymentIntent.charges.data[0].payment_method_details
.interac_present;
const paymentType = this.stripePaymentType(brand, funding);
console.log('set payment type');
return { paymentIntentID: result.paymentIntent.id, paymentType };
} else {
// Placeholder for handling result.error
console.log('error processing payment');
return result;
}
}
}```
You would need to use Setup Intents to setup the card for future usage, because in order to detect the Payment Method type you have to have created the Payment Method already.
So you have to save the card on file? And incur the charge for that in order to be able to determine card type? Even if the user doesn't want their card saved on file?
I think we have customers who won't want to have their card saved.
Or is the other option that we have to limit the user so they only pay by either interac_present or card_present before they tap/dip their card?
Yeah, I believe so. One alternative might be to use what's called Separate Auth and Capture, where you place a hold on the card and then capture the payment in 2 separate steps. This would allow you to authorize the card and check to see what type of payment method it is before payment is captured (up to the amount of the hold). The only downside to that is that you would have to choose to place a hold on the card for some amount that is larger than the base payment amount.
So have them preselect: Interac or Credit
No, you could get that information automatically from the payment method they used during the authorization step: https://stripe.com/docs/payments/place-a-hold-on-a-payment-method#authorize-only
Ok, so we could theoretically authorize a payment for $0.01 over what we need?
Eg. for $100 payment then place a $100.01 payment hold, then get the card type, then process the charge?
Yes, but then you could only charge up to $100.01
If the fee is around 2%, you would want to calculate that ahead of time and place a hold for that amount
Ok.
The problem I see with the saving the card first option is that:
- the customer might not give permission to save their card on file
- there is a $0.10 charge everytime we save a card on file, so that makes each payment cost $0.10 more per payment (which is probably all of our profit)
So it seems like we'll either need to:
- Use the "Place a hold on a payment" method or
- Have the business pre-select the payment as either interact_present or card_present before the paymentIntent is created
I'm surprised there isn't another way to do this as it must be a common situation for developers who use the application_fee_amount
Those options seem sound. Yeah, we get this question a lot and it poses a difficult problem for a lot of people.