Search in sources :

Example 1 with BillingAgreementRequest

use of com.paypal.android.sdk.onetouch.core.BillingAgreementRequest in project braintree_android by braintree.

the class PayPalRequestUnitTest method getBillingAgreement_containsCorrectValues.

@Test
public void getBillingAgreement_containsCorrectValues() throws JSONException {
    Configuration configuration = Configuration.fromJson(stringFromFixture("configuration/with_offline_paypal.json"));
    BraintreeFragment fragment = mMockFragmentBuilder.configuration(configuration).build();
    BillingAgreementRequest request = PayPal.getBillingAgreementRequest(fragment, "https://paypal.com/?ba_token=pairingId");
    assertEquals(EnvironmentManager.MOCK, request.getEnvironment());
    assertEquals("com.braintreepayments.api.braintree://onetouch/v1/cancel", request.getCancelUrl());
    assertEquals("com.braintreepayments.api.braintree://onetouch/v1/success", request.getSuccessUrl());
    assertEquals("paypal_client_id", request.getClientId());
    assertEquals("pairingId", request.getPairingId());
}
Also used : Configuration(com.braintreepayments.api.models.Configuration) BillingAgreementRequest(com.paypal.android.sdk.onetouch.core.BillingAgreementRequest) Test(org.junit.Test)

Aggregations

Configuration (com.braintreepayments.api.models.Configuration)1 BillingAgreementRequest (com.paypal.android.sdk.onetouch.core.BillingAgreementRequest)1 Test (org.junit.Test)1