示例#1
0
        public override ApiInfo GetStatus( Order order, IDictionary<string, string> settings )
        {
            try {
            order.MustNotBeNull( "order" );
            settings.MustNotBeNull( "settings" );
            settings.MustContainKey( "mode", "settings" );
            settings.MustContainKey( settings[ "mode" ] + "_secret_key", "settings" );

            StripeChargeService chargeService = new StripeChargeService( settings[ settings[ "mode" ] + "_secret_key" ] );
            StripeCharge charge = chargeService.Get( order.TransactionInformation.TransactionId );

            return new ApiInfo( charge.Id, GetPaymentState( charge ) );
              } catch ( Exception exp ) {
            LoggingService.Instance.Log( exp, "Stripe(" + order.OrderNumber + ") - GetStatus" );
              }

              return null;
        }