Processing Stripe Transactions
These instructions are only relevant for applications that process transactions with Stripe as the clearing institute.
You can process Stripe transactions in your custom integration.
After integration, make sure to
attach a Stripe processing path to your merchants and use the
merchantIdentifier
and
merchantSecretKey
in your implementation.
Make sure to use a
test card when testing your integration because using a live card is not permitted on the test system. Transactions below GBP 0.30 will be declined by Stripe.
You can then start a payment and also send additional parameters toward Stripe like a statement descriptor or metadata.
// Specify up to 17 key-value pairs (See https://stripe.com/docs/api#metadata)
Map metadata = new HashMap();
metadata.put("Source","POS");
metadata.put("Clerk Name", "John Appleseed");
TransactionParameters parameters =
new TransactionParameters.Builder()
.charge(new BigDecimal("10.00"), Currency.GBP)
// This subject will appear as the Description in the Stripe Dashboard
.subject("Bouquet of Flowers")
// Specify a Statement Descriptor
.statementDescriptor("Bouquet")
.metadata(metadata)
.build();
All transactions will immediately appear in your Stripe Dashboard.
Accessing the Stripe Charge ID
Use
Transaction
in the
onActivityResult
method:
Transaction transaction = MposUi.getInitializedInstance().getTransaction();
String stripeChargeId = transaction.getClearingDetails().getTransactionIdentifier();
Collecting an Application Fee with Stripe Connect
When using Stripe Connect your platform, you can easily
collect an application fee from your merchants. For instructions on how to use Stripe Connect together with your integration, see
this page.
Provide the
applicationFee
parameter in addition to the other parameters:
// Specify up to 17 key-value pairs (See https://stripe.com/docs/api#metadata)
Map metadata = new HashMap();
metadata.put("Source","POS");
metadata.put("Clerk Name", "John Appleseed");
TransactionParameters parameters =
new TransactionParameters.Builder()
.charge(new BigDecimal("10.00"), Currency.GBP)
// This subject will appear as the Description in the Stripe Dashboard
.subject("Bouquet of Flowers")
// Specify a Statement Descriptor
.statementDescriptor("Bouquet")
// Specify the Application Fee you want to receive (e.g. 1.23 equals 123 pence)
.applicationFee(new BigDecimal("1.23"))
.metadata(metadata)
.build();