Show line items in Express Checkout review page - c#

I'm using the .net payflow sdk (Payfolow_dotNET.dll). I have code that allows the customer to use EC but the paypal review page doesn't show the item detail. It just says "You'll be able to see your order details before you pay"
UserInfo creds = new UserInfo(user, vendor, partner, pwd);
string url = "";
if (paypalObj.Testing) {
url = ConfigurationManager.AppSettings.Get("PayflowTest");
} else {
url = ConfigurationManager.AppSettings.Get("PayflowLive");
}
PayflowConnectionData connection = new PayflowConnectionData(url);
Invoice inv = new Invoice();
inv.Amt = new Currency(1.01, "USD");
inv.OrderDesc = "test item";
inv.Comment1 = "test item";
// so far this next bit is not helping
LineItem item = new LineItem();
item.Amt = new Currency(1.01, "USD");
item.Desc = "test item";
item.Qty = 1;
item.Type = "DIGITAL";
item.Name = "test item";
item.ItemNumber = "1";
inv.AddLineItem(item);
ECSetRequest setRequest = new ECSetRequest(websiteBase + "Donate/PayPalConfirmPayment", websiteBase + "Donate/Donate");
setRequest.PaymentType = "instantonly";
setRequest.NoShipping = "1";
//setRequest.AddrOverride = "1";
PayPalTender tender = new PayPalTender(setRequest);
SaleTransaction trans = new SaleTransaction(creds, connection, inv, tender, PayflowUtility.RequestId);
Response resp = trans.SubmitTransaction();
TransactionResponse transResp = resp.TransactionResponse;
Any thoughts on how to get the item details on the review page? Thx

Per the Express Checkout for Payflow guide:
You can pass:
L_NAMEn
L_DESCn
L_COSTn
L_TAXAMTn
L_QTYn
See page 57 of the guide for info on how to implement these.
These variables will allow you to display line item details on the PayPal checkout page.

Turns out I was missing one property - the item cost.
item.Cost = new Currency(1.01, "USD");
It's a little bit strange that everywhere else in the Paypal APIs the amount is AMOUNT or AMT, but for line items, it's COST.

Related

Issue on updating line item of journal entry on Netsuite using suite talk API

I am updating journal entry on Net suite using suite talk API.
I can add new lines for the record. but on updating existing line using line ID in am getting below error.
You do not have permissions to set a value for element line.line due to one of the following reasons: 1) The field is read-only; 2) An associated feature is disabled; 3) The field is available either when a record is created or updated, but not in both cases.
i can update lines using GUI but not using API
NetSuiteServiceBridge nsServiceBridge = NetSuiteServiceBridge.serviceInstance;
JournalEntry j = new JournalEntry();
//j.subsidiary =new RecordRef {internalId="2",type=RecordType.subsidiary };
j.internalId = "115939";
JournalEntryLineList jl = new JournalEntryLineList();
JournalEntryLine line1 = new JournalEntryLine();
line1.startDate = DateTime.Now;
line1.startDateSpecified = true;
line1.line = 5;
line1.lineSpecified = true;
line1.account = new RecordRef { internalId = "206", type = RecordType.account };
line1.department = new RecordRef { internalId = "1", type = RecordType.department };
line1.credit = 100;
line1.creditSpecified = true;
jl.line = new JournalEntryLine[] {line1};
jl.replaceAll = false;
j.lineList = jl;
WriteResponse r= nsServiceBridge.UpdateRecords(j);
Web Services has its own permissions separate the the native GUI
This is by design

DPRP is disabled for this merchant. Paypal Error

I am trying to Create a billing agreement with payment method:credit card.
Here is my code:
public void CreateBillingAgreement()
{
var config = ConfigManager.Instance.GetProperties();
var accessToken = new OAuthTokenCredential(config).GetAccessToken();
var apiContext = new APIContext(accessToken);
//Note: Billing agreements for credit card payments execute automatically when created. There is no need for the user to approve the agreement or to execute the agreement.
var credit_card = new CreditCard()
{
billing_address = new Address()
{
city = "Johnstown",
country_code = "US",
line1 = "52 N Main ST",
postal_code = "43210",
state = "OH"
},
cvv2 = "874",
first_name = "Test",
last_name = "abc",
expire_month = **,
expire_year = ****,
number = "********",
type = "visa"
};
List<FundingInstrument> funding_instruments = new List<FundingInstrument>();
var fund = new FundingInstrument
{
credit_card = credit_card
};
funding_instruments.Add(fund);
var payer = new Payer
{
payment_method = "credit_card",
funding_instruments = funding_instruments
};
var shipping_address = new ShippingAddress
{
line1 = "1234",
city = "California",
state = "California",
postal_code = "95070",
country_code = "US"
};
string Date = DateTime.Now.ToString("yyyy-MM-ddTHH:MM:ssZ");
//Make API call
var agreement = new Agreement
{
name = "T-Shirt of the Month Club Agreement",
description = "Agreement for T-Shirt of the Month Club Plan",
start_date = Date,
plan = new Plan
{
id = "P-*****************"
},
payer = payer,
shipping_address = shipping_address
};
var CreateExecuteAgreement = agreement.Create(apiContext);
But getting this error,
//{"name":"DPRP_DISABLED","message":"DPRP is disabled for this
merchant.","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#DPRP_DISABLED","debug_id":"********"}
}
DPRP = DirectPayment Recurring Payments. This is very specific.
To use this you would need to be using "PayPal Website Payments Pro 3.0", where you would typically use the DoDirectPayment API to process credit cards, and that is $30/mo.
On top of that, you need to add Recurring Payments, and then you would use the CreateRecurringPaymentsProfile API with credit card details included directly (which must be what this SDK you're using is doing). This is considered DPRP, and this is an additional $30/mo on top of the fee for Pro.
Many people get confused because if you sign up for "Payments Pro Recurring Billing" they will probably put you into the PayFlow version, in which case you would need to use the PayFlow API instead of DoDirectPayment / CreateRecurringPaymentsProfile.
So the first thing you need to do is very which version of Payments Pro you are using, and then verify whether or not you have Recurring Payments / Billing enabled on top of that.

How to update CreatedFrom of Journal Entry by SuiteTalk?

I have to apply/attach a Journal Entry to the VendorPayment for voiding, so that I've tried 2 ways:
First is update the (RecordRef)createdFrom of Journal Entry = (recordRef)vendorPayment
Here is my code:
RecordRef vPaymentRef = new RecordRef();
vPaymentRef.internalId = "7850";
vPaymentRef.type = RecordType.vendorPayment;
vPaymentRef.typeSpecified = true;
RecordRef currency = new RecordRef();
currency.internalId = "1";
currency.type = RecordType.currency;
RecordRef mySubsidiary = new RecordRef();
mySubsidiary.internalId = "3";
mySubsidiary.type = RecordType.subsidiary;
JournalEntry newJournalEntry = new JournalEntry();
newJournalEntry.subsidiary = mySubsidiary;
newJournalEntry.createdFrom = vPaymentRef;
//newJournalEntry.reversalEntry = "99";
newJournalEntry.reversalDate = DateTime.Now;
newJournalEntry.reversalDateSpecified = true;
//newJournalEntry.reversalDefer = true;
//newJournalEntry.reversalDeferSpecified = true;
RecordRef myCurrency = new RecordRef();
myCurrency.internalId = "1";
newJournalEntry.currency = myCurrency;
newJournalEntry.exchangeRate = .911;
newJournalEntry.exchangeRateSpecified = true;
RecordRef myDebitAccount = new RecordRef();
myDebitAccount.internalId = "290"; //account
RecordRef myCreditAccount = new RecordRef();
myCreditAccount.internalId = "25"; //a/p account
newJournalEntry.lineList = new JournalEntryLineList();
newJournalEntry.lineList.line = new JournalEntryLine[2];
newJournalEntry.lineList.line[0] = new JournalEntryLine();
newJournalEntry.lineList.line[0].account = myDebitAccount;
newJournalEntry.lineList.line[0].debit = 3333;
newJournalEntry.lineList.line[0].debitSpecified = true;
newJournalEntry.lineList.line[0].entity = vPayment.entity;
newJournalEntry.lineList.line[1] = new JournalEntryLine();
newJournalEntry.lineList.line[1].account = myCreditAccount;
newJournalEntry.lineList.line[1].credit = 3333;
newJournalEntry.lineList.line[1].creditSpecified = true;
newJournalEntry.lineList.line[1].entity = vPayment.entity;
WriteResponse wr = _service.add(newJournalEntry);
As you see, I have added a VendorPayment to CreatedFrom, the WriteResponse status return true with StatusDetail = null. But when I access the Journal Entry have just created on Netsuite site, the VOID OF is empty (not display). And the type of Journal Entry is "Journal", It have to be "Voiding Journal", and don't have "Reversal Payments Applied" beside the Entry No.
Then, I try the second way : Update the voidJournal of VendorPayment to use the Journal Entry have just created.
Here is my code :
RecordRef recordRef = new RecordRef();
recordRef.internalId = "7850";
recordRef.type = RecordType.vendorPayment;
recordRef.typeSpecified = true;
ReadResponse response2 = _service.get(recordRef);
VendorPayment vPayment = (VendorPayment)response2.record;
RecordRef recordRefJournal = new RecordRef();
recordRefJournal.internalId = "8356";
recordRefJournal.type = RecordType.journalEntry;
recordRefJournal.typeSpecified = true;
vPayment.voidJournal = recordRefJournal;
vPayment.status = "VOIDED";
WriteResponse wr2 = _service.update(vPayment);
With this way, the WriteResponse status still true, and the StatusDetail still null. When I refresh this vendorPayment on Netsuite site, nothing change, the VOIDED ON and the Status not change.
My Point is Voiding the VendorPayment by SuiteTalk.
I'm really stuck here, please help. Many thanks !!
Create From field is a field that can only be set by the system. It will only be populate when transforming transactions.
Created From field of the Invoice will only be populated when you click the Bill button of the sales order and another scenario is when you click the Receive button on the PO the Created From field of the Item Receipt.
In suitescirpt
nlapiTransformRecord('salesorder', 1, 'invoice');
What you are trying to do is not possible using the standard Created From field.
Indeed, the previous comment is right.
What you need to do is two step:
Create the journal entry and reference the Vendor in the entity lines.
Apply it as a payment against the bill.
Consider the code pattern to the article I wrote about writing off Customer Invoices with a Journal Entry.
Marty Zigman, Founder
Prolecto Resources, Inc.
NetSuite Systems Integration
Southern California's Leading Innovation and Implementation Practice

Adding Editable Fields in Adobe Echo Sign Widget

I am using Adobe Echo Sign API createwidget for signing documents,I want to add editable fields, Like we get when we select "Preview, position signatures or add form fields" here, I have attached the screen shot as well
I have tried using MergeField Info of createwidget but its not creating fields on widget API documentation
Here's my code
WidgetCreationInfo widgetinfo = new WidgetCreationInfo(widgetname, fileInfos);
MergeField[] mergedfields = new MergeField[1];
mergedfields[0] = new MergeField();
mergedfields[0].fieldName = "name";
mergedfields[0].defaultValue = "Salman";
MergeFieldInfo mergedfieldinfo = new MergeFieldInfo();
mergedfieldinfo.mergeFields = mergedfields;
widgetinfo.mergeFieldInfo = mergedfieldinfo;
MergeField[] mergedfields = new MergeField[4];
mergedfields[0] = new MergeField();
mergedfields[1] = new MergeField();
mergedfields[2] = new MergeField();
mergedfields[3] = new MergeField();
mergedfields[0].fieldName = "name";
mergedfields[0].defaultValue = "Your value";
mergedfields[1].fieldName = "your fildname";
mergedfields[1].defaultValue = "Your value";
mergedfields[2].fieldName = "your fildname";
mergedfields[2].defaultValue = "Your value";
mergedfields[3].fieldName = "your fildname";
mergedfields[3].defaultValue = "Your value";
I tried with above code and its working smoothly..

No UnitPrice available on SalesItemLineDetail using IPP .NET SDK for QuickBooks v3.0?

According to the documentation here:
https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v3/020_key_concepts/0700_other_topics#SalesItemLineDetail
I should have the ability to set a UnitPrice so my Invoices show UnitPrice, Qty and a SubTotal.
I have Invoices working great but I am missing this critical piece of information, here is my code for generating a Line on an Invoice:
foreach (var i in orderItems)
{
Line invLine = new Line();
invLine.Id = i.ItemID;
invLine.Amount = i.SubTotal.Value;
invLine.AmountSpecified = true;
invLine.Description = i.ItemName;
invLine.DetailType = LineDetailTypeEnum.SalesItemLineDetail;
invLine.DetailTypeSpecified = true;
SalesItemLineDetail silDetails = new SalesItemLineDetail();
silDetails.Qty = i.Qty;
silDetails.QtySpecified = true;
silDetails.ItemRef = new ReferenceType() { Value = i.ItemID };
invLine.AnyIntuitObject = silDetails;
invoice.Line[lineCount] = invLine;
lineCount += 1;
}
Does anyone have this working? What am I missing here?
//Line Sales Item Line Detail - UnitPrice
lineSalesItemLineDetail.AnyIntuitObject = 33m;
lineSalesItemLineDetail.ItemElementName = ItemChoiceType.UnitPrice;
https://gist.github.com/IntuitDeveloperRelations/6500373

Categories