The core infrastructure backend (API, database, Docker, etc).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

37 lines
1.3 KiB

namespace Bit.Billing.Test.Utilities;
public enum IPNBody
{
SuccessfulPayment,
ECheckPayment,
TransactionMissingEntityIds,
NonUSDPayment,
SuccessfulPaymentForOrganizationCredit,
UnsupportedTransactionType,
SuccessfulRefund,
RefundMissingParentTransaction,
SuccessfulPaymentForUserCredit
}
public static class PayPalTestIPN
{
public static async Task<string> GetAsync(IPNBody ipnBody)
{
var fileName = ipnBody switch
{
IPNBody.ECheckPayment => "echeck-payment.txt",
IPNBody.NonUSDPayment => "non-usd-payment.txt",
IPNBody.RefundMissingParentTransaction => "refund-missing-parent-transaction.txt",
IPNBody.SuccessfulPayment => "successful-payment.txt",
IPNBody.SuccessfulPaymentForOrganizationCredit => "successful-payment-org-credit.txt",
IPNBody.SuccessfulRefund => "successful-refund.txt",
IPNBody.SuccessfulPaymentForUserCredit => "successful-payment-user-credit.txt",
IPNBody.TransactionMissingEntityIds => "transaction-missing-entity-ids.txt",
IPNBody.UnsupportedTransactionType => "unsupported-transaction-type.txt"
};
var content = await EmbeddedResourceReader.ReadAsync("IPN", fileName);
return content.Replace("\n", string.Empty);
}
}