Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Addon Related › Stripe – Use Customer Abstraction
Tagged: stripe
- This topic has 31 replies, 4 voices, and was last updated 8 years, 2 months ago by Robert.
-
AuthorPosts
-
August 8, 2013 at 5:57 pm #9451RobertParticipant
According to Stripe documentations:
“Instead of charging the card immediately, you can create a new Customer object and save the card to that customer. This will let you charge the user at any point in the future:”
// Set your secret key: remember to change this to your live secret key in production
// See your keys here [https://manage.stripe.com/account]
Stripe::setApiKey(“sk_test_2OlQkgmBN5DRJ19zPlo0fwqg”);
// Get the credit card details submitted by the form
$token = $_POST;
// Create a Customer
$customer = Stripe_Customer::create(array(
“card” => $token,
“description” => “payinguser@example.com”)
);
// Charge the Customer instead of the card
Stripe_Charge::create(array(
“amount” => 1000, # amount in cents, again
“currency” => “usd”,
“customer” => $customer->id)
);
Would it be possible to update the Stripe functionality to process Stripe payments this way so the Stripe Customer Dashboard can be used for certain payments to a customer? This would in effect be an easy way to manually handle subscriptions with Stripe and would appear fairly simple since the data is entered on the “Collection Details” page and stored in the eStore database anyways.
Their above code example appears to create the customer object and then charge the customer. This would achieve the payment as well as allow for the future payments within the Stripe Dashboard.
Thanks,
Robert
August 12, 2013 at 3:34 pm #57011RobertParticipantJust wondering if anyone has had a chance to look into this?
August 12, 2013 at 11:39 pm #57012adminKeymasterHi, What you have there should work. We plan to implement the stripe subscription using their subscription API though.
August 13, 2013 at 1:27 am #57013RobertParticipantNot really sure how/where to update the code. Any chance of adding this functionality into the Gateway Add-On?
August 13, 2013 at 10:57 pm #57014adminKeymasterNot until we have added the stripe subscription. Our hands are full with payment gateway work.
August 14, 2013 at 12:10 am #57015RobertParticipantOk, any timeline for the strip subscription?
August 14, 2013 at 8:01 am #57016adminKeymasterCan’t say for sure. I will start working on that after I finish the bitcoin integration (via bitpay).
August 14, 2013 at 6:32 pm #57017RobertParticipantOk, thanks for the update.
November 4, 2013 at 3:14 am #57018RobertParticipantAny updates on the Strip Subscription availability?
November 4, 2013 at 4:41 am #57019morleyMemberThis would be great not only for subscriptions but also for regular purchases. For instance, if a customer made an initial payment through Stripe and opted to create an eMember account and store his or her card information, that customer could then use the stored method for later purchases. It would essentially make card payments for members as streamlined as they are for PayPal account holders.
May 12, 2016 at 1:37 am #57020RobertParticipantI know the Stripe subscription option has now been added, but any news on updating the Stripe functionality as described above so that it creates customers in the Stripe system and then charges the customers instead of just making a direct charge?
This would allow for charging a customer directly from the Stripe Dashboard if the customer wants to simply “re-purchase” a product without having to go to the website and make a purchase.
We get calls from customers asking us to do this, but can’t unless we hold their credit card information which creates a security risk for us.
As I’m sure you know, this also opens up the door for: (from Stripe’s website)
“After creating a customer in Stripe with a stored payment method, you can charge that customer at any point in time by passing the customer ID—instead of a card representation—in the charge request. Be certain to store the customer ID on your side for later use.”
This would be a significant improvement in the Stripe functionality for eStore.
I’m not asking for any custom coding, just a simple update to the current Stripe processing.
July 22, 2016 at 6:37 pm #57021RobertParticipantAny word on this enhancement?
July 23, 2016 at 6:19 am #57022wpCommerceModerator@Robert, We have a version ready for testing. I have sent you a copy via email. Let me know if you don’t receive it.
July 23, 2016 at 6:06 pm #57023RobertParticipantThat’s fantastic. Found the email (it went in to my spam folder). I’ll start testing and let you know the results.
July 23, 2016 at 7:26 pm #57024RobertParticipantIt looks like things are working well. The only caveat is that it appears to create a new customer for every charge.
This may be beyond what you’re interested in doing, but I’ll throw it out there for you to decide….but to take full advantage of the customer object in Stripe…
With Stripe, since you are now creating a customer object, you can charge the same customer object by simply storing the customer ID that Stripe assigns when you created the customer, then using that same customer ID for future charges instead of creating a new customer every time.
Now, from your end I realize this really doesn’t make sense from just the eStore perspective, because you’d never know what customer ID to use, BUT, if the person was using eMember along with eStore (as I am), then you would simply associate the customer ID with the eMember ID and use it when creating a new charge.
This is basically the same as showing a customers order history when they are using both eStore and eMember.
The real benefit here is that on Stripe, instead of having a new customer created for each and every charge a customer makes, there would just be one customer with all their charges.
Of course, this would be null and void if the customer isn’t logged in with eMember when they make their purchases (just like you can’t show them their purchase history if they’re not logged in when they make a purchase).
This would be a fantastic integration of eStore, eMember and Stripe.
So, I realize this is a long description and may be more than you’re interested in doing, but I thought I’d lay it out anyways.
Thanks again for updating the Stripe functionality to this point, it is greatly appreciated and will at least allow us to charge customers who call and want to “re-purchase” something over the phone (actually, we’ll also be able to use it as a “manual subscription” style purchase…what we call autoship purchases, where you buy a product (add to cart style)and want to receive it every 10 weeks.)
-
AuthorPosts
- You must be logged in to reply to this topic.