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.
MPTransactionParameters *parameters = [MPTransactionParameters chargeWithAmount:[NSDecimalNumber decimalNumberWithString:@"10.00"] currency:MPCurrencyGBP optionals:^(id optionals) { // This subject will appear as the Description in the Stripe Dashboard optionals.subject = @"Bouquet of Flowers"; // Specify a Statement Descriptor optionals.statementDescriptor = @"Bouquet"; // Specify up to 17 key-value pairs (See https://stripe.com/docs/api#metadata) optionals.metadata = @{ @"Source" : @"POS", @"Clerk Name" : @"John Appleseed" }; }];
All transactions will immediately appear in your Stripe Dashboard.
Accessing the Stripe Charge ID
If you need the Stripe Charge ID for a transaction, you can get it via
MPTransaction
in the
completed
block:
NSString *stripeChargeId = [[transaction clearingDetails] transactionIdentifier];
You can also query the transaction from your backend. Locate it in the
clearingDetails.transactionIdentifier
property.
Collecting an Application Fee with Stripe Connect
When using Stripe Connect your platform 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:
MPTransactionParameters *parameters = [MPTransactionParameters chargeWithAmount:[NSDecimalNumber decimalNumberWithString:@"10.00"] currency:MPCurrencyGBP optionals:^(id optionals) { // This subject will appear as the Description in the Stripe Dashboard optionals.subject = @"Bouquet of Flowers"; // Specify a Statement Descriptor optionals.statementDescriptor = @"Bouquet";
// Specify the Application Fee you want to receive (e.g. 1.23 equals 123 pence) optionals.applicationFee = [NSDecimalNumber decimalNumberWithString:@"1.23"];
// Specify up to 17 key-value pairs (See https://stripe.com/docs/api#metadata) optionals.metadata = @{ @"Source" : @"POS", @"Clerk Name" : @"John Appleseed" }; }];
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();
You can also query the transaction from your backend. Locate it in the
clearingDetails.transactionIdentifier
property.
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();