use of com.paypal.android.sdk.onetouch.core.Request in project braintree_android by braintree.
the class PayPalRequestUnitTest method getAuthorizationRequest_buildsWithLiveStageUrl.
@Test
public void getAuthorizationRequest_buildsWithLiveStageUrl() throws JSONException, InvalidArgumentException {
Configuration configuration = Configuration.fromJson(stringFromFixture("configuration/with_live_paypal.json"));
BraintreeFragment fragment = mMockFragmentBuilder.authorization(Authorization.fromString(TOKENIZATION_KEY)).configuration(configuration).build();
Request request = PayPal.getAuthorizationRequest(fragment);
assertEquals(EnvironmentManager.LIVE, request.getEnvironment());
}
use of com.paypal.android.sdk.onetouch.core.Request in project braintree_android by braintree.
the class PayPalRequestUnitTest method getBillingAgreementRequest_buildsWithCustomStageUrl.
@Test
public void getBillingAgreementRequest_buildsWithCustomStageUrl() throws JSONException {
Configuration configuration = Configuration.fromJson(stringFromFixture("configuration/with_custom_paypal.json"));
BraintreeFragment fragment = mMockFragmentBuilder.configuration(configuration).build();
Request request = PayPal.getBillingAgreementRequest(fragment, null);
assertEquals("custom", request.getEnvironment());
}
use of com.paypal.android.sdk.onetouch.core.Request in project braintree_android by braintree.
the class PayPalRequestUnitTest method getCheckoutRequest_buildsWithLiveStageUrl.
@Test
public void getCheckoutRequest_buildsWithLiveStageUrl() throws JSONException {
Configuration configuration = Configuration.fromJson(stringFromFixture("configuration/with_live_paypal.json"));
BraintreeFragment fragment = mMockFragmentBuilder.configuration(configuration).build();
Request request = PayPal.getCheckoutRequest(fragment, null);
assertEquals(EnvironmentManager.LIVE, request.getEnvironment());
}
use of com.paypal.android.sdk.onetouch.core.Request in project braintree_android by braintree.
the class PayPalRequestUnitTest method getCheckoutRequest_buildsWithOfflineStageUrl.
@Test
public void getCheckoutRequest_buildsWithOfflineStageUrl() throws JSONException {
Configuration configuration = Configuration.fromJson(stringFromFixture("configuration/with_offline_paypal.json"));
BraintreeFragment fragment = mMockFragmentBuilder.configuration(configuration).build();
Request request = PayPal.getCheckoutRequest(fragment, null);
assertEquals(EnvironmentManager.MOCK, request.getEnvironment());
}
use of com.paypal.android.sdk.onetouch.core.Request in project braintree_android by braintree.
the class PayPalRequestUnitTest method getBillingAgreementRequest_buildsWithOfflineStageUrl.
@Test
public void getBillingAgreementRequest_buildsWithOfflineStageUrl() throws JSONException {
Configuration configuration = Configuration.fromJson(stringFromFixture("configuration/with_offline_paypal.json"));
BraintreeFragment fragment = mMockFragmentBuilder.configuration(configuration).build();
Request request = PayPal.getBillingAgreementRequest(fragment, null);
assertEquals(EnvironmentManager.MOCK, request.getEnvironment());
}
Aggregations