I have found the Vikas and he is amazing developer, he had always delivered the product under the timeline, on budget and with 100% accuracy, He is totally problem solving guys.
Receiving and Accepting/Rejecting items in a transaction using Escrow API
0 comments |

When worker completed his work and request for payment, you mark the applicable milestone items as received using Escrow API.
This will start the inspection period. If client do not accept or reject the items before the end of the inspection period, Escrow.com will automatically assume that you accept them.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.escrow.com/2017-09-01/transaction/1944203/item/2472773', CURLOPT_RETURNTRANSFER => 1, CURLOPT_USERPWD => 'broker@drupalchamp.org:233_57fgvc5vIpiqwp6B8Z2986vc4dsfsdftwxHlgpEtOeE5gRPuyzw', //client email:api key(api key must be generated from broker account) CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'As-Customer: client@drupalchamp.org', ), CURLOPT_CUSTOMREQUEST => 'PATCH', CURLOPT_POSTFIELDS => json_encode( array( 'action' => 'receive', ) ) )); $output = curl_exec($curl); echo $output; curl_close($curl); ?>
In above code CURLOPT_URL, 1944203 is transaction ID and 2472773 is milestone item ID.
If the API call is successful, it will return the updated transaction object.
stdClass Object ( [description] => Press release Details [fees] => Array ( [0] => stdClass Object ( [amount] => 1.91 [amount_without_taxes] => 1.91 [payer_customer] => client@drupalchamp.org [type] => credit_card ) [1] => stdClass Object ( [amount] => 2.04 [amount_without_taxes] => 2.04 [payer_customer] => client@drupalchamp.org [split] => 1.0 [type] => escrow ) ) [id] => 2525781 [inspection_period] => 1296000 [quantity] => 1 [schedule] => Array ( [0] => stdClass Object ( [amount] => 55.00 [beneficiary_customer] => worker@drupalchamp.org [payer_customer] => client@drupalchamp.org [status] => stdClass Object ( [disbursed_to_beneficiary] => [secured] => 1 ) ) ) [status] => stdClass Object ( [accepted] => [accepted_returned] => [canceled] => [in_dispute] => [received] => 1 [received_date] => 2019-07-11T11:01:52.340000+00:00 [received_returned] => [rejected] => [rejected_returned] => [shipped] => 1 [shipped_returned] => ) [title] => Press release Details [type] => milestone )
Accepting the items in a transaction allows us to release funds to the buyer in the transaction.
Accepting or rejecting the items must happen before the inspection period for the transaction completes as Escrow.com will automatically accept the goods on the buyer's behalf if the inspection period lapses.
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api.escrow.com/2017-09-01/transaction/1944203/item/2472773', CURLOPT_RETURNTRANSFER => 1, CURLOPT_USERPWD => 'broker@drupalchamp.org:233_57fgvc5vIpiqwp6B8Z2986vc4dsfsdftwxHlgpEtOeE5gRPuyzw', //client email:api key(api key must be generated from broker account) CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'As-Customer: client@drupalchamp.org', ), CURLOPT_CUSTOMREQUEST => 'PATCH', CURLOPT_POSTFIELDS => json_encode( array( 'action' => 'accept', //set the action value to reject if you want to reject the items in a transaction ) ) )); $output = curl_exec($curl); echo $output; curl_close($curl); ?>
In above code CURLOPT_URL, 1944203 is transaction ID and 2472773 is milestone item ID.
If the API call is successful, it will return the updated transaction object.
stdClass Object ( [description] => Press release Details [fees] => Array ( [0] => stdClass Object ( [amount] => 1.91 [amount_without_taxes] => 1.91 [payer_customer] => client@drupalchamp.org [type] => credit_card ) [1] => stdClass Object ( [amount] => 2.04 [amount_without_taxes] => 2.04 [payer_customer] => client@drupalchamp.org [split] => 1.0 [type] => escrow ) ) [id] => 2525781 [inspection_period] => 1296000 [quantity] => 1 [schedule] => Array ( [0] => stdClass Object ( [amount] => 55.00 [beneficiary_customer] => worker@drupalchamp.org [payer_customer] => client@drupalchamp.org [status] => stdClass Object ( [disbursed_to_beneficiary] => [secured] => 1 ) ) ) [status] => stdClass Object ( [accepted] => 1 [accepted_returned] => [canceled] => [in_dispute] => [received] => 1 [received_date] => 2019-07-11T11:01:52.340000+00:00 [received_returned] => [rejected] => [rejected_returned] => [shipped] => 1 [shipped_returned] => ) [title] => Press release Details [type] => milestone )
Add new comment