I have a rails application in which stripe is implemented. However, I am getting an error in Stripe that says
for security reasons you cannot directly charge a source that is already attached to a customer.....
What I guessed from the error is that a card/source was already attached to a customer and some other customer is trying to pay with that card. Is it the case? Or is there something else?
And how to handle such scenarios on the developer end?
No, once a source is attached to customer A then you can't use it with customer B.
To avoid that error, make sure that each customer has their own Source and verify that the Source and Customers match when trying to create a charge.
Related
I have a rails app with gem 'braintree'.
Documentation:
https://developers.braintreepayments.com/ios+ruby/reference/request/credit-card/create
https://developers.braintreepayments.com/ios+ruby/reference/response/customer
I would like to change the way I store customer ids in the vault. (say, from "BT_#{id}" to "SOME_OTHER_KEY_BT#{id}")
I would like to keep the existing cards each customer have in the vault.
Two approaches:
Updating existing customer ids in the vault. The problem is that I don't find a way to just update (doc) the customer, because I cannot specify the parameter customer_id. This parameter is used for reference, not as a value you specify to update.
Re-creating all customers in the vault. The problem with that is that I would need to re-add every customer card info, and I don't have all the information needed (such as the card numbers) to re-submit the info.
Any suggestions ?
I work at Braintree. If you have more questions, please get in touch with our support team.
The general suggestion in cases like this, is that you really shouldn't care what the Braintree customer ID is; you should store it along with your own customer ID in your database so you can map between the two. For all other purposes other than communicating with Braintree, you should use your own ID.
First, notice I have read many post regarding this topic, but the info provided is not enough for me or is not accurate.
I´m developing a website with AngularJS and Ruby on Rails that offers different services. Users can subscribe to these services (one or many) and they get a Paypal Recurring Payment (through a profile) to pay these services (using merchant API). For a fixed amount the service is working ok for me.
The problem is, the amount can be different from one period to another, depending on the number of services the user is subscribed.
I have read Paypal docs, but It´s still not clear to me what is the right approach.
My approaches are:
Once a user subscribes a new service, I can remove the existing recurring payment profile (with fixed amount) and create a new one. This would be ok, but I have read I can´t delete a profile automatically from my application. I can only create. In order to delete an existing profile, I have to do it manually, by login in my business paypal account and delete it. If true, then this is not a solution for me, because I can´t do all flow automatically. However, this is quite strange for me. Is this true? If not, could you please let me know how to do it?
Although, I have not read deep on it, I read on a post I can use Reference transactions to implement this. Is this right?
UPDATE
https://developer.paypal.com/docs/classic/express-checkout/integration-guide/ECReferenceTxns/#recurringreftxns
As far as I understood, Reference transactions let me vary the amount to get from the buyer when I run it, but the problem is that this operation does not executes recurring (managed by Paypal). I should keep the logic in order to execute it from my application. Right?
Any other approach or clarification is welcome.
UPDATE
My first approach is to create just one variable recurring payment with the amount of all services subscribed. But, maybe the solution is to create a recurring payment profile per each service?
1) This is true if you're using Standard Subscription buttons, but if you're working with the Recurring Payments API you can cancel the profile using ManageRecurringPaymentsProfileStatus.
2) Yes, with reference transactions you can charge any amount you need to at any time, but it would be left up to you to build your own recurring payments system, basically, utilizing reference transactions. You could have a script run each day that goes through all your accounts and processes due payments accordingly.
Another option would be to have your users create a Preapproval profile and then use the Pay API to process payments using the preapproval keys. This is very similar to reference transactions.
I'm using trying to interface with Quickbooks Online for an internal application that will push and pull transactions using qbXML. My problem is that I can't figure out which message I need to send in order to list and add the items listed under the "Banking" > "Registers" page. I've gone through the messages listed in the Onscreen Reference for Intuit Software Development Kits and none of them seem to give me this information.
Also, does anyone know of a list that explains what each message does?
If you're in a bank account register, you're writing checks. There are 3 kinds of checks in QuickBooks:
Expense checks - if you added a check directly in the register window, you would be adding an expense check.
Bill payment checks - these appear in a check register, but you can only add them with a bill payment operation.
Payroll checks - these appear in the check register, but they can only be added using the Intuit Payroll Service or by enabling manual payroll (almost no one does manual payroll in actual practice, but it is good to know about for testing purposes).
The first 2 types of checks have their own message type: the Add/Mod Check and Add/Mod BillPayment messages respectively. Payroll checks can't be added by the SDK. You can query all 3 types using a Transaction query message. I should also mention that it's possible to add an entry in any register using a journal entry, but that's not a good idea unless you are certain you know what you're doing.
I hate to tell you this, but the best reference for QuickBooks messages is the one you're already using. There are also XML files in the <sdk root>\docs directory that describe SDK operations. But there is really no substitute for understanding how QuickBooks operates from a user's perspective.
If you're going to be working with QuickBooks integration, it's a good idea to make friends with one or more QuickBooks Pro Advisors so you can run these kinds of issue by them. The relationship is generally mutually beneficial, since QuickBooks Pro Advisors often find it handy to have access to an SDK programmer.
I am about to start working on my second ever Rails application and could do with some advice. It will probably help in my head typing this question anyway!
The application's purpose is to track and monitor marketing campaigns. That makes it sound way more professional that what it actually is though.
An example usage:
Add list of possible client leads to application
Create a new "campaign" in the application
Choose who on the list of possible client leads should receive the
campaign
If and when a response is received it should then be possible to go into
that client lead's profile and mark
as "Positive Response" or "Negative
Response" etc..
Once the campaign is completed it should be marked as complete, I should be able to view in a campaigns profile who was a recipient of it and likewise if I view a client lead's profile I should be able to see which campaigns were sent to them and when.
That's the general idea of the application. I have made the framework and pushed it to GitHub:
http://github.com/dannyweb/Marketing-Manager
I am trying to get an idea of what models I would need, what sort of associations they should have etc.
I am unsure whether to use something such as acts_as_taggable and give each client lead a tag which relates to a campaign name?
If anyone can offer their thoughts or ideas on how this should be structured it would be greatly appreciated.
As it's my second Rails application - I am still very much a beginner, so please be kind! The application will remain open source on GitHub if anyone is reading this and would like to use the application.
Thanks,
Danny
I think you shouldn't turn to plugins (like acts_as_taggable) just yet. I'm going to give you some pointers but not much, because figuring out what works or doesn't is exactly what will help you learn more about rails.
So, you will have a 'Client' model and a 'Campaign' model. They have an N->N relationship (A campaign can involve multiple clients, and a client can be a part of multiple campaigns).
Therefore, you'll also need another table, which will have the 'client_id' and the 'campaign_id'. You also want to store on this table wether the client replied to it, so it'll need a 'replied' boolean flag on it as well. If you call this table 'campaign_messages', then client will need to link to campaigns using 'has_many :campaigns, :through => :campaign_messages'.
With these in place, you'll be able to list all clients on a campaign or all campaigns of a client easily. You'll also probably not need REST resource for the campaign_messages, only clients and campaigns.
That's all the detail I'm going to provide you. I think it'd be better if you just followed your approach now and asked how it could be improved instead.
Cheers and good luck
I have a site where members write specialized articles. I'd like to allow my members the option of putting up a PayPal button to charge their readers for these articles.
Basically, I'd like to set it up so that a member can choose to charge for content or not. If they choose to charge for an article, then their reader must pay via PayPal before they can view the article.
What is the best way to do this?
Most PayPal website tutorials are geared towards how to integrate PayPal to sell items on one site and don't really cover how to allow a site's members to charge others.
I'd just like for members to use Website Payments Standard. I'd like to make it very simple for them to take payments. Just enter their PayPal email address into our admin console and our site will take care of everything else.
Do I need to have the member setup IPN to get this to work? Or can just adding their PayPal email be enough.
Anyhow, any tips or tutorials you could point to would be great. Also, I'm using rails if that makes a difference.
Thanks.
You touched on what my suggestion would be - have them specify their IPN URL to a resource on your site that would process the transaction and allow access to the article if appropriate.
Another option would be to process those payments yourself, then at the end of the month, say, use the Mass Pay feature to send money to all the authors. I'm not sure what your tax liability would be in this situation however - IANAL.