Search in sources :

Example 1 with PluginProperty

use of org.killbill.billing.client.model.PluginProperty in project killbill by killbill.

the class KillbillClient method getPaymentMethodCCProperties.

protected List<PluginProperty> getPaymentMethodCCProperties() {
    final List<PluginProperty> properties = new ArrayList<PluginProperty>();
    properties.add(new PluginProperty("type", "CreditCard", false));
    properties.add(new PluginProperty("cardType", "Visa", false));
    properties.add(new PluginProperty("cardHolderName", "Mr Sniff", false));
    properties.add(new PluginProperty("expirationDate", "2015-08", false));
    properties.add(new PluginProperty("maskNumber", "3451", false));
    properties.add(new PluginProperty("address1", "23, rue des cerisiers", false));
    properties.add(new PluginProperty("address2", "", false));
    properties.add(new PluginProperty("city", "Toulouse", false));
    properties.add(new PluginProperty("country", "France", false));
    properties.add(new PluginProperty("postalCode", "31320", false));
    properties.add(new PluginProperty("state", "Midi-Pyrenees", false));
    return properties;
}
Also used : PluginProperty(org.killbill.billing.client.model.PluginProperty) ArrayList(java.util.ArrayList)

Example 2 with PluginProperty

use of org.killbill.billing.client.model.PluginProperty in project killbill by killbill.

the class KillbillClient method getPaymentMethodPaypalProperties.

protected List<PluginProperty> getPaymentMethodPaypalProperties() {
    final List<PluginProperty> properties = new ArrayList<PluginProperty>();
    properties.add(new PluginProperty("type", "CreditCard", false));
    properties.add(new PluginProperty("email", "zouzou@laposte.fr", false));
    properties.add(new PluginProperty("baid", "23-8787d-R", false));
    return properties;
}
Also used : PluginProperty(org.killbill.billing.client.model.PluginProperty) ArrayList(java.util.ArrayList)

Example 3 with PluginProperty

use of org.killbill.billing.client.model.PluginProperty in project killbill by killbill.

the class TestPaymentPluginProperties method addProperty.

private void addProperty(final String key, final String value, List<PluginProperty> bodyProperties, final List<org.killbill.billing.payment.api.PluginProperty> expectProperties) {
    bodyProperties.add(new PluginProperty(key, value, false));
    expectProperties.add(new org.killbill.billing.payment.api.PluginProperty(key, value, false));
}
Also used : PluginProperty(org.killbill.billing.client.model.PluginProperty)

Example 4 with PluginProperty

use of org.killbill.billing.client.model.PluginProperty in project killbill by killbill.

the class TestPaymentMethod method testSearchPaymentMethods.

@Test(groups = "slow", description = "Can search payment methods")
public void testSearchPaymentMethods() throws Exception {
    // Search random key
    Assert.assertEquals(killBillClient.searchPaymentMethodsByKey(UUID.randomUUID().toString()).size(), 0);
    Assert.assertEquals(killBillClient.searchPaymentMethodsByKeyAndPlugin(UUID.randomUUID().toString(), PLUGIN_NAME).size(), 0);
    // Create a payment method
    final List<PluginProperty> pmProperties = new ArrayList<PluginProperty>();
    pmProperties.add(new PluginProperty("CC_NAME", "Bozo", false));
    pmProperties.add(new PluginProperty("CC_CITY", "SF", false));
    pmProperties.add(new PluginProperty("CC_LAST_4", "4365", false));
    pmProperties.add(new PluginProperty("CC_STATE", "CA", false));
    pmProperties.add(new PluginProperty("CC_COUNTRY", "Zimbawe", false));
    final Account accountJson = createAccountWithDefaultPaymentMethod(UUID.randomUUID().toString(), pmProperties);
    final PaymentMethod paymentMethodJson = killBillClient.getPaymentMethod(accountJson.getPaymentMethodId(), true);
    // Search random key again
    Assert.assertEquals(killBillClient.searchPaymentMethodsByKey(UUID.randomUUID().toString()).size(), 0);
    Assert.assertEquals(killBillClient.searchPaymentMethodsByKeyAndPlugin(UUID.randomUUID().toString(), PLUGIN_NAME).size(), 0);
    // Last 4
    doSearch("4365", paymentMethodJson);
    // Name
    doSearch("Bozo", paymentMethodJson);
    // City
    doSearch("SF", paymentMethodJson);
    // State
    doSearch("CA", paymentMethodJson);
    // Country
    doSearch("Zimbawe", paymentMethodJson);
}
Also used : PluginProperty(org.killbill.billing.client.model.PluginProperty) Account(org.killbill.billing.client.model.Account) ArrayList(java.util.ArrayList) PaymentMethod(org.killbill.billing.client.model.PaymentMethod) Test(org.testng.annotations.Test)

Aggregations

PluginProperty (org.killbill.billing.client.model.PluginProperty)4 ArrayList (java.util.ArrayList)3 Account (org.killbill.billing.client.model.Account)1 PaymentMethod (org.killbill.billing.client.model.PaymentMethod)1 Test (org.testng.annotations.Test)1