const result = await payments.create({
provider: 'pagar_me',
source: {
amount: 10000,
currency: 'BRL',
customer: { id: 'cus_abc123' },
payment_method: {
type: 'card',
card_token: 'tok_xyz',
billing_address: {
house_number: '100',
street_number: '1',
street_name: 'Rua Example',
postal_code: '01001000',
city: 'Sao Paulo',
state: 'SP',
country_code: 'BR',
},
},
capture_method: 'automatic', // or 'manual' for two-step capture
fraud_check: {
enabled: true,
provider: 'konduto',
config: { sequence: 'fraud_before_auth', threshold: 'medium', action_on_fail: 'CANCEL_AUTH' },
data: {
last_four_digits: '4242',
card_expiration_date: '12/2027',
card_holder_name: 'Alice Smith',
},
},
},
confirm: true,
});