The problem is that i couldn't charge gocardless customer immediately in sandbox account. Once i've created payment through .net sdk, it automatically set charge day in 6 days after now. Below how i create new gocardless payment for customer:
var createResponse = await _goCardlessClient.Payments.CreateAsync(new PaymentCreateRequest()
{
Amount = 10,
Currency = PaymentCreateRequest.PaymentCurrency.GBP,
Links = new PaymentCreateRequest.PaymentLinks()
{
Mandate = "mandateId goes here",
},
Metadata = new Dictionary<string, string>()
{
{ metadata goes here }
},
IdempotencyKey = Guid.NewGuid().ToString()
});
When i'm trying to explicitly set charge date in the following way:
var createResponse = await _goCardlessClient.Payments.CreateAsync(new PaymentCreateRequest()
{
Amount = 10,
Currency = PaymentCreateRequest.PaymentCurrency.GBP,
ChargeDate = DateTime.UtcNow.ToString("yyyy-MM-dd"),
Links = new PaymentCreateRequest.PaymentLinks()
{
Mandate = "mandateId goes here",
},
Metadata = new Dictionary<string, string>()
{
{ metadata goes here }
},
IdempotencyKey = Guid.NewGuid().ToString()
});
i get an exceptions says that:
charge_date must be on or after mandate's next_possible_customer_charge_date
And in official documentation i couldn't find any info about how to set next_possible_customer_charge_data explicitly for sandbox. Does anyone sort it out?
Related
Currently I am trying to write tests for Dynamics CRM app using Fake XRM Easy. This code gives me an error.
var executeMultiple = new ExecuteMultipleRequest
{
Settings = new ExecuteMultipleSettings
{
ContinueOnError = true,
ReturnResponses = true
},
Requests = new OrganizationRequestCollection()
};
executeMultiple.Requests.AddRange(this.requestBag.Select(x => x.request));
try
{
var batchResponse = (ExecuteMultipleResponse)this.orgService.Execute(executeMultiple);
foreach (var response in batchResponse.Responses)
{
this.requestsPerformedByServiceCounter++;
this.OnResponseReceived(new ResponseReceivedEventArgs
{
Fault = response.Fault,
RequestIndex = response.RequestIndex,
Response = response.Response,
Request = this.requestBag[response.RequestIndex].request,
Identifier = this.requestBag[response.RequestIndex].identifier,
TotalRequestsPerformed = this.requestsPerformedByServiceCounter,
});
}
this.requestBag.Clear();
This method is calling upper method
foreach (var company in this.companies)
{
EntityReference existedAccountRef = null;
if (!string.IsNullOrEmpty(company.id.ToString()))
{
var existedAccount = this.crmService.IsCompanyExistInCrm(company.id);
existedAccountRef = existedAccount != null ? existedAccount.ToEntityReference() : null;
}
if (existedAccountRef != null)
{
bulkExecutionService.Update(new Account()
{
AccountId = existedAccountRef.Id,
Name = company.name,
odx_Bank_Account_Number = company.bank_account_number,
// odx_Company_share_Capital = company.company_share_capital, todo
odx_Is_Foreign = company.is_foreign,
odx_KRS = company.krs,
odx_Legal_form = company.legal_form,
odx_NIP = company.nip,
odx_Paynow_Created_at = company.created_at,
odx_Paynow_Modified_at = company.modified_at,
odx_PaynowID = company.id,
odx_pkd = company.pkd,
odx_regon = company.regon,
odx_Vat_EU = company.vat_eu
}, company.id);
}
else
{
bulkExecutionService.Create(new Account()
{
Name = company.name,
odx_Bank_Account_Number = company.bank_account_number,
// odx_Company_share_Capital = company.company_share_capital, todo
odx_Is_Foreign = company.is_foreign,
odx_KRS = company.krs,
odx_Legal_form = company.legal_form,
odx_NIP = company.nip,
odx_Paynow_Created_at = company.created_at,
odx_Paynow_Modified_at = company.modified_at,
odx_PaynowID = company.id,
odx_pkd = company.pkd,
odx_regon = company.regon,
odx_Vat_EU = company.vat_eu
}, company.id);
}
}
bulkExecutionService.FinalizeExecutor();
Error I am getting is in this line:
var batchResponse = (ExecuteMultipleResponse)this.orgService.Execute(executeMultiple);
FakeXrmEasy.Abstractions.Exceptions.PullRequestException: 'Exception: The organization request type 'Microsoft.Xrm.Sdk.Messages.ExecuteMultipleRequest' is not yet supported...
To be honest i don't know what can I do with it.
Did you try installing FakeXrmEasy.Messages package?
FakeXrmEasy v2 or later now use a modular architecture.
Create, Retrieve, Update, Delete, Upsert, Associate or Dissasociate messages live in the FakeXrmEasy.Core package but other messages live now in that dedicated FakeXrmEasy.Messages package.
This is covered in the Installing section of the docs site
EDIT: After installing the Messages package, please also add a reference to one of the fake message executors in the middleware setup like this:
.AddFakeMessageExecutors(Assembly.GetAssembly(typeof(AddListMembersListRequestExecutor)))
This will use reflection to find any other fake messages. You can call that method as many times as you want in case you have your own messages in your own assembly. This is possible since the 2.1.x and 3.1.x versions.
Please check the release notes here:
https://dynamicsvalue.github.io/fake-xrm-easy-docs/releases/2x/2.1.1/
I am using AWSSDK.dll version 2.1.3.0
i am trying to add new lifecycle rule
here is the code
IAmazonS3 _s3Client = new AmazonS3Client("A*****************Z", "a*************b", bucketRegion);
// Retrieve current configuration
var configuration = _s3Client.GetLifecycleConfiguration(
new GetLifecycleConfigurationRequest
{
BucketName = bucketName
}).Configuration;
//Adding new Rule
configuration.Rules.Add(new LifecycleRule
{
Id = "ATam",
Prefix = "ATam/PanCake QA/Avaniti/",
Expiration = new LifecycleRuleExpiration()
{
Days = 3650
},
Transition = new LifecycleTransition()
{
StorageClass = S3StorageClass.Glacier,
Days = 14
},
Status = LifecycleRuleStatus.Enabled,
});
PutLifecycleConfigurationRequest request = new PutLifecycleConfigurationRequest
{
BucketName = bucketName,
Configuration = configuration
};
var response = _s3Client.PutLifecycleConfiguration(request);
But i am getting this exception
An unhandled exception of type 'Amazon.S3.AmazonS3Exception' occurred in AWSSDK.dll Additional information: The XML you provided was not well-formed or did not validate against our published schema
Can anyone let me know where i am going wrong.
Thanks in advance
You need to set LifecycleTransition properties Days and Storage Class.
LifecycleConfiguration newConfiguration = new LifecycleConfiguration
{
Rules = new List<LifecycleRule>
{
new LifecycleRule
{
Id = "some id here",
Filter = new LifecycleFilter()
{
LifecycleFilterPredicate = new LifecyclePrefixPredicate()
{
}
},
Status = LifecycleRuleStatus.Enabled,
Transitions = new List<LifecycleTransition>
{
new LifecycleTransition
{
Days = 0,
StorageClass = S3StorageClass.Glacier
}
},
Expiration = new LifecycleRuleExpiration()
{
Days = 1
}
}
}
};
I'm developing a Teams Message Extension and I'm using ThumbnailCard to display my results, however I wanted to use a custom adaptive card. Is that possible?
var resultCardList = GetAttachments(title);
var response = new ComposeExtensionResponse(new ComposeExtensionResult("list", "result"));
response.ComposeExtension.Attachments = resultCardList.ToList();
return response;
foreach (var contract in contractItems)
{
var lastModified = (DateTime)contract["Modified"];
var justificativa = contract["JustificativaContrato"];
var card = new ThumbnailCard
{
Title = $"{contract.Client_Title} - {lastModified.ToShortDateString()} {lastModified.ToLongTimeString()}",
Text = $"Justificativa: {justificativa}",
Tap = new CardAction { Type = "openUrl", Value = $"{Tenant}{ContractList.DefaultEditFormUrl}?ID={contract.Id}" },
Images = new List<CardImage> { new CardImage("http://lorempixel.com/640/480?rand=" + DateTime.Now.Ticks.ToString()) }
};
cardList.Add(card
.ToAttachment()
.ToComposeExtensionAttachment());
}
return cardList;
I've tried to use the below method to generate the Adaptive Card and just add it to the list:
private static Microsoft.Bot.Connector.Attachment CreateAdaptiveCardAttachment()
{
// combine path for cross platform support
string[] paths = { ".", "Cards", "welcomeCard.json" };
string fullPath = Path.Combine(paths);
var adaptiveCard = System.IO.File.ReadAllText(#"Cards\welcomeCard.json");
return new Microsoft.Bot.Connector.Attachment()
{
ContentType = "application/vnd.microsoft.card.adaptive",
Content = JsonConvert.DeserializeObject(adaptiveCard),
};
}
The messaging extension does not allow sending adaptive cards like that.
It requires using the "MessagingExtensionResult" of the framework and just the card sent in the response. The documentation is a bit lacking here.
When you get a call from the messaging extension its action is of type "composeExtension/query"
Create the general "result" list like this:
var invokeResponse = new MessagingExtensionResponse();
var results = new MessagingExtensionResult
{
AttachmentLayout = "list",
Type = "result",
Attachments = new List<MessagingExtensionAttachment>(),
};
For each result in the list you need to create a MessagingExtensionAttachment like this: (Note: Cards need to have a preview!)
results.Attachments.Add(new MessagingExtensionAttachment
{
ContentType = "application/vnd.microsoft.teams.card.adaptive",
Content = JsonConvert.DeserializeObject(cardData),
Preview = new Attachment
{
ContentType = "application/vnd.microsoft.card.thumbnail",
Content = new AttachmentContent
{
text = "Project: " + task.ProjectName,
title = task.Name,
},
}
});
Finally send the result as "InvokeResponse"
return new InvokeResponse
{
Body = invokeResponse,
Status = 200,
};
While "content" of the attachment is the full adaptive card.
You can find an example for the response in json here:
https://learn.microsoft.com/de-de/microsoftteams/platform/concepts/messaging-extensions/search-extensions#response-example
You can freely mix card types based on that, but i never got that working tho...as of now you need to limit to one specific card type as far as i know.
All above is if you're using
Microsoft.Bot.Builder.Teams
Microsoft.Bot.Connector.Teams
Microsoft.Bot.Schema.Teams
in the latest versions.
I need to export all records in Applications Tab Menu of Bill and Adjustments screen as I did in UI like this screenshot below.
I already create codes to provide it using this code below.
try
{
context.CookieContainer = new System.Net.CookieContainer();
context.Timeout = 10000000;
context.Url = url;
LoginResult login = context.Login(username, password);
AP301000Content konten = context.AP301000GetSchema();
//context.AP301000Clear();
konten.DocumentSummary.Type.Commit = false;
konten.DocumentSummary.Type.LinkedCommand = null;
var command = new Command[]
{
new Value { Value = "Bill", LinkedCommand = Konten.DocumentSummary.Type },
new Value { Value = "00123", LinkedCommand = konten.DocumentSummary.ReferenceNbr },
konten.DocumentSummary.Vendor,
konten.Applications.ReferenceNbrDisplayRefNbr,
konten.Applications.DocTypeDisplayDocType
};
var result = context.AP301000Export(command, null, 0, false, true);
}
catch (Exception x)
{
MessageBox.Show(x.Message);
}
finally
{
sCon.getLogout(context);
}
After i debug this code I got records only for VendorCD but Reference Nbr and Doc Type didn't exported. Please refer to this screenshot below.
please how to solve this issue.
Thanks
You should use "every" fields:
var command = new Command[]
{
konten.DocumentSummary.ServiceCommands.EveryDocType,
konten.DocumentSummary.ServiceCommands.EveryRefNbr,
konten.DocumentSummary.Vendor,
konten.Applications.ReferenceNbrDisplayRefNbr,
konten.Applications.DocTypeDisplayDocType
};
I am using following code to create recurring payment profile
CreateRecurringPaymentsProfileReq RPPR = new CreateRecurringPaymentsProfileReq()
{
CreateRecurringPaymentsProfileRequest = new CreateRecurringPaymentsProfileRequestType()
{
Version = UtilPayPalAPI.Version,
CreateRecurringPaymentsProfileRequestDetails = new CreateRecurringPaymentsProfileRequestDetailsType()
{
Token = resp.GetExpressCheckoutDetailsResponseDetails.Token,
RecurringPaymentsProfileDetails = new RecurringPaymentsProfileDetailsType()
{
BillingStartDate =Convert.ToDateTime("1/15/2012 11:10:28 AM"),
SubscriberName = "Shubhangi"
},
ScheduleDetails = new ScheduleDetailsType()
{
PaymentPeriod = new BillingPeriodDetailsType()
{
Amount = new BasicAmountType()
{
currencyID = CurrencyCodeType.USD,
Value = "10.00"
},
BillingFrequency=2,
BillingPeriod=BillingPeriodType.Day
},
ActivationDetails = new ActivationDetailsType()
{
InitialAmount = new BasicAmountType()
{
currencyID=CurrencyCodeType.USD,
Value="10.00"
}
},
}
}
}
};
CreateRecurringPaymentsProfileResponseType dorecurringPaymentResponse = UtilPayPalAPI.BuildPayPalWebservice().CreateRecurringPaymentsProfile(RPPR);
UtilPayPalAPI.HandleError(dorecurringPaymentResponse);
After calling doexpress checkout api, I have made a call to createrecurring profile api. In this doexpress checkout response returns "Success", but after that when I'm calling create recurringprofile it's response is "failure". And error is "Token is invalid"
Could any one suggest any correction in my code?