Balanced - Set card as default funding source - payment

I have a buyer account with several, valid cards associated with it. According to Balanced's documentation the most recently added card is the default funding source. How do I set another, existing card as the default funding source without asking the user to resubmit their card details to create a new card?

You cannot currently set an alternate funding source, the most recently added card is always the default. To debit or credit a specific funding instrument such as a card or bank account you must pass through the URI of the object as the parameter funding_source or funding_destination respectively:
buyer = balanced.Account.find(uri_of_account)
card = buyer.cards[x]
debit = buyer.debit(amount_in_cents, source_uri=card.uri)
merchant = balanced.Account.find(uri_of_account)
bank_account = merchant.bank_accounts[0]
credit = merchant.credit(amount_in_cents, destination_uri=bank_account.uri)

Related

How to charge a Card that is both Credit and Debt with Stripe

I'm using Stripe to charge the user in a food ordering app, I can save theyr card and charge them just fine.
But I'm facing a problem, I'm from Brazil and here we have cards that can be both Credit and Debit. I can't figure out how to tell the payment method which funding to use.
Here's how I'm creating the payment method:
var options = new PaymentMethodCreateOptions
{
Card = new PaymentMethodCardOptions
{
Number = number,
Cvc = cvc,
ExpMonth = long.Parse(expMonth),
ExpYear = long.Parse(expYear)
},
Type = "card",
};
I'm using 'card' as the type right now, but it seems to default to charging the card as Credit Card.
Looking through the api documentation I can specify the type as:
alipay, au_becs_debit, bacs_debit, bancontact, card, eps, fpx, giropay,
grabpay, ideal, oxxo, p24, sepa_debit, sofort
I can't find a way to tell Stripe to charge the card as a Debit Card.
Is it possible for me to tell stripe which type of funding should be used to process the payment in this situation?
There isn't a way to ask Stripe to charge a card as a "debit" or a "credit" card. There also isn't really a difference in charging either a debit/credit card when you create a Charge, Stripe just charges both cards the same way.

Get Default Payment Source (default card) for Stripe Customer?

I created a POC with a customer/credit card in Stripe and I logged into my dashboard within Stripe and was able to see this customer has a default source (the test credit card I added) associated correctly. It shows this card is the default source.
When I run this .Net code:
var customerService = new CustomerService();
var stripeCustomer = await customerService.GetAsync(customerId);
To get that customer, it returns everything correctly except his source. All of the fields I had hoped I can find it from are empty! I want to know his default payment source so I can show it on the front end with a little icon to indicate it's default.
DefaultSource, DefaultSourceId, and Sources properties are all blank/null.
Is there a way to have Stripe return it, or do I need to do something else? I tried the 'expand' property for the GetAsync method but that threw an error saying the above properties are not expandable (i.e. I can't ask Stripe to expand/return Source).
Any ideas what I can do?
FYI I also tried this:
var paymentMethodService = new PaymentMethodService();
var cards = await paymentMethodService.ListAsync(new PaymentMethodListOptions { Customer = customerId, Type = "card"});
and there doesn't seem to be a property anywhere that says the card is default (although it does correctly return all cards). I believe Stripe documentation states the Customer is the holder of the default source, not the card object. What gives?
Thanks in advance!
It looks like you're using Payment Methods, since your payment method list call has the results you expect, which means the customer likely doesn't have any sources. You can try that again with the properly pluralized expand[]=sources if you do know your Customer has Sources attached.
For Payment Methods, there is no general default for the Customer. For one-time Payment Intents, you must always specify the payment_method from among those attached to the Customer for future payments.
For paying invoices (related to recurring subscriptions, eg), you can set the invoice_settings.default_payment_method for Customer. This only applies to invoices.

Stripe: Get card information so customer can update their card

My app uses subscriptions with Stripe.
I want to create a standard "account" page, which will list the customer's current card information (like "MasterCard" and last 4 of card number), and give the customer the option of updating that information.
I'm stuck on the first piece--getting back the current card information. To do this, I need the current card_id. I have tried the "listSources" method, but this returns blank data where the card info is supposed to be. What do I need to do to get that card info?
Here is what I've tried:
(I'm using Node, and running this server side)
The closest method I have found is here:
var stripe = require('stripe')(STRIPE_TOKEN);
stripe.customers.listSources(
CUSTOMER_ID,
{object: 'bank_account', limit: 3},
function(err, cards) {
// asynchronously called
}
);
This returns information (there's no error), but the docs say this method should return a data array of the cards that includes the card id for each. In testing, the data array keeps coming back empty.
I am testing with a customer id that has a valid subscription and a card that I can see on my Stripe dashboard.
Why is the data array coming back empty?
Note: there's also a retrieve source method, which should give back card details, but this method requires you have the id of the card you want info on, and that's what I am not able to get right now.
Converting this to an answer...
Stripe has recently rolled out PaymentMethods, which replace (and are separate from) the older Tokens and Sources API.
OP's issue is that their integration creates PaymentMethod objects, which won't show up in the sources list, but can instead be accessed via stripe.paymentMethods.list.

CC_PROCESSOR_NOT_FOUND error while creating customer deposit record in netsuite

Error is as below when tried to create customer deposit record using sales order id.
{"type":"error.SuiteScriptError","name":"CC_PROCESSOR_NOT_FOUND","message":"A suitable credit card processing profile was not found for this transaction.","stack":["<anonymous>(N/record/recordService.js)","<anonymous>(adhoc$-1$debugger.user:36)"],"cause":{"type":"internal error","code":"CC_PROCESSOR_NOT_FOUND","details":"A suitable credit card processing profile was not found for this transaction.","userEvent":null,"stackTrace":["<anonymous>(N/record/recordService.js)","<anonymous>(adhoc$-1$debugger.user:36)"],"notifyOff":false},"id":"","notifyOff":false,"userFacing":false}
What is the value to be set to the fieldId 'creditcardprocessor' to avoid this error.Explained with an example is a great help.
You didn't supply a valid creditcardprocessingprofile record id to that field.
This is what this fields means:
Select the credit card processor you want to use for this transaction.
You can set up credit card processors at > > Set Up Credit Card Processing.
You are missing a payment provider like CyberSource. This is a user-provided option not a list of pre-set options. Ask your accounting dept to set one up

Charging existing card and customer with security code on stripe

We are using Stripe to process payments on a website we are working on
Whenever a customer signs up we create a customer on Stripe and save the customer_Id in the DB against against the customer.
Also when a customer places an order on the website we give the option to save the card for future uses. So we save the card against the customer as a payment source on stripe.
This is the code we use to create the payment source:
public void CreatePaymentSource(int customerId, string paymentToken)
{
var customer = _customerProvider.GetLoggedInCustomer(customerId);
//returns the customer_id e.g. cux_XXXXXXX from the customers table in our DB
var userStripeId = _customerProvider.GetCustomerStripeId(customerId);
var customerService = new StripeCustomerService();
// paymentToken is the secure token provided by Stripe.js in the card details entry form
var updateOptions = new StripeCustomerUpdateOptions()
{
Email = customer.Email,
SourceToken = paymentToken
};
// update customer to create a payment source
var stripeCustomer = customerService.Update(userStripeId, updateOptions);
}
Now in the documentation it says that if we want to charge an existing card all we have to do is pass the card_id, 'customer_id' and 'amount' - based on this example: https://stripe.com/docs/charges#saving-credit-card-details-for-later
What I want is something like this:
1 - I want to show that a card is saved with last 4 digits
I can do this using the information returned from stripe for a card -
My Question
2 - I want the user to enter the security number every time they want to use the card to place an order. But how do we verify the security number against the card?
EDIT - MY NEW QUESTION
As it has been pointed out in the comment and the other Question that CVC check is not possible with Stripe - So what is the alternative to check if the user is owner of the card?
Note: We are using stripe.net - but answer in any platform or
programming language will be helpful.

Resources