Storing Merchant Data on Your Backend

Right now, you have hardcoded the
merchantIdentifier
and
merchantSecretKey
. This means that all payments would be routed to the same merchant.
For a live solution, you might want to support multiple merchants, e.g. two different restaurants, to route the payment correctly. To support multiple merchants, store the following data on your backend:
  1. merchantIdentifier
    and
    merchantSecretKey
    . They identify to which merchant the payment is routed. You can create new merchants and get their credentials in the Gateway Manager.
  2. Whether the merchant is a
    TEST
    or
    LIVE
    merchant.
You can then fetch this data before a transaction and configure the SDK correctly:
MPTransactionProvider* transactionProvider = [MPMpos transactionProviderForMode::<TEST or LIVE, loaded from your backend:< merchantIdentifier::<MerchantIdentifier loaded from your backend:< merchantSecretKey::<MerchantSecretKey loaded from your backend:< ];
Right now, you have hardcoded the
merchantIdentifier
and
merchantSecretKey
. This means that all payments would be routed to the same merchant.
For a live solution, you might want to support multiple merchants, e.g. two different restaurants, to route the payment correctly. To support multiple merchants, store the following data on your backend:
  1. merchantIdentifier
    and
    merchantSecretKey
    . They identify to which merchant the payment is routed. You can create new merchants and get their credentials in the Gateway Manager.
  2. Whether the merchant is a
    TEST
    or
    LIVE
    merchant.
You can then fetch this data before a transaction and configure the SDK correctly:
final TransactionProvider transactionProvider = Mpos.createTransactionProvider(this, <TEST or LIVE, loaded from your backend>, <MerchantIdentifier loaded from your backend>, <MerchantSecretKey loaded from your backend>);