Professional Documents
Culture Documents
Developer's Manual
Revisions
Version
Date
Author
Comment
Library
version
1.0
19.06.2012
Initial revision
1.0
1.1
21.06.2012
Minor Changes
1.0
1.2
27.06.2012
Minor Changes
1.0
1.3
20.07.2012
Minor Changes
1.0
1.4
15.01.2012
Andreas
Stehl
Andreas
Stehl
Andreas
Stehl
Daniel
Spitzer
Andreas
Stehl
1.0.21
1.5
17.04.2013
Dieter
Wurm
Bugfixes:
Payment details view:
Fix line wrapping label text of save paydata
checkbox.
Fix problem with editability of input elements in
HTML forms of web based 3D secure workflow under Android 4.x.
Changes:
1.0.19-
rename activity
com.op.android.activities.OP3DSecureA
ctivity to
com.op.android.activities.OPWebflowActi
vity (see Chapter 2)
1.0.21
18.05.2013
Dieter
Wurm
1.0.21
1.0.73
03.07.2013
Stefanie
Groll
1.0.73
1.0.76
26.09.2013
A. Wirth
1.0.76
1.0.81
10.10.2013
A. Wirth
Fix alias payment for brand "BCMC" -> is renamed to "Bancontact/Mister Cash"
Fix alias payment for brand "Maestro" -> CVC is
now optional
Bugfix library:
Fix 3DSecure payment issues for consecutive
payments with the same OrderID, but different
PayIDs (generated by the backend), e.g. when
first payment attempt fails due to wrong PIN the
next payment attempt will no longer fail if authori-
1.0.81
Page 2 of 25
1.0.82
19.11.2013
A. Wirth
1.0.85
21.11.2013
A. Wirth
1.0.87
26.11.2013
A. Wirth
1.0.120
23.01.2015
A. Wirth
1.0.120
02.02.2015
O. Gillin
Change:
Max allowed cardnumber length for BCMC and
Maestro brand is now 20.
Bugfix library:
Fixed an internal crash of payment request tasks
within the library on Android 4.3 and up. This fix
works w/o any code changes on the host applications side.
Bugfix library:
When an existing alias was being reused for a
new payment and the user has changed the card
number or the card brand for the new payment,
and the backend was not able to process the
payment successfully (e.g. wrong card details),
and the user re-triggered the payment by hitting
the Pay Button, the payment was processed
using the original card data from the alias. This
error has been fixed.
Bugfix library:
- Fixed debit card payments using existing aliases, payments are now processed without errors if
card details are correct.
- Fixed return value of "masked" card number in
alias for debit cards DE + AT (cardNumber +
"BLZ" + blz).
- Fixed alias payment for JCB cards when user
does not change displayed card number from
alias.
- Update library to Android SDK 5.0 (API level
21)
- Improved logging
- Fix for alias in URL-encoded format
- Fix parameters for PostFinance in DirectLink
call
- Additional parameter in DirectLink call to identify client (ORIG)
- Add support for '3DSecure' and 'WebAuth' authorization flows in 'Hidden Mode'
- Fix for BCMC brand in 'Hidden Mode', no CVC
needed
- Fix for payment type 'PaymentWithAlias' in
'Hidden Mode': if CVC is missing in pay data and
the card brand needs CVC, now the card detail
screen is presented for CVC entry
- Update known limitation for Direct Debit NL and
Direct Debit DE.
1.0.82
1.0.85
1.0.87
1.0.120
1.0.120
Page 3 of 25
Table of Contents
1
1.2
1.3
1.4
3.2
3.2.1
3.2.2
3.3
3.3.1
3.3.2
3.3.3
3.3.4
3.3.5
3.4
3.4.1
3.4.2
3.5
4
com.op.android.activities.OPActivity ................................................................................ 15
4.1.1
4.1.2
Constructors ................................................................................................................. 16
4.1.3
Methods ........................................................................................................................ 16
4.2
com.op.android.card.OPPayData ..................................................................................... 16
4.2.1
4.2.2
Constructors ................................................................................................................. 17
4.2.3
Methods ........................................................................................................................ 17
4.3
com.op.android.card.OPPayType .................................................................................... 18
Page 4 of 25
4.4
com.op.android.card.OPCardPrototype ........................................................................... 18
4.4.1
4.4.2
Constructors ................................................................................................................. 18
4.4.3
Methods ........................................................................................................................ 18
4.5
com.op.android.card.OPCredentials ................................................................................ 20
4.5.1
4.5.2
Constructors ................................................................................................................. 21
4.5.3
Methods ........................................................................................................................ 21
4.6
com.op.android.card.OPCardListItem .............................................................................. 21
4.6.1
4.6.2
Constructors ................................................................................................................. 21
4.6.3
Methods ........................................................................................................................ 22
4.7
com.op.android.net.OPServerResponse ......................................................................... 22
4.7.1
4.7.2
Constructors ................................................................................................................. 22
4.7.3
Methods ........................................................................................................................ 22
4.8
com.op.android.utils.OPVisualMaster .............................................................................. 23
4.8.1
4.8.2
Constructors ................................................................................................................. 24
4.8.3
Methods ........................................................................................................................ 24
4.9
com.op.android.utils.OPTextStyle .................................................................................... 25
4.9.1
4.9.2
Constructors ................................................................................................................. 25
4.9.3
Methods ........................................................................................................................ 25
Tracking..................................................................................................................................... 25
6.1
6.2
Page 5 of 25
1.1
OverviewPayment Methods
1.2
American Express
Visa
Diners Club
Master Card
Direct Debit NL (see 6 Known limitations, page 25)
Direct Debit DE (see 6 Known limitations, page 25)
Direct Debit AT
BCMC
Maestro
JCB
PostFinance
Supported Platforms
Devices running Android 2.1 (API 7) or higher are supported, including new 64-bit devices on
Android 5.0 Lollipop (API 21).
The library has been localized for English, French, German and Dutch.
1.3
The payment library can be used in a standard or hidden mode. Within the standard mode a layout
with credit card information is provided whereas in the hidden mode credit card information is not
gathered by the payment librarys payment workflow but by the host app. In this case, only web
flows are shown for e.g. 3D authentications. Other views are provided by the host app.
Page 6 of 25
1.4
Payment Process
Page 7 of 25
The delivered Zip file contains the core library jar (Ogonepayment.jar) file and an archive named
res which contains the resource artefacts the payment library depends on.
To embed payment library functionality into your hosting app please process the following steps:
Unpack res.zip and copy the expanded folders into your projects res directory.
Warning: The library resource names cant be changed. So if there is any naming conflict
relating resource filenames its necessary that host apps files will be changed.
Add the following activity entries inside your host apps AndroidManifest.xml:
Page 8 of 25
android:name="com.op.android.activities.OPWebflowActivity"
android:label="@string/dialog_3D_secure"
android:screenOrientation="portrait">
</activity>
The following steps describe a typical process of using the payment library inside a host application.
3.1
In order to work with the payment library you have to extend the abstract API activity class
com.op.android.OPActivity.
OPActivity is the central class for configuring and initiating payments library functionality.
3.2
OPActivity defines several abstract methods which are called by the library for customization of the
librarys visual style and notifying regarding the result of a payment operation. The host application
has to implement these methods in order to provide proper behavior.
3.2.1
3.3
Page 9 of 25
OPCredentials instance that holds the necessary user and account data to fulfill order requests or
alias generation against Ogone backend services.
allowedPayments
Via the allowedPayments parameter the host app provides all relevant paymethods, which should
be offered inside the payment selection view of the payment library. The order of presented
paymethods correspond to the order of OPCardItemList elements of the list. Paymethods are represented by the class OPCardItemList, which offers factory methods for instantiation of every supported paymethod.
public
public
public
public
public
public
public
public
public
public
public
static
static
static
static
static
static
static
static
static
static
static
OPCardListItem
OPCardListItem
OPCardListItem
OPCardListItem
OPCardListItem
OPCardListItem
OPCardListItem
OPCardListItem
OPCardListItem
OPCardListItem
OPCardListItem
createVisaCard();
createAmericanExpress();
createMasterCard();
createDinersClub();
createMaestro();
createJcb();
createPostFinance();
createBcmc();
createDirectdebitsDe();
createDirectdebitsAt();
createDirectdebitsNl();
If only one payment method is provided, in the later workflow / screenflow the payment method
selection view will be skipped and the payment detail view of the provided payment method will be
displayed instantly.
If no payment method is provided inside the returned array, the payment library will use as a
default all implemented payment methods in the implemented order.
environment
With the environment parameter host app configures if the payment library works against the
Ogone production or test backend services.
The following code snippet demonstrates the usage of the above mentioned parameters:
import
import
import
import
...
com.op.android.card.OPCardListItem;
com.op.android.card.OPCredentials;
com.op.android.card.OPPayData;
com.op.android.card.OPPayType;
Page 10 of 25
Brand
Cards brand
payMethod
Pay method
payId
acceptance
If the payment was not successful and the error was not caused by invalid user input or temporary
unavailability of the services (these problems are handled by the library itself) the method
void onResultError(OPPayType, OPErrorAction)
is called.
The status parameter contains detailed error informations.
Status
Transaction status.
ncErrorId
ncErrorPlusId
errorDetails
If the user canceled the payment process by tabbing the Back button on the payment selection
screen, the host app will be notified via the callback cancel method.
Page 11 of 25
void onResultCancel()
Even if alias generation fails, the payment process continues using the real card or bank account
number instead of an alias.
3.3.3 Reusing saved payment data
To reuse saved payment data for the next payment process, the host application needs to provide
the saved data within a com.op.android.card.OPCardPrototype instance.
OPCredentials credentials = new OPCredentials();
credentials.initOPParams("psp-id", "user-id", "pwd", "passphrase");
OPPayData payData = new OPPayData();
payData.setPayType(OPPayType.PaymentWithAlias);
payData.setAmount(100);
payData.setCurrency("USD");
payData.setOrderId("order id");
Alias = getPersistedAliasFromSomewhere();
OPCardPrototype card = new OPCardPrototype();
card.setAlias(alias.getAlias());
Page 12 of 25
card.setBrand(alias.getBrand());
card.setCardHolder(alias.getCardholder());
card.setCardNumber(alias.getMaskedCard());
card.setExpireDate(alias.getExpireDate());
payData.setCard(card);
sendNewRequest (payData,credentials, backend.TEST);
If the payment library is called with saved payment data, the payment method selection screen will
be skipped and the payment details view with prefilled payment data will be displayed directly. Depending on the type of the paymethod the user must enter the CVC before continuing with the
payment process.
All prefilled payment data can be overwritten by the user. In the case of changed payment data, the
alias relevant payment data will be updated accordingly at Ogone Alias Gateway.
3.3.4 Alias handling within paymethod PostFinance
When using the PostFinance paymethod, the alias handling and workflow is different.
After initiating the payment workflow from within the payment librarys payment details view, the
user has to fulfill a web based authorization process in the first step. If authorization succeeds, a
unique alias is generated and returned by PostFinance backend services. This alias will be used in
the subsequent payment process. Please note that this workflow is mandatory for PostFinance
payments and will be performed regardless of whether the save option was activated or not.
3.3.5 Error handling
In standard mode the payment library itself handles upcoming errors within normal payment workflow as far as possible.
In cases of technical errors (i.e. problems with network connectivity) while processing a payment
request the user is presented an error message and encouraged to retry the request later.
In cases of authentication or authorization failures the user is presented an appropriate information
view and rerouted to the paymethod selection screen to retry with another paymethod.
In cases of invalid data edited by the user, the user is requested to correct the input data and retry
the payment request.
3.4
In hidden mode, credit card information is not gathered by the payment librarys payment workflow
but is also provided by the app. The payment method selection screens are then skipped and authentication and/or authorization takes place immediately.
Performing payments in hidden mode is always a two step process. As with standard mode payments all relevant methods for payment submission in hidden mode are provided by the
OPActivity class.
3.4.1
Creating an alias
With the sendHiddenNewRequest method the host application can obtain a new alias from
Ogone Alias Gateway without performing a payment request directly.
Page 13 of 25
payData.setPayType(OPPayType.NewAlias);
...
OPCardPrototype card = new OPCardPrototype();
card.setCardHolder("Cardholder");
card.setBrand(OPBrand.VISA);
card.setCardNumber("4111111111111111");
card.setCVC("121");
card.setExpiryDate("1212");
payData.setCard(card);
sendHiddenNewRequest(payData,credentials, backend.TEST);
If paymethod is a credit card and the host app does not provide the cards CVC inside
OPPaymentCard, also in hidden mode the payment details view will be shown by the library to
obtain the CVC.
Page 14 of 25
3.5
Performing UI customizations
In order to provide customization of fonts, background images and colors the host app has to implement the method:
OPVisualMaster getVisualMaster()
4
4.1
Page 15 of 25
Constructors
4.1.3
Methods
Credentials
Cards
Env
Backend.TEST or Backend.PRODUCTION
4.1.3.3
Credentials
Env
Backend.TEST or Backend.PRODUCTION
4.2
com.op.android.card.OPPayData
Container to pass merchants payment information within the library. Used to transport saved payment informations from host app to library.
4.2.1
Public fields
Page 16 of 25
4.2.2
Constructors
4.2.2.1
OPPayData()
4.2.2.2
4.2.3
Methods
Payment Type
Page 17 of 25
4.3
com.op.android.card.OPPayType
Enumeration type for specifying the type of action to be performed against the payment library.
Following types are possible:
NewPayment
NewPaymentWithSaveAlias
PaymentWithAlias
NewAlias
4.4
com.op.android.card.OPCardPrototype
Public fields
4.4.2
Constructors
4.4.2.1
OPCardPrototype()
4.4.2.2
4.4.3 Methods
From the host apps perspective OPCardPrototype is only used to provide existing Payment
informations to the payment library. Hence only the setter methods are relevant and described.
Ogone In-App-Payment-library manual Android
Page 18 of 25
1.1.1.1
void setAddress(final String address)
Sets the bank account holders address street and house number.
Relevant only for pay methods Direct Debit DE, Direct Debit AT, Direct Debit NL.
Parameters
Address
Parameters
Brand
Page 19 of 25
Cardholder
city
4.5
zipcode
com.op.android.card.OPCredentials
Container to hold all relevant credential information for communication with Ogone backend services.
Page 20 of 25
4.5.1
-
Public fields
4.5.2
Constructors
4.5.2.1
Parameters
pspid
userid
password
passphrase
4.5.3
-
4.6
Methods
com.op.android.card.OPCardListItem
Helper class to generate individual pay methods, which must be provided inside method
OPActivity.sendNewRequest(...) to define the relevant pay methods in the librarys payment selection view.
4.6.1
-
Public fields
4.6.2
-
Constructors
Page 21 of 25
4.6.3
Methods
4.6.3.1
4.6.3.2
4.6.3.3
4.6.3.4
4.6.3.5
4.6.3.6
4.6.3.7
4.6.3.8
4.6.3.9
4.7
com.op.android.net.OPServerResponse
Container object provided by the payment library as the result of a successful payment operation
inside the callback method OPActivity.onResultSuccess(..).
The OPServerResponse object contains all relevant payment data so that the host app can save
payment data for recurring payments.
4.7.1
-
Public fields
4.7.2
-
Constructors
4.7.3 Methods
From the host apps perspective OPServerResponse is only used to provide detail information of a
successful payment to the host app.
Hence only the getter methods are relevant and described.
4.7.3.1 String getAcceptance()
Gets the acquirers acceptance identifier.
4.7.3.2 String getAddress()
Gets the bank account holders address street and house number.
Provided only for pay methods Direct Debit DE, Direct Debit AT, Direct Debit NL.
Page 22 of 25
4.8
com.op.android.utils.OPVisualMaster
4.8.1
-
Public fields
Page 23 of 25
4.8.2
4.8.2.1
4.8.3
Constructors
OPVisualMaster()
Methods
Left alignment
Gravity.RIGHT
Right alignment
Gravity.CENTER
Center alignment
Page 24 of 25
4.9
com.op.android.utils.OPTextStyle
Public fields
4.9.2
Constructors
4.9.2.1
4.9.3
OPTextStyle()
Methods
Tracking
In order to differentiate inApp transactions on DirectLink the library uses the ORIG Field listed in
the Direct Link and transfers the value IAOGA + the current version number of the library.
6
6.1
Known limitations
Direct Debit DE (Germany)
For acquirer EasyCash and Telego, the configuration oft he payemnt method needs to set the
switch SEPA-Mode to NO.
In Germany transactions cal still be accepted using the domestic account format. The mandate is
not mandatory.
6.2
Direct Debit NL
No longer supported
The processing of DD NL transaction processed via Equens requires multiple data points including
data provided by the buyer (IBAN bank account number, BIC) and by the merchants (Unique Mandate ID, SEC Type, signature date)
Known issues
Page 25 of 25