예제 #1
0
        public static Capture GetCapture(APIContext apiContext, Authorization authorization)
        {
            // ###Amount
            // Let's you specify a capture amount.
            Amount amnt = new Amount();
            amnt.currency = "USD";
            amnt.total = "1.00";

            Capture capture = new Capture();
            capture.amount = amnt;

            // ##IsFinalCapture
            // If set to true, all remaining 
            // funds held by the authorization 
            // will be released in the funding 
            // instrument. Default is ‘false’.
            capture.is_final_capture = true;

            // Capture by POSTing to
            // URI v1/payments/authorization/{authorization_id}/capture
            Capture responseCapture = authorization.Capture(apiContext, capture);

            return responseCapture;
        }
        private string GetCaptureId(string accessToken, Authorization authorization)
        {
            // ###Amount
            // Let's you specify a capture amount.
            Amount amnt = new Amount();
            amnt.currency = "USD";
            amnt.total = "4.54";

            Capture capture = new Capture();
            capture.amount = amnt;

            // ##IsFinalCapture
            // If set to true, all remaining
            // funds held by the authorization
            // will be released in the funding
            // instrument. Default is ‘false’.
            capture.is_final_capture = true;

            // Capture by POSTing to
            // URI v1/payments/authorization/{authorization_id}/capture
            Capture responseCapture = authorization.Capture(accessToken, capture);

            return responseCapture.id;
        }