Setting up payments via Sberbank's mobile app

This instruction is for stores implementing payments via Sberbank's mobile app (the scenario only works for mobile apps). In the course of payment, you need to create the deep link to forward the user to Sberbank's app. See description of the scenario

Step 1. Requesting order identifier

To get order identifier (RQUID), you need to evoke the createInvoice method.

Request example
POST /webservice/mws/api/createInvoice HTTP/1.1
Host: someshop.ru 
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: length
clientOrderId=20170714T084637%2B00%3A00&shopId=15203&shopArticleId=106723&sum=11.00&customerNumber=216&description=%D0%9D%D0%BE%D1%81%D0%BE%D1%87%D0%BA%D0%B8&offer_accepted=true&smsPhoneNumber=79151231560&showcase_url=https%3A%2F%2Fdonelly.ru&invoiceType=sberbank&payMethod=online
Response example
<createInvoiceResponse status="1" error="0" processedDT="2017-07-14T11:46:41.103+03:00" orderId="2000734125092" externalPaymentUrl="https://online.sberbank.ru/CSAFront/payOrderPaymentLogin.do?ReqId=625d499cfe51f4e286f4896a989e41e7" externalTransactionNumber="625d499cfe51f4e286f4896a989e41e7"/>

Step 2. Creating deep linking

For iOS

Deep link format
sberbankonlineinvoicing://invoice/<merchantName>?ERIBUUID=<order_uuid>&callbackURLScheme=<callbackURLScheme>
Deep link parameters
ParameterDescription

merchantName

Name of the merchant's app

order_uuid

Order identifier (RQUID) received when sending the createInvoice request.

callbackURLScheme

Callback link

Payment statuses on return in the app

Successful payment

<merchantName>://callback?success=1

Payment error

<merchantName>://callback?success=0

For Android

To create deep linking, you need to use 'Intent'.

orderUUID — order identifier (RQUID) received when sending the createInvoice request.

public class MainActivity extends AppCompatActivity {
                private static final String SBERBANK_ONLINE_PACKAGE_NAME = "ru.sberbankmobile";
                private static final String SBERBANK_ONLINE_INVOICING_ACTIVITY_NAME = "ru.sberbank.mobile.external.InvoicingActivity";
 
                private static final String ORDER_UUID_KEY = "ru.sberbank.mobile.ORDER_UUID_KEY;
                private static final String RESULT_KEY = "ru.sberbank.mobile.RESULT_KEY";
                private static final String CALLBACK_INTENT_KEY = "ru.sberbank.mobile.CALLBACK_INTENT_KEY";
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBuyButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String orderUUID = mEribUid.getText().toString();
                                                               Intent invoicingIntent = new Intent();
                                                               invoicingIntent.setComponent(new ComponentName(SBERBANK_ONLINE_PACKAGE_NAME, SBERBANK_ONLINE_INVOICING_ACTIVITY_NAME));
                                                               invoicingIntent.putExtra(ORDER_UUID_KEY, orderUUID);
                startActivityForResult(invoicingIntent, REQUEST_CODE);
            }
        });
    }
                /**       
                * Result and an additional information withh be in data under RESULT_KEY
                */
                @Override
                protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//                           "SUCCESS" or "FAILURE"
                               String result = intent.getStringExtra(RESULT_KEY);
                }
}