Atropay via Widget

Prerrequisitos

Before implementing Astropay, ensure you have:

  1. Enabled Astropay in the DEUNA Admin Panel
  2. A generated order token.
  3. Integrated the DEUNA SDK in your project.
  4. Reviewed the Payment Widget documentation for your platform.

Payment Method configuration

Display the Payment Widget by passing the Astropay configuration in the paymentMethods parameter.

[
    {
    "paymentMethod": "wallet",
    "processors": ["astropay"]
    }
]

Payment Widget - Web

DeunaSDK.initPaymentWidget({
  orderToken: 'YOUR_ORDER_TOKEN',
  paymentMethods: [
    {
      paymentMethod: 'wallet',
      processors: ['astropay'],
    },
  ],
  callbacks: { ... },
});

Payment Widget - Android

// MODAL
deunaSDK.initPaymentWidget(
    context = context,
    orderToken = orderToken,
    callbacks = PaymentWidgetCallbacks().apply { ... },
    paymentMethods = listOf(
        mapOf(
            "paymentMethod" to "wallet",
            "processors" to listOf("astropay")
        )
    )
)

/// EMBEDDED
PaymentWidgetConfiguration(
    orderToken = orderToken,
    paymentMethods = listOf(
        mapOf(
            "paymentMethod" to "wallet",
            "processors" to listOf("astropay")
        )
    ),
    callbacks = PaymentWidgetCallbacks().apply { ... },
    sdkInstance = deunaSDK
)

Payment Widget - iOS

/// MODAL
deunaSDK.initPaymentWidget(
 orderToken: "<DEUNA order token>",
 userToken: ..., // optional
 styleFile: ..., // optional
 callbacks: ...,
 paymentMethods: [
   [ 
     "paymentMethod": "wallet",
     "processors": ["astropay"],
   ]
 ]
)

// EMBEDDED
DeunaWidget(
  deunaSDK: deunaSDK,
  configuration: PaymentWidgetConfiguration(
    orderToken: "YOUR_ORDER_TOKEN",
    callbacks: PaymentWidgetCallbacks(
      onSuccess: { order in },
      onError: { error in },
      onEventDispatch: { event, data in }
    ),
     paymentMethods: [
       [ 
         "paymentMethod": "wallet",
         "processors": ["astropay"]
       ]
     ]
  )
)

Payment Widget - React Native

/// MODAL
DeunaSDK.initPaymentWidget({
  orderToken: 'YOUR_ORDER_TOKEN',
  paymentMethods: [
    {
      paymentMethod: 'wallet',
      processors: ['astropay'],
    },
  ],
  callbacks: { ... },
});

Did this page help you?