If you are using Android Components v5.0.0 or later:
This payment method requires no additional configuration.
Follow the Components integration guide and use the following module and Component names:
- To import the module: molpay
- To launch and show the Component: MolpayComponent
Our Online banking Malaysia Component renders Online banking Malaysia in your payment form and collects your shopper's selected bank.
When making an Online banking Malaysia payment, you additionally need to:
Requirements
Requirement | Description |
---|---|
Integration type | Make sure that you have built an Advanced flow Android Components integration. |
Setup steps | Before you begin, add in your Customer Area. |
Show Online banking Malaysia in your payment form
To show Online banking Malaysia Component in your payment form, you need to:
-
Specify in your /paymentMethods request:
- countryCode: MY
- amount.currency: MYR
-
Deserialize the response from the /paymentMethods call and get the object with
type
: molpay_ebanking_fpx_MY or molpay_ebanking_TH. -
Add the Online banking Malaysia Component:
a. Import the Online banking Malaysia Component to your
build.gradle
file.implementation "com.adyen.checkout:molpay:<latest-version>"
Check the latest version on GitHub.
b. Create an
molpayConfiguration
object:val molpayConfiguration = MolpayConfiguration.Builder(context, "YOUR_CLIENT_KEY") // When you are ready to accept live payments, change the value to one of our live environments. .setEnvironment(Environment.TEST) .build()
c. Initialize the Online banking Malaysia Component. Pass the payment method object and the
molpayConfiguration
object.val molpayComponent = MolpayComponent.PROVIDER.get(this@YourActivity, paymentMethod, molpayConfiguration)
d. Add the Online banking Malaysia Component view to your layout.
<com.adyen.checkout.molpay.MolpaySpinnerView android:layout_width="wrap_content" android:layout_height="wrap_content"/>
e. Attach the Component to the view to start getting your shopper's payment details.
molpaySpinnerView.attach(molpayComponent, this@YourActivity)
f. When shoppers enter their payment details, you start receiving updates. If
isValid
is true and the shopper proceeds to pay, pass thepaymentComponentState.data.paymentMethod
to your server and make a payment request.molpayComponent.observe(this) { paymentComponentState -> if (paymentComponentState?.isValid == true) { // When the shopper proceeds to pay, pass the `paymentComponentState.data` to your server to send a /payments request sendPayment(paymentComponentState.data) } }
Make a payment
When the shopper proceeds to pay, the Component returns the paymentComponentState.data.paymentMethod
.
- Pass the
paymentComponentState.data.paymentMethod
to your server. - From your server, make a /payments request, specifying:
paymentMethod.type
: ThepaymentComponentState.data.paymentMethod
from your client app. In this example, the issuer is set to Bank Rakyat.returnURL
: URL to where the shopper should be redirected back to after they complete the payment. This URL can have a maximum of 1024 characters. Get this URL from the Component in theRedirectComponent.getReturnUrl(context)
.