Skip to content

Instantly share code, notes, and snippets.

@karldanninger
Created March 20, 2018 22:55
Show Gist options
  • Save karldanninger/22b4986e1a2534c4db48df0997d6bb77 to your computer and use it in GitHub Desktop.
Save karldanninger/22b4986e1a2534c4db48df0997d6bb77 to your computer and use it in GitHub Desktop.
Destination Charge vs Direct Charge
console.log(token);
const result = await stripe.charges.create(
{
amount: payment.amount,
currency: 'cad',
description: 'some description',
source: token.tokenId,
metadata: { paymentId },
statement_descriptor: 'some statement', // TODO: --> `${locationName}`
// stripe connect fields
// application_fee: fee,
destination: {
amount: payment.amount - fee,
account: partnerStripeAccount,
},
},
// {
// stripe_account: partnerStripeAccount,
// },
);
// SERVER RESPONSE FROM CONSOLE.LOG ON LINE 1
// { livemode: false,
// card:
// { addressLine1: '123 Maple Street',
// country: 'US',
// name: 'Test User',
// addressCountry: 'CA',
// addressZip: 'N1G2E5',
// addressCity: 'Maple City',
// cardId: 'card_1C7tJCDQENpMtOauqE8c73dW',
// brand: 'Visa',
// isApplePayCard: false,
// addressState: 'Ontario',
// last4: '4242',
// addressLine2: 'Apt. 5',
// funding: 'credit',
// expYear: 2024,
// expMonth: 4 },
// created: 1521586318,
// tokenId: 'tok_1C7tJCDQENpMtOau56gBXGOj' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment