org.gsm.oneapi.payment
Class Reservation

java.lang.Object
  extended by org.gsm.oneapi.payment.Reservation

public class Reservation
extends java.lang.Object


Field Summary
static boolean dumpRequestAndResponse
           
 
Constructor Summary
Reservation(ServiceEndpoints endPoints, java.lang.String authorisationHeader)
          Creates a new instance of the Payment Reservation API main interface.
 
Method Summary
 PaymentResponse chargeAmount(java.lang.String endUserId, java.lang.String referenceCode, java.lang.String description, java.lang.String currency, double amount, int referenceSequence, java.lang.String code, java.lang.String callbackURL, java.lang.String clientCorrelator, java.lang.String onBehalfOf, java.lang.String purchaseCategoryCode, java.lang.String channel, double taxAmount, java.lang.String serviceId, java.lang.String productId)
          Charge an amount to the end user's bill / mobile phone account from reserved amounts
static void main(java.lang.String[] args)
           
 PaymentResponse releaseReservation(java.lang.String endUserId, java.lang.String referenceCode, int referenceSequence)
          Release a reserved amount Charge an amount to the end user's bill / mobile phone account from reserved amounts
 PaymentResponse reserveAdditionalAmount(java.lang.String endUserId, java.lang.String referenceCode, java.lang.String description, java.lang.String currency, double amount, int referenceSequence, java.lang.String code)
          Reserve an additional payment amount on the end user's bill / mobile phone account.
 PaymentResponse reserveAdditionalAmount(java.lang.String endUserId, java.lang.String referenceCode, java.lang.String description, java.lang.String currency, double amount, int referenceSequence, java.lang.String code, java.lang.String onBehalfOf, java.lang.String purchaseCategoryCode, java.lang.String channel, double taxAmount, java.lang.String serviceId, java.lang.String productId)
          Reserve an additional payment amount on the end user's bill / mobile phone account.
 PaymentResponse reserveInitialAmount(java.lang.String endUserId, java.lang.String referenceCode, java.lang.String description, java.lang.String currency, double amount, java.lang.String code, java.lang.String clientCorrelator, java.lang.String onBehalfOf, java.lang.String purchaseCategoryCode, java.lang.String channel, double taxAmount, java.lang.String serviceId, java.lang.String productId)
          Reserve an initial payment amount on the end user's bill / mobile phone account.
 void setAuthorisationHeader(java.lang.String authorisationHeader)
          Can be used to update the service authorisation header
 void setEndpoints(ServiceEndpoints endPoints)
          Can be used to update the service endpoints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dumpRequestAndResponse

public static boolean dumpRequestAndResponse
Constructor Detail

Reservation

public Reservation(ServiceEndpoints endPoints,
                   java.lang.String authorisationHeader)
Creates a new instance of the Payment Reservation API main interface. Requires endPoints to define the URL targets of the reservation network call and authorisationHeader containing the username/password used for HTTP Basic authorisation with the OneAPI server.

Parameters:
endPoints - contains a set of service/ call specific endpoints
authorisationHeader - Base 64 encoded username/ password
See Also:
ServiceEndpoints, JSONRequest.getAuthorisationHeader(String, String)
Method Detail

setEndpoints

public void setEndpoints(ServiceEndpoints endPoints)
Can be used to update the service endpoints

Parameters:
endPoints - contains a set of service/ call specific endpoints
See Also:
ServiceEndpoints

setAuthorisationHeader

public void setAuthorisationHeader(java.lang.String authorisationHeader)
Can be used to update the service authorisation header

Parameters:
authorisationHeader - Base 64 encoded username/ password
See Also:
JSONRequest.getAuthorisationHeader(String, String)

reserveInitialAmount

public PaymentResponse reserveInitialAmount(java.lang.String endUserId,
                                            java.lang.String referenceCode,
                                            java.lang.String description,
                                            java.lang.String currency,
                                            double amount,
                                            java.lang.String code,
                                            java.lang.String clientCorrelator,
                                            java.lang.String onBehalfOf,
                                            java.lang.String purchaseCategoryCode,
                                            java.lang.String channel,
                                            double taxAmount,
                                            java.lang.String serviceId,
                                            java.lang.String productId)
Reserve an initial payment amount on the end user's bill / mobile phone account.

Parameters:
endUserId - (mandatory) is the end user ID; in this case their MSISDN including the 'tel:' protocol identifier and the country code preceded by '+'. i.e., tel:+16309700001. OneAPI also supports the Anonymous Customer Reference (ACR) if provided by the operator. Do not URL encode this value prior to passing
referenceCode - (mandatory, unique per charge event) is your reference for reconciliation purposes. The operator should include it in reports so that you can match their view of what has been sold with yours by matching the referenceCodes.
description - (mandatory) is the human-readable text to appear on the bill, so the user can easily see what they bought.
currency - (mandatory) is the 3-figure code as per ISO 4217. Note either amount and currency or code must be provided.
amount - (mandatory) can be a whole number or decimal. Here means the amount to refund, which can be a full or partial refund of the original charge. Note either amount and currency or code must be provided.
code - (mandatory) a code provided by the OneAPI implementation that is used to reference an operator price point. Note either amount and currency or code must be provided.
clientCorrelator - (optional) uniquely identifies the refund request. If there is a communication failure during the refund request, using the same clientCorrelator when retrying the request allows the operator to avoid applying the same refund twice.
onBehalfOf - (optional) allows aggregators/partners to specify the actual payee.
purchaseCategoryCode - (optional) specifies the type/category of purchase e.g. "Video", "Game"
channel - (optional) can be "Wap", "Web", "SMS", depending on the source of user interaction
taxAmount - (optional) tax already charged by the merchant.
serviceId - (optional) The ID of the partner/merchant service
productId - (optional) combines with the serviceID to uniquely identify the product being purchased.
See Also:
PaymentResponse

reserveAdditionalAmount

public PaymentResponse reserveAdditionalAmount(java.lang.String endUserId,
                                               java.lang.String referenceCode,
                                               java.lang.String description,
                                               java.lang.String currency,
                                               double amount,
                                               int referenceSequence,
                                               java.lang.String code,
                                               java.lang.String onBehalfOf,
                                               java.lang.String purchaseCategoryCode,
                                               java.lang.String channel,
                                               double taxAmount,
                                               java.lang.String serviceId,
                                               java.lang.String productId)
Reserve an additional payment amount on the end user's bill / mobile phone account.

Parameters:
endUserId - (mandatory) is the end user ID; in this case their MSISDN including the 'tel:' protocol identifier and the country code preceded by '+'. i.e., tel:+16309700001. OneAPI also supports the Anonymous Customer Reference (ACR) if provided by the operator. Do not URL encode this value prior to passing
referenceCode - (mandatory, unique per charge event) is your reference for reconciliation purposes. The operator should include it in reports so that you can match their view of what has been sold with yours by matching the referenceCodes.
description - (mandatory) is the human-readable text to appear on the bill, so the user can easily see what they bought.
currency - (mandatory) is the 3-figure code as per ISO 4217. Note either amount and currency or code must be provided.
amount - (mandatory) can be a whole number or decimal. Here means the additional amount to reserve. Note either amount and currency or code must be provided.
referenceSequence - (mandatory) can be a whole number or decimal.
code - (mandatory) a code provided by the OneAPI implementation that is used to reference an operator price point. Note either amount and currency or code must be provided.
onBehalfOf - (optional) allows aggregators/partners to specify the actual payee.
purchaseCategoryCode - (optional) specifies the type/category of purchase e.g. "Video", "Game"
channel - (optional) can be "Wap", "Web", "SMS", depending on the source of user interaction
taxAmount - (optional) tax already charged by the merchant.
serviceId - (optional) The ID of the partner/merchant service
productId - (optional) combines with the serviceID to uniquely identify the product being purchased.
See Also:
PaymentResponse

reserveAdditionalAmount

public PaymentResponse reserveAdditionalAmount(java.lang.String endUserId,
                                               java.lang.String referenceCode,
                                               java.lang.String description,
                                               java.lang.String currency,
                                               double amount,
                                               int referenceSequence,
                                               java.lang.String code)
Reserve an additional payment amount on the end user's bill / mobile phone account. This is an alternative API where there is no change in other optional parameters

Parameters:
endUserId - (mandatory) is the end user ID; in this case their MSISDN including the 'tel:' protocol identifier and the country code preceded by '+'. i.e., tel:+16309700001. OneAPI also supports the Anonymous Customer Reference (ACR) if provided by the operator. Do not URL encode this value prior to passing
referenceCode - (mandatory, unique per charge event) is your reference for reconciliation purposes. The operator should include it in reports so that you can match their view of what has been sold with yours by matching the referenceCodes.
description - (mandatory) is the human-readable text to appear on the bill, so the user can easily see what they bought.
currency - (mandatory) is the 3-figure code as per ISO 4217. Note either amount and currency or code must be provided.
amount - (mandatory) can be a whole number or decimal. Here means the additional amount to reserve. Note either amount and currency or code must be provided.
referenceSequence - (mandatory) can be a whole number or decimal. Here means the amount to refund, which can be a full or partial refund of the original charge
code - (mandatory) a code provided by the OneAPI implementation that is used to reference an operator price point. Note either amount and currency or code must be provided.
See Also:
PaymentResponse

chargeAmount

public PaymentResponse chargeAmount(java.lang.String endUserId,
                                    java.lang.String referenceCode,
                                    java.lang.String description,
                                    java.lang.String currency,
                                    double amount,
                                    int referenceSequence,
                                    java.lang.String code,
                                    java.lang.String callbackURL,
                                    java.lang.String clientCorrelator,
                                    java.lang.String onBehalfOf,
                                    java.lang.String purchaseCategoryCode,
                                    java.lang.String channel,
                                    double taxAmount,
                                    java.lang.String serviceId,
                                    java.lang.String productId)
Charge an amount to the end user's bill / mobile phone account from reserved amounts

Parameters:
endUserId - (mandatory) is the end user ID; in this case their MSISDN including the 'tel:' protocol identifier and the country code preceded by '+'. i.e., tel:+16309700001. OneAPI also supports the Anonymous Customer Reference (ACR) if provided by the operator. Do not URL encode this value prior to passing
referenceCode - (mandatory, unique per charge event) is your reference for reconciliation purposes. The operator should include it in reports so that you can match their view of what has been sold with yours by matching the referenceCodes.
description - (mandatory) is the human-readable text to appear on the bill, so the user can easily see what they bought.
currency - (mandatory) is the 3-figure code as per ISO 4217. Note either amount and currency or code must be provided.
amount - (mandatory) can be a whole number or decimal. Here means the amount to charge against a prior reservation. Note either amount and currency or code must be provided.
referenceSequence - (mandatory) can be a whole number or decimal.
code - (mandatory) a code provided by the OneAPI implementation that is used to reference an operator price point. Note either amount and currency or code must be provided.
callbackURL - (optional) URL to post the result of the charge operation to
clientCorrelator - (optional) uniquely identifies the refund request. If there is a communication failure during the refund request, using the same clientCorrelator when retrying the request allows the operator to avoid applying the same refund twice.
onBehalfOf - (optional) allows aggregators/partners to specify the actual payee.
purchaseCategoryCode - (optional) specifies the type/category of purchase e.g. "Video", "Game"
channel - (optional) can be "Wap", "Web", "SMS", depending on the source of user interaction
taxAmount - (optional) tax already charged by the merchant.
serviceId - (optional) The ID of the partner/merchant service
productId - (optional) combines with the serviceID to uniquely identify the product being purchased.
See Also:
PaymentResponse

releaseReservation

public PaymentResponse releaseReservation(java.lang.String endUserId,
                                          java.lang.String referenceCode,
                                          int referenceSequence)
Release a reserved amount Charge an amount to the end user's bill / mobile phone account from reserved amounts

Parameters:
endUserId - (mandatory) is the end user ID; in this case their MSISDN including the 'tel:' protocol identifier and the country code preceded by '+'. i.e., tel:+16309700001. OneAPI also supports the Anonymous Customer Reference (ACR) if provided by the operator. Do not URL encode this value prior to passing
referenceCode - (mandatory, unique per charge event) is your reference for reconciliation purposes. The operator should include it in reports so that you can match their view of what has been sold with yours by matching the referenceCodes.
referenceSequence - (mandatory) can be a whole number or decimal.
See Also:
PaymentResponse

main

public static void main(java.lang.String[] args)