Skip to content

raqeta/yandex-money-sdk-android

 
 

Repository files navigation

Yandex.Money SDK for Android

Overview

This library provides tools for performing payments on devices running Android 4.0 (API 14) or higher.

Features:

  • default activity for payment process;
  • handling of payment process in an IntentService;
  • handling of application's instance id;
  • storing of saved cards.

The library uses Yandex.Money SDK for Java.

Usage

The simpliest way of using this library is to show PaymentActivity passing corresponding payment parameters. Payment process will be handled by the library. When done calling activity will receive RESULT_OK or RESULT_CANCELED depending on operation success.

For example, if you want to pay for a phone, you can do it like this:

public class MyActivity extends Activity implement View.OnClickListener {

	private static final String CLIENT_ID = "[your_client_id]";
	private static final int REQUEST_CODE = 1;

	...

	@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    	if (requestCode == REQUEST_CODE && resultCode = RESULT_OK) {
    		// payment was successful
    	}
    }

    ...

	@Override
	public void onClickListener(View v) {
		PaymentActivity.startForResult(MyActivity.this, CLIENT_ID,
			new ParamsPhone("79012345678", new BigDecimal(100.0)), REQUEST_CODE);
	}
}

It is also possible to use this library partially, for example if you want your own implementation of UI elements.

Sample Project

The library contains sample project in module sample.

To run this sample project you should enter valid clientId in PayActivity. To obtain client id please visit this page (also available in Russian).

Links

  1. Yandex.Money API (in English, in Russian)
  2. Yandex.Money SDK for Java

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%