python-payflowpro on-demand payments - python

I'm trying to build a python solution where a user can enter a credit card which will be submitted and saved to the Payflow pro servers and can be billed on an on-demand basis. I know python-payflowpro supports recurring billing, but that occurs on a regular schedule, such as weekly or monthly. I'm looking to find a solution that will bill a user's card at their request without them having to enter in their card information.
I've looked through the payflow pro api docs and it looks like there is some feature where you can bill a user's account multiple times if you have the transaction id that payflow pro gives you. However, I'm not sure if this is only so merchants can make adjustments to an existing order (such as the customer wishes to later add an additional item). And I don't think that python-payflowpro supports this.
Has anyone used payflow in this way to store credit cards online and make on-demand payments to them? Is there an existing python api for this, whether it be python-payflowpro or something else? Or do I have to roll my own API for this?
I'm pretty new to payflow, so maybe I'm missing something obvious. Was wondering how other people approached this situation.
Thank you for reading and for your consideration.
Joe
This is the python-payflowpro package that I am currently using:
https://github.com/bkeating/python-payflowpro/blob/master/payflowpro/tests/client.py

Looking closer at the api source code, I found an undocumented function called reference_transaction, which allows reference transactions. It seems to allow you to make use of PayPal's Reference Transactions and allow you to store credit cards online and charge them on an ad-hoc basis.
https://github.com/bkeating/python-payflowpro/blob/master/payflowpro/client.py#L259
With a little digging, I found a way to utilize this api method, but had to do a few tricks to pass in the proper arguments. I've documented them here:
https://github.com/bkeating/python-payflowpro/issues/5

Related

delete a data feed from google recommendations AI

My company is trying out google's recommendation AI using BQ exports of merchant center and GA data sources. However, we discovered a configuration error in the merchant feed which led to most of the events being unjoined.
I would like to do a new (clean) setup and am looking for the best way to delete the old data. It seems only possible via the API?
Secondly, while the UserEventService has a purge function, there doesn't seem to be a similar function for the ProductService.
Is deleting each product one by one the only way to go?
Any pointers and examples (Python) would be greatly appreciated as there seems to be very little documentation about this at this point in time.
As you mentioned, the only way to delete data is through the API, you can use Google Cloud Client Libraries or use REST requests; however, the library does not have a function to purge all the Product data.
In this case will be necessary to delete one product at a time by using the delete_prod() function (example).
Nevertheless, as a workaround you can get the id product get_product()function (example) of your products and add them into a collection, then, iterate this collection and pass each value into the delete_prod(). In that way you can delete all the data products, but this needs to be reviewed on your side.
Additionally, I would like to share additional information provided by Google where you can find all related to Python Library.
Retail Docs API,
Python Retail library, GitHub Repository Retail API
Please keep in mind that Stackoverflow is for specific questions about code such as errors.

Django - How can I manage custom payments between users on my platform with Stripe?

I'm trying to create a platform with multiple functionalities, and one of them is a crowfunding of projects, in which the users can post a project and ask for funds. (like kickstarter or indiegogo).
I'm working with Django 2.0, Python 3.6 and PostgreSQL and I want to use Stripe for payments. I also read a bunch of the Stripe's API Documentation, and I have some ideas for doing this, but this will be my first API implementation so I would like to do it well (more even talking about payment systems).
The main question is: How can I do that multiple users realize payments to another for one project ONLY when the goals of that project are reached?
What I think that is the better is to use (Stripe Connect) Express/Custom Accounts to create an account for each user that posts a Project, so I can redirect all the payments to that account.
The thing is that I also want to apply a fee for my platform.
And I don't know exactly how can I do this. I imagine that Stripe give an option for that to evade doing two transactions in my own backend (one for the project's user and another for the platform (me).
Then I have another related problem that is when should I do the transactions?
I have to asure the 100% of the transactions, but also that the project get the funds only when it reach the goals, So I don't know if with Stripe I can freeze all the funds and then give it to the project or refund it depending on the state of the project goals.
As an alternative comes to my mind to put all the funds to an a sub-bank account of my own platform and then if the project reach the funds, do the transaction to the user's account; or if the project fails, make a full refund. The problem I see here is that if the project succeed, Stripe get's x2 times a transaction commission, and if the project fails, I (my platform) have to pay for my own the first transaction's Stripe commission. So this is not t.he correct answer at all.
Kickstarter (as a main example) only do the transaction when the
project reach the funding goals, but doing that, they can (and
usually) get some failed transactions. This is what I cannot accept in
my platform.
To sum up, I want be able to make that an user can pay to another only when the project goals are reached, get a commission for it and asure that the 100% of the transactions are accepted.
I would like to ask for help in the coding (or tips at least) because I also read the documentation of dj-stripe and pinax-stripe, but I don't see the way of doing what I need because their documentation is based on simple payments always to the same user and for subscriptions.
I think that maybe the best option is to use the python api given by Stripe.
I also searched a lot for this and found the following things: Crowdao, a project with stripe integrated for crowdfunding BUT is only for one project, so it doesn't solve the problem; A way of doing AHC with Django-allauth and Stripe, but I don't see exactly how they do that, and I want to use more payment systems too, so I imagine it doesn't fit as a good answer for my problem.
If you need any extra information please ask for it, I'll do whatever I can. Thank you very much.
You could use stripe connect and when creating the charge use authorize-only (Note: Max 7 days)
As #Oscar has suggested, connect[0] is the way to go.
So basically yourself will registered as a platform account and each projects will be registered as connected account, most likely custom/express type[1]. Your end user accounts who is contributing to each projects will live in your main platform account.
There are many ways to achieve your goal by charging the customer when goal is met. but One way is that So you can do a Destination Charge [2] and a Manual Payout[3].
Basically
In Destination charge, you charge the user $100 and transfer $80 to the connected project account; so you keep $20 as a fee;
The $80 sits on the project stripe account's balance which is not paid out to their bank account.
If the goal reaches, you trigger a manual payout to the project so that the project actually get the $80 dollars
If not, you will need to perform on refund[4] on all the transactions on that project.
That's it.
Take note the manual payout only hold for 90 days, after that it moves out directly
Your account will bear all the fees to Stripe for transactions which you can recover from your application fee ($20) on the project.
But the refund will cost you as there will be no fee earned but still payable to Stripe.
Hope it helps.
0 connect
1 accounts
2 Destination Charge
3 Manual Payouts
4 Refund

Django - User Billing Platforms / Middleware, i.e., Tracking Expenses and Charges

I am writing a webapp and I would like to start charging my users. What are the recommended billing platforms for a python/Django webapp?
I would like something that keeps track of my users' purchase history, can elegantly handle subscription purchases, a la carte items, coupon codes, and refunds, makes it straightforward to generate invoices/receipts, and can easily integrate with most payment processors. Extra points if it comes with a fancy admin interface.
I found this django-billing project, are there any others? Also, do you rely on your payment processor to handle these tasks or do you do all of them yourself?
Note: I am not asking what payment processors to use, but rather what middleware/libraries one should run on their webapp itself.
The koalixcrm is perhaps something you could start with.
It offers some of your required functionality. Still it is in a prealpha stage but it already provides PDF export for Invoices and Quotes, there is already one included plugin for subscriptions.
also try the demo
As i am the developer of the koalixcrm im very interested to work with you - perhaps we can merge our projects.
It's not really clear why Django Community hasn't come up a with complete billing system or at least a generic one to start working on.
There's many packages that can be used for getting an idea how to implement such platform:
https://www.djangopackages.com/grids/g/payment-processing/

Does Satchmo's Authorize.net payment module support MasterCard partial authorizations?

I have a Django app that uses Satchmo in conjunction with Authorize.net. Authorize.net is now supporting partial authorization for MasterCard and Discover cards, as noted here and here. Does anyone know if these changes are supported by the Authorize.net payment module in Satchmo? I found a mailing list thread on the subject, but the answer wasn't clear from that.
(I've posted this same query to both the Satchmo users' list and Satchmo developers' list, and asked in the IRC channel, with no reply. The Satchmo project largely seems to be dead, so I'm hoping someone here can help.)
The short answer is no, Satchmo's Authorize.net module does not support partial authorization out of the box. The long answer, though, is that it may be easier than you think to create what you want:
This documentation describes exactly what you need in order to post a partial payment to the
Authorize.net system:
Send x_allow_partial_auth=true with an individual transaction.
When the first transaction is successfully approved for a partial amount of the total order, a split tender ID is generated and returned. You must pass this value back in the following transactions with x_split_tender_id=<value>. (If you include both a split tender ID and a transaction ID on the same request, an error results.)
The Satchmo documentation describes how to create custom payment modules.
If you look at the source code for the Authorize.net payment module in /payment/modules/authorizenet/processor.py, you can see most of the work is already done for you. You can either extend that Authorize.net class or just copy & paste the code into a new module at, say, /payment/modules/authorizenetpartial/ and make the adjustments as noted on the Authorize.net documentation. Just substitute that x_split_tender_id in place of your x_trans_id, and possibly a few other trial-and-error tweaks, and you should be good to go.

I'm searching for a messaging platform (like XMPP) that allows tight integration with a web application

At the company I work for, we are building a cluster of web applications for collaboration. Things like accounting, billing, CRM etc.
We are using a RESTfull technique:
For database we use CouchDB
Different applications communicate with one another and with the database via http.
Besides, we have a single sign on solution, so that when you login in one application, you are automatically logged to the other.
For all apps we use Python (Pylons).
Now we need to add instant messaging to the stack.
We need to support both web and desktop clients. But just being able to chat is not enough.
We need to be able to achieve all of the following (and more similar things).
When somebody gets assigned to a task, they must receive a message. I guess this is possible with some system daemon.
There must be an option to automatically group people in groups by lots of different properties. For example, there must be groups divided both by geographical location, by company division, by job type (all the programers from different cities and different company divisions must form a group), so that one can send mass messages to a group of choice.
Rooms should be automatically created and destroyed. For example when several people visit the same invoice, a room for them must be automatically created (and they must auto-join). And when all leave the invoice, the room must be destroyed.
Authentication and authorization from our applications.
I can implement this using custom solutions like hookbox http://hookbox.org/docs/intro.html
but then I'll have lots of problems in supporting desktop clients.
I have no former experience with instant messaging. I've been reading about this lately. I've been looking mostly at things like ejabberd. But it has been a hard time and I can't find whether what I want is possible at all.
So I'd be happy if people with experience in this field could help me with some advice, articles, tales of what is possible etc.
Like frx suggested above, the StropheJS folks have an excellent book about web+xmpp coding but since you mentioned you have no experience in this type of coding I would suggest talking to some folks who have :) It will save you time in the long run - not that I'm saying don't try to implement what frx outlines, it could be a fun project :)
I know of one group who has implemented something similar and chatting with them would help solidify what you have in mind: http://andyet.net/ (I'm not affiliated with them at all except for the fact that the XMPP dev community is small and we tend to know each other :)
All goals could be achieved with ejabberd, strophe and little server side scripting
When someone gets assigned to task, server side script could easily authenticate to xmpp server and send message stanza to assigned JID. That its trivial task.
To group different people in groups, it is easily can be done from web chat app if those user properties are stored somewhere. Just join them in particular multi user chat room after authentication.
Ejabberd has option to automatically create and destroy rooms.
Ejabberd has various authorization methods including database and script auth
You could take look at StropheJS library, they have great book (paperback) released. Really recommend to read this book http://professionalxmpp.com/

Categories