Stripe Transactions
IMPORTANT
The PayButton Integration (Android) is in maintenance mode. For Android integrations, please use the new
Default UI Integration SDK.
This information is relevant only for applications that process transactions using Stripe as the clearing institute.
After completing integration you can enable your merchants to process Stripe transactions with the PayButton.
Use the
merchantIdentifier
and
merchantSecretKey
in your implementation. You can then start a payment and send additional parameters, such as a statement descriptor or metadata, to Stripe.
// Specify up to 20 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.
Make sure to use a
test card when testing your integration because live cards are not permitted on the test system. Transactions below GBP 0.30 will be declined by Stripe.
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
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();