use of com.ingenico.connect.gateway.sdk.java.domain.token.definitions.PersonalNameToken in project connect-sdk-java by Ingenico-ePayments.
the class UpdateTokenExample method example.
public void example() throws URISyntaxException, IOException {
Client client = getClient();
try {
Address billingAddress = new Address();
billingAddress.setAdditionalInfo("b");
billingAddress.setCity("Monument Valley");
billingAddress.setCountryCode("US");
billingAddress.setHouseNumber("13");
billingAddress.setState("Utah");
billingAddress.setStreet("Desertroad");
billingAddress.setZip("84536");
CompanyInformation companyInformation = new CompanyInformation();
companyInformation.setName("Acme Labs");
PersonalNameToken name = new PersonalNameToken();
name.setFirstName("Wile");
name.setSurname("Coyote");
name.setSurnamePrefix("E.");
PersonalInformationToken personalInformation = new PersonalInformationToken();
personalInformation.setName(name);
CustomerToken customer = new CustomerToken();
customer.setBillingAddress(billingAddress);
customer.setCompanyInformation(companyInformation);
customer.setMerchantCustomerId("1234");
customer.setPersonalInformation(personalInformation);
CardWithoutCvv cardWithoutCvv = new CardWithoutCvv();
cardWithoutCvv.setCardNumber("4567350000427977");
cardWithoutCvv.setCardholderName("Wile E. Coyote");
cardWithoutCvv.setExpiryDate("0820");
cardWithoutCvv.setIssueNumber("12");
TokenCardData data = new TokenCardData();
data.setCardWithoutCvv(cardWithoutCvv);
TokenCard card = new TokenCard();
card.setCustomer(customer);
card.setData(data);
UpdateTokenRequest body = new UpdateTokenRequest();
body.setCard(card);
body.setPaymentProductId(1);
client.merchant("merchantId").tokens().update("tokenId", body);
} finally {
client.close();
}
}
use of com.ingenico.connect.gateway.sdk.java.domain.token.definitions.PersonalNameToken in project connect-sdk-java by Ingenico-ePayments.
the class CreateTokenExample method example.
@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
Client client = getClient();
try {
Address billingAddress = new Address();
billingAddress.setAdditionalInfo("Suite II");
billingAddress.setCity("Monument Valley");
billingAddress.setCountryCode("US");
billingAddress.setHouseNumber("1");
billingAddress.setState("Utah");
billingAddress.setStreet("Desertroad");
billingAddress.setZip("84536");
CompanyInformation companyInformation = new CompanyInformation();
companyInformation.setName("Acme Labs");
PersonalNameToken name = new PersonalNameToken();
name.setFirstName("Wile");
name.setSurname("Coyote");
name.setSurnamePrefix("E.");
PersonalInformationToken personalInformation = new PersonalInformationToken();
personalInformation.setName(name);
CustomerToken customer = new CustomerToken();
customer.setBillingAddress(billingAddress);
customer.setCompanyInformation(companyInformation);
customer.setMerchantCustomerId("1234");
customer.setPersonalInformation(personalInformation);
BankAccountBban bankAccountBban = new BankAccountBban();
bankAccountBban.setAccountNumber("000000123456");
bankAccountBban.setBankCode("05428");
bankAccountBban.setBranchCode("11101");
bankAccountBban.setCheckDigit("X");
bankAccountBban.setCountryCode("IT");
TokenNonSepaDirectDebitPaymentProduct705SpecificData paymentProduct705SpecificData = new TokenNonSepaDirectDebitPaymentProduct705SpecificData();
paymentProduct705SpecificData.setAuthorisationId("123456");
paymentProduct705SpecificData.setBankAccountBban(bankAccountBban);
MandateNonSepaDirectDebit mandate = new MandateNonSepaDirectDebit();
mandate.setPaymentProduct705SpecificData(paymentProduct705SpecificData);
TokenNonSepaDirectDebit nonSepaDirectDebit = new TokenNonSepaDirectDebit();
nonSepaDirectDebit.setCustomer(customer);
nonSepaDirectDebit.setMandate(mandate);
CreateTokenRequest body = new CreateTokenRequest();
body.setNonSepaDirectDebit(nonSepaDirectDebit);
body.setPaymentProductId(705);
CreateTokenResponse response = client.merchant("merchantId").tokens().create(body);
} finally {
client.close();
}
}
Aggregations