Update credit card expiry month and year nsoftware quickbooks - quickbooks

I am using nSoftware to interact with QuickBooks. My requirement is to update customer's credit card expiry month and year only. Code used for this is
nsoftware.InQB.Customer cust = new nsoftware.InQB.Customer();
cust.GetByName("test");
cust.CreditCard.ExpMonth = customer.CreditCardItem.CardExpMonth;
cust.CreditCard.ExpYear = customer.CreditCardItem.CardExpYear;
cust.Update();
Problem is GetByName method returns customer object which has credit card number like "xxxxxxxxxxxxxx1234". Updating customer object updates actual credit card number with xxx....1234. My requirement is to update only expiry month and year.
Dev Environment:- ASP.Net 4.0, C#

Modifying the credit card fields and calling the Update method will cause all of the card fields to be sent to QuickBooks, including the "xxxxxxxxxxxx1234" card number. In this case, specifying a new QBCard object can be done to make sure that only the credit card fields that you explicitly intend to update are sent to QuickBooks.
So, something like this should do the trick:
nsoftware.InQB.Customer cust = new nsoftware.InQB.Customer();
cust.GetByName("test");
QBCard card = new QBCard();
card.ExpMonth = customer.CreditCardItem.CardExpMonth;
card.ExpYear = customer.CreditCardItem.CardExpYear;
cust.CreditCard = card;
cust.Update();
Please let me know if this works for you.

Related

How to receive the verify data from bank in Core

I'm using this code to receive the verify data from bank API (Persian bank)
saleReferenceId = long.Parse(queryString["SaleReferenceId"].ToString());
saleOrderId = long.Parse(queryString["SaleOrderId"].ToString());
resultCode_bpPayRequest = queryString["ResCode"].ToString();
But After the user has paid the amount the SaleRefrenceId and other fields are empty. I wanna know how to receive these fields from bank API?
I used to receive it in asp.net.mvc by
Request.param["saleReferenceId"]
But know, I don't know how to take it in ASP.netcore
Plz help me with

Youtube API - Allows Subscribe User but takes away next day

we have a product that will subscribe a user to another user(s) after they go through and give us full permission to do so. The user is then subscribed to these other user(s) ... you can see this in youtube after the API is performed (seems successful) ... but a day later the subscribers are removed and gone? This always worked well. Anyone experience similar issues or know the why here?
When using the API with full permission scope, we Subscribe the user to a channel and we get varying results :
the Google_Service_YouTube_Subscription_Object is returned with valid data
The channel Subscription https://www.youtube.com/subscribers?ar=2&o=U may or may not increase in value (counter at top)
The channel Subscriber list https://www.youtube.com/subscribers?ar=2&o=U is not showing the new user (subscriber)
The user shows in their Youtube view that they are subscribed to the Channel
the user Comment on the video is displayed depending on the user privacy settings
the user Like on the video is counted
the NEXT day: comments, subscriber counts are removed from the Channel, likes on the video seems to stay
$youtube_client = new \Google_Client();
$youtube_client->setClientId(xxxx);
$youtube_client->setClientSecret(xxxx);
$youtube_client->setScopes(xxxx);
$youtube_client->setRedirectUri(xxxx);
$youtube = new \Google_Service_YouTube($youtube_client);
$resourceIdyt = new \Google_Service_YouTube_ResourceId();
$resourceIdyt->setChannelId($channel);
$resourceIdyt->setKind('youtube#channel');
$subscriptionSnippetyt = new \Google_Service_YouTube_SubscriptionSnippet();
$subscriptionSnippetyt->setResourceId($resourceIdyt);
$subscriptionyt = new \Google_Service_YouTube_Subscription();
$subscriptionyt->setSnippet($subscriptionSnippetyt);
$subscriptionResponse = $youtube->subscriptions->insert('id,snippet', $subscriptionyt, array());

Paypal REST API - Passing parameter during the payment process

I am integrating Paypal direct payment into my ASP.NET MVC 5 project, by using Paypal's .NET SDK. Below are the steps:
I call PayPal.Api.Payment.Create(APIContext) to redirect to Paypal site, with a successful url;
In the callback action which corresponds to the successful url, call PayPal.Api.Payment.Execute(APIContext, ExecutionContext).
What I need is pass the new order's id to Paypal when calling Payment.Create(), and receive its value in Payment.Execute(), so it can know with which order the payment is associated.
Is it possible? Thanks a lot.
Based on the SDK and the API help pages, I would leverage off of the invoice_number property in the Transaction that you are sending to the Payments.Create() end point. This transaction will be part of the Response back from PayPal, meaning you can get the OrderNumber (now called invoice_number) back from the API.
Locate this line below: invoice_number = YOUR_ORDER_NUMBER
Your PayPal Request: (taken from SDK Samples)
var apiContext = Configuration.GetAPIContext();
// A transaction defines the contract of a payment - what is the payment for and who is fulfilling it.
var transaction = new Transaction()
{
amount = new Amount(){...},
description = "This is the payment transaction description.",
item_list = new ItemList(){...},
//SET YOUR ORDER NUMBER HERE
invoice_number = YOUR_ORDER_NUMBER
};
// A resource representing a Payer that funds a payment.
var payer = new Payer(){...};
// A Payment resource; create one using the above types and intent as `sale` or `authorize`
var payment = new Payment()
{
intent = "sale",
payer = payer,
transactions = new List<Transaction>() { transaction }
};
this.flow.AddNewRequest("Create credit card payment", payment);
// Create a payment using a valid APIContext
var createdPayment = payment.Create(apiContext);
The response from PayPal (Taken From Here):

charge tax if shipping address or billing is in California

We want to charge tax if shipping or billing address is in California.
So to summarize, tax should be charged if:
Shipping address is California
Billing address is California
Do NOT charge tax if shipping and billing address both are outside of California.
Currently in the admin under tax setting I can choose either billing or shipping [drop down].
Please help me to modify the logic
Okay ! So finally I found answer to my own question and below what I did. This can be helpful
I Classes Cart.php under the function getSummaryDetails()
after this code
`$base_total_tax_inc = $this->getOrderTotal(true);
$base_total_tax_exc = $this->getOrderTotal(false);`
I have added $my_product_total = $this->getProductOrderTotal(true);
Where the function getProductOrderTotal() which I have written in order to get the total product price in the cart. After this, I have added
`
if($invoice->id_state==5 AND $delivery->id_state!=5){
$total_tax = ($my_product_total*8)/100;
$base_total_tax_inc=$base_total_tax_inc+$total_tax;
}
else{ $total_tax = $base_total_tax_inc - $base_total_tax_exc;}
`
5 is the id for California.
Notice AND $delivery->id_state!=5 in my IF condition. This I do because the delivery address is already set in the system(From Back admin) to TRUE.

Recurly: How i can Update the Recurly subscription & Billing Token in one request

I've a free plan among some other plans. when user signup with Free Plan I create the Account in RECURLY without subscription & Billing Information. When user tries to upgrade to some paid plan. I create a subscription. But with subscription, I also need to set the Billing account token in 1 Request, How i can do that in Recurly using Ruby on rails.
if account.present && subscription.blank?
recurly_result =subscription.update_attributes(subscription attributes & Account billing token)
end
You can use the Recurly.js functionality to do this. When you make the subscription call, just use the existing account_code, so that the subscription and billing information generated during the signup will get associated with the existing account. Take a look at the code samples at https://github.com/recurly/recurly-js-examples
Try this
// Specify the minimum subscription attributes: plan_code, account, and currency
$subscription = new Recurly_Subscription();
$identity_token = "identity token"
$subscription = Recurly_Subscription::get($identity_token);
try{
$accountcode = "account code";
$account = Recurly_Account::get($accountcode);
$account->first_name = $_POST['first-name'];
$account->last_name = $_POST['last-name'];
$account->email = $_POST['email'];
$account->update();
$billing_info = new Recurly_BillingInfo();
$billing_info->account_code = $accountcode;
$billing_info->token_id = $_POST['recurly-token'];
$billing_info->update();
$sub_response = $subscription->updateImmediately();
$uuid = $subscription->uuid;
.........
.........
}catch (Exception $e){
echo $e->getMessage();
}
Its PHP code , you can adjust it as per ROR

Resources