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

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.

Related

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.

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.

Stripe: Create a Charge with Coupon

Could you guy please show me how to create a Stripe Charge which can apply the discount automatically.
I have a valid coupon code (expired in far future, forever use, discount $2).
I create a new Stripe user and assign that Coupon Code for him.
I make a Charge with that customer and some money says: amount = $10.
All the thing works. When I login to Stripe Dashboard, I still see the new user in the list and he is using that Coupon Code. However in the payment, he still pay me $10 instead of $8.
I would like to make a Charge with amount = $10, however Stripe will do discounting so the true Charge will pay $8 only.
$myCard = array(
'number' => '4242424242424242',
'exp_month' => 12,
'exp_year' => 16
);
$coupon = Coupon::retrieve('6868');
//Valid coupon
$stripe_customer = Customer::create(array(
'card' => $myCard,
'email' => 'cus#info.com',
'coupon' => $coupon
));
$charge = Charge::create(array(
'customer' => $stripe_customer->id,
'amount' => 1000,
'currency' => 'usd'
));
Stripe does not allow coupons/discounts for one time payments because you don't really need Stripe to handle your coupons for one-time payments.
You need coupons for subscriptions because Stripe generates a subscription's charges automatically, by itself, on its own schedule. That means your code has no opportunity to modify the amount of the charge itself. Instead, you have to modify the subscription, which then modifies the charges it generates in the future. Stripe offers three simple ways to do this: changing the plan, setting the account balance, and adding invoice items. However, none of them allow you to specify a percentage discount or apply a modification for more than just the next invoice but less than forever. Coupons fix that issue.
A one-time charge, on the other hand, is always generated by you, so you always have an opportunity to modify the amount of the charge yourself. The problem that coupons are trying to solve doesn't exist here, so they aren't offered as an option.
reference : click here

Balanced - Set card as default funding source

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)

Resources