When I create a new ARB subscription the response comes back and I save the id it gives us. I tried it out and it gives us back "33".
Then when the silent post callback hits our method, the response has a different id, 15631016.
15631016 is correct in matching up with the one we see in the authorize.net online portal.
So, what is 33 and why doesn't it return the real ARB ID?
Here is the code that creates the new ARB and then gets the arbId:
net.authorize.arb.Transaction arbTransaction = createARBTransaction(startDate.getTime(), creditCard, member, splitOccurrences.intValue() - 1, splitUnit, useBillingAddress, billingAddress, recurringOrder.getTotalAmount().doubleValue(), recurringOrder);
net.authorize.arb.Result<?> arbResult = (net.authorize.arb.Result<?>) merchant.postTransaction(arbTransaction);
String arbId;
if (arbResult.isOk()) {
arbId = arbResult.getResultSubscriptionId();
}
If getResultSubscriptionId() is not the correct way to get the new ARB subscription ID, what is the correct method to use?
I went through the sample code and also their community and there isn't much to go on. The only thing I can think of trying is changing:
arbResult.getResultSubscriptionId();
to:
arbTransaction.getResultSubscriptionId();
I know that doesn't sound logical but it's the best I can some up with.
According to the source code, you are using the correct method.
If you trace the calls back into the code you'll see that the subscription id gets set by the following call in importResponseMessages() of net.authorize.arb.Result
getElementText(txn.getCurrentResponse().getDocumentElement(),AuthNetField.ELEMENT_SUBSCRIPTION_ID.getFieldName());
so if you call this on your arbResult variable, you might get closer. Note that txn should be replaced by your variable arbTransaction.
Alternatively, you can dig into the response itself to see why the Authorize.net APK isn't returning the correct subscription id.
xml = arbTransaction.getCurrentResponse().dump(true);
The true determines whether the XML tree is collapsed. xml should be a string containing your XML response from authorize.net
Related
Original Question: https://github.com/howtographql/graphql-java/issues/4
AuthContext context = env.getContext();
Link newLink = new Link(url, description, context.getUser().getId());
I do not get null on context variable, but I get a null on context.getUser()
code:https://github.com/howtographql/graphql-java/blob/master/src/main/java/com/howtographql/hackernews/Mutation.java
or my code:
https://github.com/JonathanSum/myOwnJavaGraphqlStarterKit/blob/master/src/main/java/com/howtographql/hackernews/Mutation.java
I'm the author of that tutorial, which is now unfortunately very outdated... I'm working on rewriting it in pure graphql-java (without graphql-java-tools), and this is what I'd recommend you try as well.
For the time being, your issue is very likely either because the browser doesn't send the user ID (in the Authorization header) at all or, if it does, it doesn't match the ID in Mongo.
Put a break point in createContext method in GraphQLEndpoint and inspect what happens.
The tutorial explains the code you need to add to the client to start sending the Authorization header, so make sure you followed that. otherwise, just make sure the ID it sends matches what you have in Mongo.
I am using PJSIP for creating an VOIP based application with Instant message functionality. Now, I want add delivery report in it for each message. And by going through PJSIP Document and it is written their that I can use Account.onInstantMessageStatus() for checking the outgoing message status. But the problem is that how can I specify that the following message status is of following sent message. So I dig deeper and found this from which I can send unique ID of the message and can get back it on Account.onInstantMessageStatus().
Now, the Actual problem is that in JAVA API for PJSIP SendInstantMessageParam.setUserData() takes SWIGTYPE_p_void as parameter. My question is to how to use this datatype in java to send user data over SIP messsage?
Thankyou
#awaistoor Just happened across this while I was looking for an answer to the same problem.
It's a pity nobody understood your question!
A work around I have used;
First, org.pjsip.pjsua2.SWIGTYPE_p_void in your project must be changed so that the Class methods are public.
Then I have a couple of helper methods to get/set UserData (this is on an IM not a Call);
// Get the Userdata from an IM OnInstantMessageStatusParam
public static long getIMUserData(OnInstantMessageStatusParam prm) {
SWIGTYPE_p_void p = prm.getUserData();
return SWIGTYPE_p_void.getCPtr(p);
} // getIMUserData
// Set the Userdata in a SendInstantMessageParam
public static void setIMUserData(SendInstantMessageParam prm, long value) {
prm.setUserData(new SWIGTYPE_p_void(value, false));
} // getIMUserData
I am making a call from a server that is located in US to FindItemsAdvanced of ebay finding api.
I define ListedIn as "EBAY-ENCA", however, when I make the call - I see that it doesn't return results. I believe that this is because that items are not available to US.
I see that there is a parameter called: AvailableTo - but how can I say "to all countries" ? Writing each iso code in the world could be exhausting..
My code:
ItemFilter marketFilter = new ItemFilter();
marketFilter.setName(ItemFilterType.LISTED_IN);
marketFilter.getValue().add("EBAY-ENCA");
request.getItemFilter().add(marketFilter);
ItemFilter conditionFilter = new ItemFilter();
conditionFilter.setName(ItemFilterType.AVAILABLE_TO);
conditionFilter.getValue().add("UK");
request.getItemFilter().add(conditionFilter);
In general this call should work - regardless from where you call the API. So I assume that you get an error message from the API that prevent items from being returned. Be aware that the FindItemsAdvanced call of the eBay Finding API requires either a given "categoryId" or a "keyword". Do you set any of these?
Here is the XML payload of a working call:
<findItemsAdvancedRequest xmlns="http://www.ebay.com/marketplace/search/v1/services">
<keywords>iPhone6</keywords>
<itemFilter>
<name>ListedIn</name>
<value>EBAY-ENCA</value>
</itemFilter>
</findItemsAdvancedRequest>
I've created an example in our API playground. It uses the XML version of the Finding API. Just execute the call to see the valid response with items included. You can adapt and customize the request parameters to your needs and see how the API responses.
The "AvailableTo" filter can only be used once per request with exactly one value. So it won't be possible to add it multiple times or to add it once with multiple values. But I'm not sure if I get your use case right. Do you really want to get only those items that are available world wide? If yes, then I'm afraid this most probably isn't possible without filtering them locally (eg. by filtering for "Worldwide" in the "shipToLocations").
I wanted to use the Braintree Marketplace (I've got the approval and signed to use the marketplace functionality). I used JAVA for my backend and played with the Sandbox account.
I was trying to create a submerchant accorinding to the tutorials in the overview and the specific section. E.g., the code I directly copied from the guide is (I'VE ALSO TRIED TO USE MY VALID PERSONAL INFORMATION BELOW):
MerchantAccountRequest request = new MerchantAccountRequest().
individual().
firstName("Jane").
lastName("Doe").
email("jane#14ladders.com").
phone("5553334444").
dateOfBirth("1981-11-19").
ssn("456-45-4567").
address().
streetAddress("111 Main St").
locality("Chicago").
region("IL").
postalCode("60622").
done().
done().
funding().
descriptor("Blue Ladders").
destination(MerchantAccount.FundingDestination.BANK).
email("funding#blueladders.com").
mobilePhone("071101307").
accountNumber("1123581321").
routingNumber("071101307").
done().
tosAccepted(true).
masterMerchantAccountId("14ladders_marketplace").
id("blue_ladders_store");
Result<MerchantAccount> result = gateway.merchantAccount().create(request);
I've also tried to use the testing first name
com.braintreegateway.test.MerchantAccount.Approve
so that the creation should always succeed. The code snippet is:
Result<MerchantAccount> result = gateway.merchantAccount().create(
new MerchantAccountRequest().
individual()
.firstName(com.braintreegateway.test.MerchantAccount.Approve)
.done()
);
However, in any case, when I tried to check if the result is successful (and if not, what the errors are):
logger.info("Is the result successful? " + result.isSuccess());
ValidationErrors errors = result.getErrors();
logger.info("Number of errors returned " + result.getErrors().size());
The result.isSuccess() always returns false, while there are no errors in result.getErrors(). I also cannot find any (error) information from the sandbox web account. Any insights what might go wrong? or is this because I haven't enabled the marketplace functionality?
Thanks!
I work at Braintree. If you have more questions, you can always get in touch with our support team. It looks like you already have an open ticket with us and got a response, but I'll post his here for others who have the same problem.
You're looking for result.getErrors().getAllDeepValidationErrors() not just result.getErrors().
For more information on this type of failure, see the validation errors page in the Braintree docs.
I'm at a point where I cannot figure out how to change the state of a bug from "New" to anything I'v tried "Approved,Done,Closed" every time I get the following exception shown below. I have looked all over the internet and have found that the System.State field is a bit different than other fields. I thought okay well maybe there is a method to move the transition state but couldn't find that. I also saw a few posts in the .NET api where switching the state caused other fields in particular the reason field to become invalid. I don't think this is the issue though because as soon as I try to call field.setValue("Closed") it throws the exception.I looked with power tools and the System.State does show to be editable? It can't be a transition state issue because I'v tried states that should be valid as a next step. As an example the workitem is new so Approved is a valid next step.
Please if anyone has any idea what is the problem I'd be very grateful.
Example Code:
WorkItem workItem = s.get(0);
Map<String, String> fieldValueMap = settings.getFieldValues();
String status_field_text = settings.getFieldMap().get(SettingsParser.STATUS);
Field statusField = workItem.getFields().getField(status_field_text);
String currentFieldValue = fieldValueMap.get(SettingsParser.CLOSED_STATE);
if(currentFieldValue != null)
{
statusField.setValue("Approved");//<=========== no matter what i add there i get exception
}
else
{
System.out.println("pp");
}
Exception in thread "main
Error:
" java.lang.IllegalArgumentException: field id [10013] does not exist in this collection (wi=16,size=13)
at com.microsoft.tfs.core.clients.workitem.internal.fields.FieldCollectionImpl.newIllegalFieldIDException(FieldCollectionImpl.java:119)
at com.microsoft.tfs.core.clients.workitem.internal.fields.FieldCollectionImpl.getFieldInternal(FieldCollectionImpl.java:459)
at com.microsoft.tfs.core.clients.workitem.internal.WorkItemImpl.getRuleTargetField(WorkItemImpl.java:769)
at com.microsoft.tfs.core.clients.workitem.internal.rules.RuleEngine.preProcessFields(RuleEngine.java:224)
at com.microsoft.tfs.core.clients.workitem.internal.rules.RuleEngine.fieldChanged(RuleEngine.java:196)
at com.microsoft.tfs.core.clients.workitem.internal.rules.RuleEngine.fieldChanged(RuleEngine.java:167)
at com.microsoft.tfs.core.clients.workitem.internal.fields.FieldImpl.fireRules(FieldImpl.java:795)
at com.microsoft.tfs.core.clients.workitem.internal.fields.FieldImpl.setValue(FieldImpl.java:765)
at com.microsoft.tfs.core.clients.workitem.internal.fields.FieldImpl.setValue(FieldImpl.java:457)
at com.microsoft.tfs.core.clients.workitem.internal.fields.FieldImpl.setValue(FieldImpl.java:389)
at Test.main(Test.java:54)
There is no SettingsParser in the TEE SDK. I'm not sure what this class is, but it is not helpful to updating a bug. By using it, it appears that you're trying to update the field named "10013", which does not exist.
The state field is called System.State, or better, you can simply use a constant, CoreFieldReferenceNames.STATE to refer to it.
If you look at the samples included with the SDK, you will find one (EditWorkItemByID) that should illustrate editing a work item for you. Adapting that snippet and the code you've posted above, you should try something like:
WorkItem workItem = s.get(0);
workItem.getFields().getField(CoreFieldReferenceNames.STATE).setValue("Approved");