Skip to main content

SDK and APMs load - Multiple containers

The SDK APM must be instantiated. This SDK can start the instantiation because it works independently of the one used for card payments.

<script
type="text/javascript"
charSet="utf-8"
src="<Macropay public apm sdk url>" />

Revup APM SDK:
https://hosted.macropay.com/apms-sdk/v0/apms-macropay.min.js

Test environment URL:
https://test.hosted.macropay.com/apms-sdk/v0/apms-macropay.min.js


Configuration Object

To create an instance, you must provide a configuration object through the class constructor as a parameter. The following table describes the configuration object:

const config = {
apiKey: <Same Key as form>,
merchantDomain: <Origin where is loading SDK>,
orderId: 'orderId',
env: 'live' / 'test'
};

APM Method Instantiation

The SDK has specific methods to instantiate each available APM in Revup. The merchant defines the containers he wants to integrate using the SDK and selects the desired payment methods on the checkout page.

apmsSdk.initializeApplePay(`container-id1`);
apmsSdk.initializePaypal(`container-id2`);
apmsSdk.initializeStripeLink(`container-id3`);

Example Container

In this example, the container shows the “Apple Pay” payment method.

<div
id="container-id1"
data-qa="apms-container">
</div>

You can put the div anywhere.


This image shows an example of a checkout page that could have processed APMs through Revup and other buttons for different payment methods processed by other entities.

Single container


info

Please note that control of the Apple Pay button is delegated to the Apple SDK.


Payments with Stripe Link and PayPal are handled indirectly by returning a WAITING_USER_INTERACTION status and unlocking with a notification to a final status. This status handling is similar to what is done with user-authenticated or 3D Secure card payments and the redirection will be to threeDSChallengeResult field URL.

An event is sent in the onMessage indicating this status and the transactionId.

{    
"transactionStatus": "waiting_user_interaction",
"message": "The payment is being processed",
"transactionld":""
}