Repeated charging with Payflow Pro - activemerchant

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

Related

Stripe payments with unknown prices [duplicate]

Thus far, I've only seen examples/tutorials for stripe in which you declare an amount via choosen library to charge customers/clients. How would you write code that allows the user to input custom amount for say a "pay bill" or "donation" form. Conceptually it seems this might be an if/else statement that sets a high/low parameter but I'm not entirely sure nor how to code this to work with Stripe API. Could really use some help here. Ultimate goal is to make a simple payment page that allows user to make a custom payment and then create a customer object to charge customer at a later date.
(I realize this is an older question, but I figure the information might be useful to some people.)
Here's a simple example of a Checkout custom integration where the user can specify the amount.
Of course, Checkout doesn't actually create the charge, it only returns a card token. The amount value passed in the handler.open() call is only used for display purposes.
Once the form is submitted, in your server-side code, you'd need to retrieve the value of the amount form field and convert it to cents before making the charge creation request.
Additionally, you should validate the amount both on the client side and server side, to make sure it's an actual number, superior to the minimum charge amount and inferior to a reasonable maximum.

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.

Stripe Widget converts balance to thousands on declined card

We have integrated the Stripe widget into our checkout, works great! UNTIL a customers card is declined then the total for some reason converts into thousands
E.g if a customers is paying for goods worth £520 and the card is declined the balance is converted to £52,000.
Stripe's amount parameters are in pence for British Pounds, and cents for US Dollars. You're likely doing some conversions wrong on your own end.
Also, you have provided 0 code, so this question kinda violates the SO rules. You should add more information and code snippets of what you've already tried or this question may be at risk of being closed.

Way to enter amount of products to purchase?

Do I have to do this server side with a custom payment button instead of their (beautiful) default one? Or can I just do some logic with the javascript (price*amount) or will it not work with their custom token thingy they generate? I'm using their Java api with Google Appengine, if that makes a difference.
To add to the other posts, here's a concrete example of how I'm doing it.
On the 'pay now' page with the default button, pass in the amount. One way I'm doing this is from a form on a previous page.
Parse this amount, e.g.
<?php
...
$data_amount = $_POST['data_amount'];
...
?>
And then use this amount as a value in the JS script which actually process the charge
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
...
data-amount="<?php echo $data_amount; ?>"
...
</script>
Good luck!
The quantity and any other information about the items being purchased are irrelevant to the payment gateway, in this case, stripe. All that matters is the payment method (e.g. "visa card ending in 1234"), the amount, the currency and the customer.
You don't have to use the stripe provided checkout methods, you can write your own. The stripe examples are extensive and include Java code, though really the concepts are harder than the code itself (and the concepts aren't that hard). The token represents the payment method/customer and has nothing to do with the amount being charged.
You can do whatever you like to implement the product / quantity / price calculations. The Stripe API simply expects your server-side to make a "charge" passing the card (or customer) token, and supplying an amount and a currency. (There are a bunch of optional parameters too ...)
The "token thingy" does not contain an information about the payment itself.
I've not attempted to use Stripe myself. The above is based on a cursory (10 minute) reading of the documentation. But there are copious examples that you can find via the Stripe "Documentation" menu, including (Java) examples of what you need to do on the server side.
As the other folks have mentioned, the token doesn't contain quantity/charge amount info. The charge amount goes into the charge object.
Now, as far as additional info, particularly if you're coming from the classic PayPal world where you have quantities and so forth, or even if not but your purpose requires the back-end to know the extra detail, most (but not all) Stripe objects allow you to store key-value pairs in the optional 'metadata'.
If you're rolling up a cost (particularly if you're doing tax or other computations to get the total) you'll probably want to stuff the essentials (quantity, unit price, tax, itemized list, etc) into that block to be able to sanity-check and/or extract the details later on in the processing flow.
The Stripe docs are quite well done; click 'Java' at the top of the example column and you'll get cut-and-paste examples (for the most part).

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.

Resources