Interface ClickToPayService
public interface ClickToPayService
Main interface for Click to Pay operations.
- Since:
- 4.3.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidenrol(String cardID, ConsumerInfo consumerInfo, String name, BillingAddress billingAddress, D1Task.Callback<Status> callback) Enrolls the card to the Click to Pay service.voidgetProfiles(D1Task.Callback<ProfileResult> callback) Retrieves the list of profiles which contains the consumer details.voidoptOutCard(String cardID, D1Task.Callback<Status> callback) Opts the card out of the Click to Pay service.voidoptOutConsumer(D1Task.Callback<Status> callback) Opts the consumer out of the Click to Pay service.voidupdateCard(String cardID, String name, BillingAddress billingAddress, D1Task.Callback<Status> callback) Updates the card information in the Click to Pay service.voidupdateConsumer(ConsumerInfo consumerInfo, BillingAddress billingAddress, D1Task.Callback<Status> callback) Updates the consumer information in the Click to Pay service.
-
Method Details
-
enrol
void enrol(@NonNull String cardID, @NonNull ConsumerInfo consumerInfo, @Nullable String name, @Nullable BillingAddress billingAddress, @NonNull D1Task.Callback<Status> callback) Enrolls the card to the Click to Pay service. The enrollment status in the issuer application will be updated via a push notification. Before calling this Click to Pay API, the integrator should display the default value of `consumerInfo` and `billingAddress` to collect the inputs of `consumerInfo` given by the end user.- Parameters:
cardID- The card identifier.consumerInfo-ConsumerInfoThe `consumerInfo` object is initialised using the first name,middle name, last name, language, phone number, country code and email entered by the end user.name- The cardholder name as shown on the card. This is applicable only to Visa.billingAddress- The billing address that is associated to the card enroled to Click to Pay. This is mandatory for Visa.callback- The callback for the result. When it is successful, the returned argument of theD1Task.Callback.onSuccess(Object)isStatus.
Possible errors:
D1Exception.ErrorCode.ERROR_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZEDD1Exception.ErrorCode.ERROR_CARD_NOT_FOUNDD1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_CLICKTOPAYD1Exception.ErrorCode.ERROR_INVALID_ARGUMENTD1Exception.ErrorCode.ERROR_NOT_ACTIVED1Exception.ErrorCode.ERROR_CARD_OPERATION_NOT_ALLOWEDD1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_FIRST_NAMED1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_LAST_NAMED1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_LANGUAGED1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_PHONE_NUMBER_COUNTRY_CODED1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_PHONE_NUMBERD1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_BILLING_ADDRESS_COUNTRY_CODED1Exception.ErrorCode.ERROR_CLICKTOPAY_SCHEME_AMBIGUOUS_PROFILED1Exception.ErrorCode.ERROR_CLICKTOPAY_SCHEME_RESOURCE_EXISTSD1Exception.ErrorCode.ERROR_CLICKTOPAY_SCHEME_CARD_INELIGIBLE
- Since:
- 4.3.0
-
optOutCard
Opts the card out of the Click to Pay service. The enrollment status in the issuer application will be updated via a push notification.- Parameters:
cardID- The card identifier.callback- The callback for the result. When it is successful, the returned argument of theD1Task.Callback.onSuccess(Object)isStatus.
Possible errors:
- Since:
- 4.3.0
-
getProfiles
Retrieves the list of profiles which contains the consumer details. Each profile includes the list of associated cards enrolled in the Click to Pay service for a specific consumer.For end users who have not enrolled their cards in the Click to Pay service, an empty list will be returned by the API.
- Parameters:
callback- The callback for the result. When it is successful or partial error, the returned argument of theD1Task.Callback.onSuccess(Object)isProfileResult.- Success:
ProfileResultis returned with an array ofProfileobjects and an emptyProfileResult.errorMessage. - Partial error: When two or more cards are enrolled in both
Scheme.VISAandScheme.MASTERCARDschemes (where one fails, the other succeeds),ProfileResultis returned with theProfileobjects from successful enrollment scheme, together withProfileResult.errorMessagefrom failed enrollment scheme.
Possible errors:
- Success:
- Since:
- 4.3.0
-
updateCard
void updateCard(@NonNull String cardID, @Nullable String name, @NonNull BillingAddress billingAddress, @NonNull D1Task.Callback<Status> callback) Updates the card information in the Click to Pay service. The integrator will be notified of the final update status via a push notification.- Parameters:
cardID- The card identifier.name- The cardholder name as shown on the card. This is applicable only to Visa.billingAddress- The billing address that is associated to the card enrolled to Click to Pay.callback- The callback for the result. When it is successful, the returned argument of theD1Task.Callback.onSuccess(Object)isStatus.
Possible errors:
D1Exception.ErrorCode.ERROR_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZEDD1Exception.ErrorCode.ERROR_CARD_NOT_FOUNDD1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_CLICKTOPAYD1Exception.ErrorCode.ERROR_INVALID_ARGUMENTD1Exception.ErrorCode.ERROR_CARD_OPERATION_NOT_ALLOWEDD1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_BILLING_ADDRESS_COUNTRY_CODE
- Since:
- 4.3.0
-
updateConsumer
void updateConsumer(@NonNull ConsumerInfo consumerInfo, @Nullable BillingAddress billingAddress, @NonNull D1Task.Callback<Status> callback) Updates the consumer information in the Click to Pay service. The integrator will be notified of the final update status via a push notification.- Parameters:
consumerInfo-ConsumerInfoThe `consumerInfo` object is initialized using the first name,middle name, last name, language, phone number, country code and email entered by the end user.billingAddress- The billing address that is associated to the cards enroled in the Click to Pay service. This is mandatory for Visa.callback- The callback for the result. When it is successful, the returned argument of theD1Task.Callback.onSuccess(Object)isStatus.
Possible errors:
D1Exception.ErrorCode.ERROR_NOT_LOGGED_IND1Exception.ErrorCode.ERROR_NOT_AUTHORIZEDD1Exception.ErrorCode.ERROR_CARD_NOT_FOUNDD1Exception.ErrorCode.ERROR_DEVICE_ENVIRONMENT_UNSAFED1Exception.ErrorCode.ERROR_CLICKTOPAYD1Exception.ErrorCode.ERROR_INVALID_ARGUMENTD1Exception.ErrorCode.ERROR_CARD_OPERATION_NOT_ALLOWEDD1Exception.ErrorCode.ERROR_CARD_NOT_MANAGED_BY_D1D1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_FIRST_NAMED1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_LAST_NAMED1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_LANGUAGED1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_PHONE_NUMBER_COUNTRY_CODED1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_PHONE_NUMBERD1Exception.ErrorCode.ERROR_CLICKTOPAY_INVALID_BILLING_ADDRESS_COUNTRY_CODE
- Since:
- 4.3.0
-
optOutConsumer
Opts the consumer out of the Click to Pay service. The enrollment status in the issuer application will be updated via a push notification.- Parameters:
callback- The callback for the result. When it is successful, the returned argument of theD1Task.Callback.onSuccess(Object)isStatus.
Possible errors:
- Since:
- 4.3.0
-