question

rthor avatar image
rthor asked Greg commented

Open specific transaction in Transactions app

Opening up the Transactions app is done by:
Intent intent = getPackageManager().getLaunchIntentForPackage("com.clover.transactions");
startActivity(intent);
Can this be modified to open up a specific transaction? We are using secure pay and, although there is no option to text/email a receipt via the SDK, figure this may be the only viable alternative to get this option to the customer.
PaymentsPrint
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sam avatar image
sam Deactivated answered Greg commented
Please use our Transaction Intent to launch the Transaction App
You have the option of passing one of the three:
  • EXTRA_PAYMENT - the Payment object that will be shown
  • EXTRA_CREDIT - the Credit (manual refund) object that will be shown
  • EXTRA_REFUND - the Refund object that will be shown
Intent i = new Intent(Intents.ACTION_START_TRANSACTION_DETAIL);
i.putExtra(Intent.EXTRA_PAYMENT, paymentObject);
startActivity(i);
4 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sukhbir Singh avatar image Sukhbir Singh commented ·

But when we open Transaction details screen by passing payment object its disable refund button

0 Likes 0 ·
keithryanwong avatar image keithryanwong Sukhbir Singh commented ·

Hi @sanjayprasad, can you elaborate?

0 Likes 0 ·
Sukhbir Singh avatar image Sukhbir Singh keithryanwong commented ·

Thanks for your response.

After making payment using ACTION_SECURE_PAY we got Payment object in response and when we pass that payment object to open Transaction details screen its open but refund button is always disable. But if we open default transaction app and then refresh the list and then we send the payment object to open Transactions details screen then refund button is enable, here my query is that, is there any way to refresh the transaction list programatically without open default transaction app. Please let me know.

0 Likes 0 ·
Show more comments
Sukhbir Singh avatar image
Sukhbir Singh answered Greg commented
@Greg Thanks
I have implemented Action secure pay to make payment and after successfully we send the payment details to our local server and we fetch the records from local server and then after clicking any of them we are using intents for open Transactions details screen by passing payment object but that time Refund button is always in disable but in case if we manually open the default transaction app then we pass the payment data for the same that time refund button is enable and i am able to perform refund. Is it possible to handle this requirement with the help of payment connector.
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Greg avatar image Greg commented ·

@sanjay, payment connector essentially provides endpoints for transaction actions (sale, auth, void, refund, etc.) It will be a wrapper around the manual intents. If you are opening up the transactions app just to process refunds, then payment connector will allow you to refund payments directly (invoke refund intent) without opening up the transactions app at all.

0 Likes 0 ·
Sukhbir Singh avatar image
Sukhbir Singh answered Greg commented
@Greg Thanks for your response.
Could you please provide some sample code for how to refund transaction using payment connector and without opening the default transaction app.
5 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Greg avatar image Greg commented ·

Hi @sanjay,

Here is the payment connector class code from our public repo.

Here is a snippet of what a paymentconnector setup would look like inside an activity. Basically you would keep a paymentconnector object that has a paymentconnectorlistener object inside to respond to callbacks (like onRefundPayment), and invoke paymentconnector methods. We are working on getting full documentation out soon. Hope that helps.

Greg

0 Likes 0 ·
Sukhbir Singh avatar image Sukhbir Singh Greg commented ·

@Greg Thanks

Currently I am using below dependency but unable to find paymentconnector, could you please suggest which dependency we use for the paymentconnector or we integrate the clover-connector-sdk for the same.

com.clover.sdk:clover-android-sdk:latest.release
0 Likes 0 ·
Greg avatar image Greg Sukhbir Singh commented ·

Hi @sanjay,

Right, the payment connector uses another clover sdk, the clover-android-connector-sdk. For reference, The dependencies I had for this previous snippet was:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.clover.sdk:clover-android-sdk:191.4'
    implementation 'com.clover.sdk:clover-android-connector-sdk:191.4'
}

Greg

0 Likes 0 ·
Show more comments

Welcome to the
Clover Developer Community