Welcome to FindNerd. Today we are going to discuss the creation of transaction. We use the sale function for transaction creation. You need to pass the amount,customer id,
and nonce from client side. Please have a look.
$result = Braintree_Transaction::sale([
'amount' => '10.00',
'paymentMethodNonce' => nonceFromTheClient,
'customer' => [
'id' => 'a_customer_id'
],
'options' => [
'storeInVaultOnSuccess' => true,
]
]);
In above example we are creating transaction with amount $10 and storing in customer vault.
0 Comment(s)