User Address For Payment

The User Address For Payment for merchant able to adding customer's billing address information while payment submission.

 

Here are steps to make add billing address:

 

Full Sample Code

 

📘

API Method

User Address For Payment

🚧

References

SDK Payment Classes
SDK Payment Enums

 
Step 1: Construct customer billing address information.

UserBillingAddress userBillingAddress = new UserBillingAddress();
userBillingAddress.setAddress1("300 Raffle Place");
userBillingAddress.setAddress2("#20-01");
userBillingAddress.setAddress3("Raffle place building 101");
userBillingAddress.setCity("Singapore");
userBillingAddress.setCountryCode("SG");
userBillingAddress.setPostalCode("32799");
userBillingAddress.setState("Singapore");
 
UserAddress userAddress = new UserAddressBuilder()
                          .setUserBillingAddress(userBillingAddress)
                          .build();
UserBillingAddress *userBillingAddress = [UserBillingAddress alloc];
userBillingAddress.address1 = @"300 Raffle Place";
userBillingAddress.address2 = @"#20-01";
userBillingAddress.address3 = @"Raffle place building 101";
userBillingAddress.city = @"Singapore";
userBillingAddress.countryCode = @"SG";
userBillingAddress.postalCode = @"32799";
userBillingAddress.state = @"Singapore";
 
UserAddress *userAddress = [[[UserAddressBuilder alloc]
                              userBillingAddress: userBillingAddress]
                              build];
let userBillingAddress: UserBillingAddress = UserBillingAddress()
userBillingAddress.address1 = "300 Raffle Place"
userBillingAddress.address2 = "#20-01"
userBillingAddress.address3 = "Raffle place building 101"
userBillingAddress.city = "Singapore"
userBillingAddress.countryCode = "SG"
userBillingAddress.postalCode = "32799"
userBillingAddress.state = "Singapore"
         
let userAddress: UserAddress = UserAddressBuilder()
                               .userBillingAddress(userBillingAddress)
                               .build()

 
Step 2: Construct payment request and add user address into request.

PaymentCode paymentCode = new PaymentCode("CC");
 
PaymentRequest paymentRequest = new CardPaymentBuilder(paymentCode, "4111111111111111")
                                .setExpiryMonth(12)
                                .setExpiryYear(2022)
                                .setSecurityCode("123")
                                .setUserAddress(userAddress)
                                .build();
PaymentCode *paymentCode = [[PaymentCode alloc] initWithChannelCode: @"CC"];
 
PaymentRequest *paymentRequest = [[[[[[[CardPaymentBuilder alloc] initWithPaymentCode: paymentCode cardNo: @"4111111111111111"]
                                        expiryMonth: 12]
                                        expiryYear: 2022]
                                        securityCode: @"123"]
                                        userAddress: userAddress]
                                        build];
let paymentCode: PaymentCode = PaymentCode(channelCode: "CC")
 
let paymentRequest: PaymentRequest = CardPaymentBuilder(paymentCode: paymentCode, "4111111111111111")
                                     .expiryMonth(12)
                                     .expiryYear(2022)
                                     .securityCode("123")
                                     .userAddress(userAddress)
                                     .build()

 
Step 3: Construct transaction request.

TransactionResultRequest transactionResultRequest = new TransactionResultRequestBuilder(paymentToken)
                                                    .with(paymentRequest)
                                                    .build();
TransactionResultRequest *transactionResultRequest = [[[[TransactionResultRequestBuilder alloc] initWithPaymentToken: paymentToken]
                                                         withPaymentRequest: paymentRequest]
                                                         build];
let transactionResultRequest: TransactionResultRequest = TransactionResultRequestBuilder(paymentToken: paymentToken)
                                                         .with(paymentRequest)
                                                         .build()

 

Full Sample Code

Full Sample Code Show below.

//Step 1: Construct customer billing address information.
UserBillingAddress userBillingAddress = new UserBillingAddress();
userBillingAddress.setAddress1("300 Raffle Place");
userBillingAddress.setAddress2("#20-01");
userBillingAddress.setAddress3("Raffle place building 101");
userBillingAddress.setCity("Singapore");
userBillingAddress.setCountryCode("SG");
userBillingAddress.setPostalCode("32799");
userBillingAddress.setState("Singapore");
 
UserAddress userAddress = new UserAddressBuilder()
                          .setUserBillingAddress(userBillingAddress)
                          .build();
 
//Step 2: Construct payment request and add user address into request.
PaymentCode paymentCode = new PaymentCode("CC");
 
PaymentRequest paymentRequest = new CardPaymentBuilder(paymentCode, "4111111111111111")
                                .setExpiryMonth(12)
                                .setExpiryYear(2022)
                                .setSecurityCode("123")
                                .setUserAddress(userAddress)
                                .build();
 
//Step 3: Construct transaction request.
TransactionResultRequest transactionResultRequest = new TransactionResultRequestBuilder(paymentToken)
                                                    .with(paymentRequest)
                                                    .build();
//Step 1: Construct customer billing address information.
UserBillingAddress *userBillingAddress = [UserBillingAddress alloc];
userBillingAddress.address1 = @"300 Raffle Place";
userBillingAddress.address2 = @"#20-01";
userBillingAddress.address3 = @"Raffle place building 101";
userBillingAddress.city = @"Singapore";
userBillingAddress.countryCode = @"SG";
userBillingAddress.postalCode = @"32799";
userBillingAddress.state = @"Singapore";
 
UserAddress *userAddress = [[[UserAddressBuilder alloc]
                              userBillingAddress: userBillingAddress]
                              build];
 
//Step 2: Construct payment request and add user address into request.
PaymentCode *paymentCode = [[PaymentCode alloc] initWithChannelCode: @"CC"];
 
PaymentRequest *paymentRequest = [[[[[[[CardPaymentBuilder alloc] initWithPaymentCode: paymentCode cardNo: @"4111111111111111"]
                                        expiryMonth: 12]
                                        expiryYear: 2022]
                                        securityCode: @"123"]
                                        userAddress: userAddress]
                                        build];
 
//Step 3: Construct transaction request.
TransactionResultRequest *transactionResultRequest = [[[[TransactionResultRequestBuilder alloc] initWithPaymentToken: paymentToken]
                                                         withPaymentRequest: paymentRequest]
                                                         build];
//Step 1: Construct customer billing address information.
let userBillingAddress: UserBillingAddress = UserBillingAddress()
userBillingAddress.address1 = "300 Raffle Place"
userBillingAddress.address2 = "#20-01"
userBillingAddress.address3 = "Raffle place building 101"
userBillingAddress.city = "Singapore"
userBillingAddress.countryCode = "SG"
userBillingAddress.postalCode = "32799"
userBillingAddress.state = "Singapore"
         
let userAddress: UserAddress = UserAddressBuilder()
                               .userBillingAddress(userBillingAddress)
                               .build()
    
//Step 2: Construct payment request and add user address into request.
let paymentCode: PaymentCode = PaymentCode(channelCode: "CC")
 
let paymentRequest: PaymentRequest = CardPaymentBuilder(paymentCode: paymentCode, "4111111111111111")
                                     .expiryMonth(12)
                                     .expiryYear(2022)
                                     .securityCode("123")
                                     .userAddress(userAddress)
                                     .build()
         
//Step 3: Construct transaction request.
let transactionResultRequest: TransactionResultRequest = TransactionResultRequestBuilder(paymentToken: paymentToken)
                                                         .with(paymentRequest)
                                                         .build()