token or hash value to store and charge a unique customer: Authorize.net - authorize.net

I have read the documentation and currently it supports the customer profile which i can use to charge the customer. I want to know if it is possible i can have a token which i stored in my user table along with each user and then charge that? like a hash value or the token without using the profile ids? or the only profile id is the way to charge the customer.
Actually i want to do the recurring payment manually because of returning customer and having inconsistent monthly utility bill.
Another reason is that profile it made consist on name description and email which i think is not good enough to check the uniqueness of the users profiles.

Yes, it is possible. You need to use the Customer Information Manager (CIM) API to create a payment profile. You then will have a payment profile ID for that payment profile that you can charge against without having to know or store any of that credit card information.
The profile ID is the only way to charge the customer. There is no token or hash.

Related

How to differentiate Basic/Premium plan users for premium-only features in Django REST?

I am working on a beta-stage writing tool SaaS that is built with NextJS, React, and Django REST. As I’m gaining some user base, I am starting to research on introducing a premium plan to the mix using Stripe.
As most other SaaSs, I will have a subscription-based premium plan which grants access to premium-only features. However, even after days of research, I am still lost how this is commonly implemented in Django/Backend. Here is what I’ve thought of so far, but again, I am not sure if it’s the best/common way to accomplish this.
User model has a ‘premium’ field which is either True or False
Whenever user clicks on a premium-only API call, Django will check if user is premium or not to decide whether to make the actual API call. I currently have a '/user/me/' route which returns basic user information as API GET call.
Upon successful stripe payment, stripe redirects user to the success_url. Then, somehow I will detect when user lands on success_url and then set that user’s premium field to True.
I know this is not the ideal way, because I already see lots of issues/hurdles:
How will I set ‘premium’ field back to False after user’s payment stops
How can I ‘detect’ stripe’s payment to set user’s premium field
Is this feature supposed to be implemented with Stripe customer objects instead? I would appreciate any guidance on where I should be looking for solutions.
If you use subscription on Checkout Session (low code solution), you can add additional key-value pair data such as premium: true in metadata and subscription_data.metadata fields when creating a subscription.
Once the payment is completed, those metadata will appear in checkout.session.completed and customer.subscription.updated webhook events, which you can then set the user as premium in your own database.
A customer object in Stripe can have multiple subscriptions, so this feature will be implemented on subscription object instead.

How to make a credit card validation prior to a authorization

I am using Authorize.net as a payment gateway. Now I want to check credit card validity before creating authorize payment. I am using another service to store and manage the customer's profiles and credit cards, and therefore I don't want to create a customer profile in Authorize.net, I just want to use their service to validate a credit card and later to authorize a payment.
Is there any proper way to do this validation?
Searching the documentation and other similar questions, all I could find was the option to create a customer profile, but this option doesn't seem practical to me, since it's necessary to create a customer profile, and after delete it each time I need to validate a credit card.
Does anyone had a similar problem with Authorize.net payment gateway?

Compulsory information to create CustomerProfile at Authorize.net

I am developing service for payment integration in C#. I am creating CustomerProfile at Authorize.net. We are asking user to enter his name,address,email,mobile no, credit card number, expirydate and cvv no only.
So I just want to know what are the compulsory information that I need to provide to Authorize.net to create CustomerProfile?
When creating a customer profile, you must have the following:
merchantCustomerID OR
description OR
email (except in Europe where email is required)
You can see an example here: https://community.developer.authorize.net/t5/Integration-and-Testing/CIM-CreateCustomerProfile-Issues/m-p/53776#M28859

Django 1.5 employee-management where some employees can login some can't

So I want to keep track of about 100 employees but only five of them should be able to log in into the backend (the rest starts with no loginpossibilities at all) what's the best way to solve that problem ?
I thought of an EmployeeModel that has a 1to1-relation to an abstractBaseUser but is that the way to go or is there something easier ?
~Max
Why not make use of Django 1.5's new customisable User model and model each employee as a user with an extended profile:
In Django 1.5, you can now use your own model as the store for user-related data. If your project needs a username with more than 30 characters, or if you want to store user’s names in a format other than first name/last name, or you want to put custom profile information onto your User object, you can now do so.
By making each employee a "user", you have the balance of being able to control their ability to login (using is_staff) as well as being able to add as much employee profile information that you need.
Why not just have FK from employee to user if an employee has an attached account?
Don't go for over customisation as this can be easily achieved easily using the built-in tools. Make the login_page require a permission suppose say "can login". And just make these 5 users have those permission. So rest will automatically get a permission denied response when trying to login.

Authorize.net "x_description"

I need to be able to pass identifying information through to Authorize.net's server so I can use this information when the confirmation comes back for logging purposes. We have information such as IDs for the items we sell on our site, and I'd like to have Authorize.net's response include this information to plug into our database along with the rest of the transaction data that Authorize.net's API natively supplies. Sort of like "merchant-private-data" in Google Checkout carts.
The only field I see that doesn't hold some other specific information in Authorize.net's API is x_description. My question is does the data in x_description get displayed to the customer at any point? The information I'd like to include is sensitive and not for customer's eyes. I've been over the API documentation provided by Authorize.net and it's not clear to me what is done with this field.
If this field is not private, is there a better solution to my problem which I am not seeing?
Dig through their list of API fields and see what you can use. If you want to build a list of line items, for example, look at their x_line_item field. If you're using the AIM/CIM SDK and not telling Authorize.net to e-mail a receipt then I don't see how the customer would see anything you submit to Authorize.net besides the charge on their credit card. If your customer does receive an e-mail directly from Authorize.net though, they will most likely see everything you submit. But double-check the docs I linked to be sure.
You have x_description, but also x_invoice_num and x_po_num. These fields are for the internal use of the merchant. The fields x_description and x_invoice_num can be set in the virtual terminal, if you use it to submit transactions, and also via the API. Authorize.net will return them in the response. If you set any of these two fields in an automatic recurring billing subscription, it will be returned in each individual payment response. They might be included in the email receipt also - I never used the authorize.net email receipt to the buyer. You can disable this email receipt and send your own email receipt.
I know x_description gets sent in plain text to the merchant's email, so I wouldn't use it for anything too sensitive. The description does not, however, appear on my credit card statement (as a customer).
There is another field you can use, refId. It's not well documented, but what you pass in refId will be returned in the response object as refId.
Personally, I recommend creating a database table to store your data, and then use refId to keep track of the insert ID.