How to setup multiple Authorize.net payment gateways in Opencart? - opencart

I currently use Authorize.net to handle my USD $ payments on my Opencart site. I'm trying to add the ability for customers to checkout with Euros and Pound Sterlings too. Thanks to the help of users here I was able to arrive at the conclusion that I need to setup additional Authorize.net payment gateways for each additional foreign currency I use on my site (in this case, for Euros and Pound Sterlings).
My question is this; how do I setup multiple Authorize.net payment gateways in Opencart? I'm running v1.5.1 currently.

You would need to copy all the Authorize.NET files into new payment modules (called e.g. authorizenet_eur_aim and authorizenet_gbp_aim with maybe renaming the default one into authorizenet_usd_aim) - both for admin and catalog sides.
For each of them you'll need to add a new setting in administration allowing you to set the currency code (e.g. USD) to be used for - this will be stored in the database.
Then in the model class of each Authorize.NET payment gateway when it is being decided whether this payment option is allowed to be used you would need to check the customer's currency set in the session
$this->currency->getCode() // should return value e.g. 'USD'
and the currency of each Authorize.NET payment gateway and display the matching one only.

Related

Delayed payment using Authorize.net's iframe to collect payment information

We occasionally allow our customers to purchase our product and delay the payment until a pre-determined date. In order to do this, we need to collect the payment information at the time the order is placed. We are using the iframe method of collecting payment information.
I imagine I can use ARB to set up a one-time payment that will be billed at a specific date. However, that only works if I have the payment information stored away in a profile to begin with.
How can I collect the user's payment information without an initial charge, so that I can set up a payment at a later date?
As mentioned by John Conde, there is a hosted form that will allow you to collect payment information. It supports iFrame. You can create a customer profile first and then initiate this form. There are options to verify the card information or defer it to later, depending on your requirements.
You can find documentation in the link below. Search for "GetHostedProfilePage"
https://www.authorize.net/content/dam/anet-redesign/documents/CIM_SOAP_guide.pdf

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?

Checking out amazon affiliate product in my website

I have a requirement where users will visit my site and based on some logic able to earn points. The user will then be able to use this point to checkout any item of equivalent amount that is listed in my website.
The items that are to be listed is actually coming from amazon and I am an amazon affiliate so when they make the purchase i end up earning commission.
The challenges that I am facing is amazon always takes the user to their own website for the checkout, and so I am not able to put any restriction on the cost of the item that the user is checking out. The user can very well choose some other item while doing the checkout from within amazon's website.
As per my research amazon doesn't allow checkout from 3rd party websites like mine and will always bring the user to their own website. While I can create a bot using casper.js to emulate an user i dont want to go with this.
Is there any known API or solution to achieve what I am trying ?
I don't think it's possible to have user checkout products on your website. (Why would Amazon ever allow that?)
However, I also don't think that should be important to you. You should redirect customers to Amazon with proper associate tags (www.amazon.com/dp/...?tag=...) in the URL. After that, any purchases that they make, irrespective of whether it was the one you showed on your website, become candidates for payouts to you. So, if you redirected a customer to product A on Amazon and she bought product B, you might be paid out for it, obviously if the purchase satisfied the affiliate policies.

Sage Pay Select Payment Method

I'm using a test sagepay account through opencarts sagepay integration - everything seems fine until i get to sagepay's payment page.
There is no payment methods being offered even though visa and mastercard are displayed as payment methods in the admin panel. Surely it can't be anything wrong on my part?
Looks like the card types aren't associated with the MerchantID that is being used for the transaction, for that currency/accounttype combination.
If you are sure that you are sending transactions with AccountType=E, you have an ecommerce MID on that vendor account and the currency you are using is also associated with that ecom MID, then give Sage Pay a call - they can make sure the vendor account is properly configured at their side.