public void Search_OnMerchantAccountIdIs()
{
SubscriptionRequest request1 = new SubscriptionRequest
{
MerchantAccountId = MerchantAccountIDs.DEFAULT_MERCHANT_ACCOUNT_ID,
PaymentMethodToken = creditCard.Token,
PlanId = PlanFixture.PLAN_WITH_TRIAL.Id,
Price = 2M
};
SubscriptionRequest request2 = new SubscriptionRequest
{
MerchantAccountId = MerchantAccountIDs.NON_DEFAULT_MERCHANT_ACCOUNT_ID,
PaymentMethodToken = creditCard.Token,
PlanId = PlanFixture.PLAN_WITH_TRIAL.Id,
Price = 2M
};
Subscription defaultMerchantAccountSubscription = gateway.Subscription.Create(request1).Target;
Subscription nonDefaultMerchantAccountSubscription = gateway.Subscription.Create(request2).Target;
SubscriptionSearchRequest request = new SubscriptionSearchRequest().
MerchantAccountId.Is(MerchantAccountIDs.NON_DEFAULT_MERCHANT_ACCOUNT_ID).
Price.Is(2M);
ResourceCollection<Subscription> collection = gateway.Subscription.Search(request);
Assert.IsTrue(TestHelper.IncludesSubscription(collection, nonDefaultMerchantAccountSubscription));
Assert.IsFalse(TestHelper.IncludesSubscription(collection, defaultMerchantAccountSubscription));
}