Stripe - Payment split but a fail happens, how to handle it? - stripe-payments

For my studying project, we implemented Stripe. From our app, you can buy stuff/services and split the price between users. However, we're facing a problem and we aren't sure to understand how to handle it.
Let's take this example:
A, B and C are friends and they want to split a payment. A and B accept the transaction and get debited. However, C accept but the
payment gets refused because he doesn't have enough of money on is
account.
Since A and B were charged, then we have to refund, but then we lose money, so we would like to know if it's possible to check, before charging, if the user can pay or not.
We thought about eWallet but... My team doesn't really want to implement it for some personal reasons.
We're a bit stuck, does someone has any idea or just a tip?
Thank you in advance !

I think you could probably accomplish this with Auth & Capture; i.e., Auth all 3 cards, and only proceed to Capture if all Auths are successful.

Related

Stripe: How to hold a place the payment for A range of price

I wonder to find a solution for payment using Stripe. My clients create an event and we split the bill all members who joins the event. Let's say a football game $100 / 10 players, we hold a place until cancellation term is expired, or the game is canceled. What I am looking for solution and if it is possible to make, for the same event, instead of 10 players, 15 joined or 5 only, which means the bill from each varies from $6.60 to $20. I want these players to see that range of the pricing from $6.60 to $20 and book their spot and agree that when event occurs, they will be charged anything between. I remember that was the same solution with Uber at the beginning. Can anyone share any ideas if it is still possible to create this way, maybe they are new legislation and we need to show the total amount. Thank you for any suggestions.
You can use Stripe to save payment info and then charge your customers later:
The Setup Intents API lets you save a customer’s card without an initial payment. This is helpful if you want to onboard customers now, set them up for payments, and charge them in the future—when they’re offline.
You may also be interested in placing a hold on a card and capturing funds later, assuming the time limits work for your use case.

Dialogflow reply with correct tense?

Can anyone advise me on how to ensure Dialogflow replies with correct tense, what I mean is that a user may ask questions such as:
'Can I pay monthly' or 'Is there a set-up cost'
I have entities for these aspects e.g.
'No Set-up Fees'
In my reply, I have a variable e.g.
When using the system there are $System_Benefits
The issue is this is literal so I'm getting e.g.
Q. is there a set-up fee?
A. When using the system there are set-up
The answer doesn't make sense it is not responding with 'No Set-up Fee'
I can't seem to work out how to control the response in a positive or negative tense
There is 'No' set-up fee
or
'Yes' you can pay monthly
Hope this makes sense, can anyone help me?
If your entity reference value was No Set-up Fees and set-up was a synonym in the Dialogflow Entities editing interface, then No Set-up Fees would be displayed in the answer.

Is it possible to deviate from a conversation flow and come back to the original flow in DF

I am trying to develop a chat-bot in google Dialog Flow where user deviates from the original conversation flow (CF) but ends up coming back to original somewhere in the middle.
bot responses are in bold
For example:
original CF: hi -> how may i help you -> i would like to go travelling -> OK, i would suggest Europe. would you be interested? -> yes -> alright here's the price
deviated CF: hi -> how may i help you -> i would like to go travelling -> OK, i would suggest Europe. would you be interested? -> maybe -> Europe has lot of beautiful destinations u can travel to. would you be interested -> yes -> alright here's the price
The only way i found to implement this is to make a new intent and develop its followups which is making this very redundant. I had to develop two separate intents fully. Is there any way i can make an intent just for the deviated CF and join it to the original intent?
One simple solution is to make many follow-up intents, but that is never ending process.
Here is another approach I want to suggest:
Make a list of important intents which you want to handle in case of
deviation
When the intent is hit, save that to some DB (or cache), let's say
unfinished_intent
In each request or every 2-3 requests check the value of
unfinished_intent, if it contains some intent name, prompt for it
After your intent is fulfilled, delete the unfinished_intent
This is just an idea, how to implement is upto you.
I suggested this because it is generic and it will catch all the cases.
Hope it helps.
Keep in mind that the user can change the direction of the conversation at any time. So using a long chain of followup intents is a bad idea. Even using a short chain is a bad idea. Followup intents should be limited to fairly narrow circumstances, and in most cases they're not wise nor necessary.
Instead, keep track of the information that you have about the user and the information that you still need as part of a context. If you are engaged in a side conversation, or have made a recommendation, keep track of that as well, since the user may ask questions about it. Build many top-level Intents that represent what the user is saying, not where you are in the conversation or how you plan to reply.
See also Thinking for Voice: Design Conversations, not Code based on this answer on StackOverflow.

How to ensure smooth transaction between 2 users of my website

First of all, i'm not sure if this is the right place for this kind of question, so if anyone wants to point me in a better direction, do not hesitate!
I'm currently working on a website that will allow users to trade real physical objects between eachother. For exemple, User 1 trades a rare collectible coin, to User 2, which in turns sends an other collectible coin that he has double of.
What would be the safest way for me to make sure that both parties get their coins, without anyone getting scammed ?
I already figured that I'd be using the Paypal API to check for a "Verified address".
For now, it isn't viable for me to receive both package and "re-ship" them.
I was thinking of maybe holding an amount on both credit card until both confirm delivery, but i guess that one can receive a package and say he never received it.
Edit : Would it be too much of a trouble for the user if i force them to use a shipping method and print a "shipping sticker" that i create when they both agree to do the transaction? That way it would force them to use a signature shipping method.
All ideas are more than welcome!
Thanks
There really is not a 100% way to avoid a scam as a buyer can always come back and say they did not receive the item, it was damaged, not as described, file a dispute/chargeback or etc. However PayPal does have buyer and seller protections that come into play as well that help to protect buyers from such things. Plus PayPal's fraud filters and screenings some of the best in the industry.

Repeated charging with Payflow Pro

This is probably more question for technical support of Payflow Pro, but anyway. We are trying to implement repeated charging of one credit card by Payflow Pro payment with ActiveMerchant. We need the customer to give the credit card info once and then be charged every month for variable amounts. However, there does not seem to be any explicit STORE method in the Payflow API even though it has to be somehow possible as the RECURRING billing is part of the standard. Are we missing something and there are methods for that or we have to use some workaround?
Ok, figured it out myself in the end, just FYI: this has nothing to do with the recurring payments. You can simply "STORE" credit card by issuing and voiding some small amount transaction and then later, instead of puting credit card details, you put the returned request.token (or 'pn_ref' in payflow terms).
Something like this should work
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PayflowGateway
def store(credit_card, options = {})
stored = purchase( 1, credit_card)
return stored unless stored.success?
# we may charge some money we should not but I guess there is
# no better way for now
voided = void(stored.authorization)
return voided unless voided.success?
return stored
end
end
end
end
Yes, that's the way I solved this problem too. PNRefs are quite handy for implementing your own recurring billing system... However, you'll be charged for $1 authorization-and-void amounts as well, I think, because VISA and others started to crack down on the use of those as account verifications. They're now recommending that you use ZDA (zero-dollar amount) authorizations, which return error code 0 and the response message 'Verified' instead of 'Authorized'. This works with all merchant banks -- unless PayPal is your merchant bank, in which case you'll get an error code 4 - 'Invalid Amount'. If PayPal is your merchant bank, they just recommend doing the $1 authorization-and-void, and apparently they shoulder the VISA fees.
Here's a good article on the fees and recommended practices for doing zero-dollar authorizations:
https://www.x.com/docs/DOC-1561

Resources