how to set currency code in square payment gateway? and what types of currency it support.? - square

i have integrate payment gateway in my web application on PHP and i want to use CAD or GBP for currency so how to use that currency and what types of currency support it.
I have to set as below:
$request_body2 = array("amount_money" => array (
"amount" => (int)$total_ammount,
"currency" => "USD"
));`);

You can find all of Square's supported currencies here.
In order to charge a card in a specific currency, your location must support that currency. See Square's documentation on Charge for v2 in the section for amount_money.
The value of currency must match the currency associated with the business that is charging the card.
You can also only create locations for the country with which you had registered your Square account. So if you had registered in the US, you can only create US locations and process USD on your Square account.
If you're processing payments on behalf of other Square accounts (using OAuth), then you could process the payment in the currency that matches that Square account's country.

Related

Adding a sales receipt to Quickbooks Online with .NET using the IPP SDK API

This probably has a really obvious answer, but I've been stuck searching for it for a few hours now.
I'm trying to figure out how to create the sales receipt using the sdk api, for linking a payment made by a customer to his invoice. As far as I can tell, if I don't do this, the payment will get deposited to the account but the invoice will never be updated.
I'm able to read invoices, make credit card or echeck payments, and read the customer record.
But I'm trying to create a sales receipt, and I'm not quite sure how to do it.
I can read the customer record but how do I add it to the sales receipt?
This just gives me a syntax error:
Customer customer = readCustomerUsingEmail(email);
SalesReceipt salesReceipt = new SalesReceipt();
salesReceipt.CustomerRef = Customer;
When I hover over customer, it states "Cannot implicitly convert type 'Intuit.Ipp.Data.Customer' to 'Intuit.Ipp.Data.ReferenceType'".
Edit: Ok. I'm now using the Payment object instead of the SalesReceipt object.
I think I've figured out the answer but I haven't run it yet. It just doesn't show a syntax error.
ReferenceType customerRef = new ReferenceType()
{
Value = customerData.Customer.Id,
name = customerData.Customer.DisplayName
};
payment.CustomerRef = customerRef;
You're attempting to do something very wrong here: create the sales receipt using the sdk api, for linking a payment made by a customer to his invoice
That is not what a sales receipt does.
Invoice - Indicates a customer owes you money.
Payment - Indicates a customer paid you money -- this is essentially the "other side" of an invoice. You create an invoice to indicate they owe money, and you create a payment to pay off the invoice.
Sales Receipt - Indicates a customer both owed you money and already paid. e.g. this is essentially an invoice and a payment combined into one object, for use when both the invoice and payment happened at the same time.
Soooo...
A sales receipt can not link to an invoice
A sales receipt is not used to link a payment to an invoice
What you should be doing is just creating a payment, and linking the payment directly to the invoice. To create a payment, you need to supply at minimum:
The customer (the CustomerRef field)
The total amount (the TotalAmt field)
A Line object (for use linking to an invoice)
The line Amount (if it's a payment for a single invoice this generally be equal to the TotalAmt field
A LinkedTxn node, which a link to the Invoice to pay (the TxnId field)
See the examples of creating a payment and additional docs here: https://developer.intuit.com/docs/api/accounting/payment
Example:
{
"CustomerRef":
{
"value": "20",
"name": "Red Rock Diner"
},
"TotalAmt": 55.00,
"Line": [
{
"Amount": 55.00,
"LinkedTxn": [
{
"TxnId": "69",
"TxnType": "Invoice"
}]
}]
}
There's tons of sample code here:
https://developer.intuit.com/docs/00_quickbooks_online/2_build/40_sdks/01_.net/0004_sample_code_and_sample_apps
And one specific to Payments here:
https://github.com/IntuitDeveloper/SampleApp-CRUD-.Net/blob/master/SampleApp_CRUD_.Net/SampleApp_CRUD_.Net/Entities/TransactionEntities/Payment.cs

Currency Code in Twitter Ads Business account

How can I get what currency code is set for twitter ads business account. I have gone through their api-documentation, but i don't seem to find any endpoint mentioning currency code.
On the Ads Getting Started guide, there is a section discussing Currency:
The type of a currency is identified using ISO-4217. This is a three-letter string like “USD” or “EUR”. The value of a currency is represented in micros. For USD, $5.50 is encoded as 5.50*1e6, or 5,500,000. To represent a “whole value”, you need to multiply the local micro by 1e6 (1_000_000) for all currencies.
Currency is associated with a funding instrument and can be programmatically queried using the Funding Instrument API endpoints.

The TaxType code 'MOSS Spain 21%' cannot be used with account code '200'

My UK-based application needs to create invoices using Xero's API. Some customers are in other EU countries, so I have to use a different VAT rate for them.
I've added a new Tax Rate called 'MOSS Spain 21%', with the Tax Type as 'MOSS Sales'.
When creating an invoice via the API using this tax rate I get the following validation exception:
The TaxType code MOSS Spain 21% does not exist or cannot be used for this type of transaction.
The TaxType code 'MOSS Spain 21%' cannot be used with account code '200'.
200 is the sales account, so should be fine. I can manually create an invoice in the Xero UI. It's just the API call that fails. Other invoices with the normal OUTPUT2 tax rate work.
I'm using the .NET Xero API: https://github.com/XeroAPI/Xero-Net
The TaxType code isn't the user displayed name (MOSS Spain 21%) but something like TAX001 .
I had to query the API's Tax Rates end point to find the correct code for my custom tax rate.

How can I use Stripe to delay charging a customer until a physical item is shipped?

I'm in the process of building an online marketplace which sells shippable goods. The site will be similar to Etsy, which will connect merchants with buyers.
I'd like to be able to charge a customer's card ONLY when an item is shipped by a merchant to avoid chargebacks and provide an Amazon-like payment experience. This will also help us avoid chargebacks and payment disputes in case a merchant is slow to ship or flakes out. In some cases, the goods will take more than 7 days to be custom manufactured and shipped out
Here's an example timeline:
1/1/2014 - Customer adds $75 worth of items to their cart and clicks "buy". Enters credit card info.
1/1/2014 - Customer's card is verified and a $75 temporary hold is placed on their card. Order is sent to merchant for fulfillment.
1/14/2014 - Merchant ships goods to customer and adds shipping tracking info
1/14/2014 - Customer's card is charged for the full amount and merchant receives $75 minus fees.
I plan to use Stripe Connect for payment processing, but am not sure how to delay capturing a payment for more than 7 days. Any thoughts? I don't want to aggregate the funds under my own account and use payouts since this will likely run afoul of money transmission laws. Any help would be appreciated!
EDIT: It looks like Quora has a similar question here , but the answers don't seem to deal with the case where a merchant ships out the item but the payment fails.
After further research, it seems there's no way to delay capturing a charge past the 7 day authorization window.
But here's one way to delay a charge:
Tokenize a credit card using the stripe.js library
Create a new stripe customer passing in the token as the "card" param
An example from the Stripe FAQ: https://support.stripe.com/questions/can-i-save-a-card-and-charge-it-later
Note that the longer you wait between tokenizing a card and actually charging it, the more likely your charge will be declined for various reasons (expired card, lack of funds, fraud, etc). This also adds a layer of complexity (and lost sales) since you'll need to ask a buyer to resubmit payment info.
I'd still like to confirm that a certain amount can be charged (like a "preauthorization"), but this lets me at least charge the card at a later date.
Celery has built a service to help you do this with Stripe. They are very easy to use, but note that they charge 2% per transaction.
actually you can save user token and pay later with tracking info
# get the credit card details submitted by the form or app
token = params[:stripeToken]
# create a Customer
customer = Stripe::Customer.create(
card: token,
description: 'description for payinguser#example.com',
email: 'payinguser#example.com'
)
# charge the Customer instead of the card
Stripe::Charge.create(
amount: 1000, # in cents
currency: 'usd',
customer: customer.id
)
# save the customer ID in your database so you can use it later
save_stripe_customer_id(user, customer.id)
# later
customer_id = get_stripe_customer_id(user)
Stripe::Charge.create(
amount: 1500, # $15.00 this time
currency: 'usd',
customer: customer_id
)
Stripe release a delay method to place a hold without charging. https://stripe.com/docs/payments/capture-later
<?php
require_once('stripe-php/init.php');
\Stripe\Stripe::setApiKey('your stripe key');
$token = $_POST['stripeToken'];
$stripeinfo = \Stripe\Token::retrieve($token);
$email = $stripeinfo->email;
$customer = \Stripe\Customer::create(array(
"source" => $token,
"email" => $email)
);
?>

Payment using credit card through balanced payment in rails step by step

I am new to use balanced payments.
After get credit card info what is first, second... all steps..
can any one give me step by step so i can do on that way.
Thanks in advance
The steps would depend on what type of application you're trying to develop.
The basis of the system is that you create a Customer for each of your users. balanced.js removes the need for you to be PCI compliant because the sensitive data is submitted directly to Balanced and never goes through your servers. You use balanced.js to tokenize credit cards and bank accounts and add them to specific Customer instances. Once you've got the cards and bank accounts added you can do things like debit customerBuyerA and credit customerSellerB.
Next, I encourage you to read through some of the common fee scenarios to get an idea of what's going to work well for your business. https://docs.balancedpayments.com/current/#collecting-your-fees
Both https://docs.balancedpayments.com/current/overview.html and https://docs.balancedpayments.com/current/api.html have plenty of information to get you going from there.
I encourage you to stop by #balanced on IRC to get any other development questions answered.
I solved using below code in test mode (in RUBY):
Install gem "balanced"
Assign API key
Balanced.configure('API KEY')
Accept user card info
card = Balanced::Card.new( :card_number => "4111111111111111",
:expiration_month => "12",
:expiration_year => "2020"
).save
Create buyer to debit fee
buyer = Balanced::Marketplace.my_marketplace.create_buyer(:card_uri => card.uri)
5 Debit from buyer account
`another_debit = buyer.debit(
:amount => 1000,
:appears_on_statement_as => "MARKETPLACE.COM"
)`
7 Credit to Merchant account (You need to verify Bank account first from here)
merchant = Balanced::Account.find('/v1/marketplaces/TEST-MP6wn7oEW117Yn9gKXuQaTIO/bank_accounts/BANK ACC ID')
merchant.credit('1000')
Hope work for any one and suggestion welcome.