Intent cloverTenderIntent = getIntent(); Long amount = cloverTenderIntent.getLongExtra(Intents.EXTRA_AMOUNT, 0); Long taxAmount = cloverTenderIntent.getLongExtra(Intents.EXTRA_TAX_AMOUNT, 0); String orderId = cloverTenderIntent.getStringExtra(Intents.EXTRA_ORDER_ID) Order order = cloverTenderIntent.getParcelableExtra(Intents.EXTRA_ORDER);
However order always returns null.
____________________________________
Edit
The full code is
@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mCloverTenderConnecter = new CloverTenderConnecter(this);
mCloverTenderConnecter.init();
Intent cloverTenderIntent = getIntent(); if (cloverTenderIntent != null && cloverTenderIntent.getAction().equals("clover.intent.action.MERCHANT_TENDER")) { CloverTransactionModel cloverTransaction = mCloverTenderConnecter.setCloverTransaction(cloverTenderIntent); } }
And my CloverTenderConnector class I have
public CloverTenderConnecter(Context context) { this.mContext = context;
this.mAccount = CloverAccount.getAccount(context);
this.mTenderConnector = new TenderConnector(context, mAccount, null);
}
public void init() {
mTenderConnector.connect();
} ...
public CloverTransactionModel setCloverTransaction(Intent intent) { return new CloverTransactionModel( intent.getLongExtra(Intents.EXTRA_AMOUNT, 0), intent.getLongExtra(Intents.EXTRA_TAX_AMOUNT, 0), intent.getStringExtra(Intents.EXTRA_ORDER_ID), intent.getStringExtra(Intents.EXTRA_MERCHANT_ID), intent.getParcelableExtra(Intents.EXTRA_ORDER) ); }
And here is what I have in my manifest.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pockeyt.cloverpay"> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<application android:name=".PockeytPay"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".ui.activities.MainActivity"
android:exported="true">
<intent-filter>
<action android:name="clover.intent.action.MERCHANT_TENDER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>