stripe not working.NullReferenceExceptionObject reference not set to an instance of an object

Thibaut Fabrice 20 Reputation points
2024-11-18T05:47:17.8866667+00:00

Hi,

Thanks for the help. However, My stripe is not loading. Any help. There is an error: Object not set to an instance of an object.

Screenshot (460)

Github Link:https://github.com/Thibaut501/Mango

Awaiting your reply,

Best Regards,

Fabrice

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,089 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Hongrui Yu-MSFT 3,015 Reputation points Microsoft Vendor
    2024-11-18T08:55:26.0066667+00:00

    Hi,@Thibaut Fabrice. Welcome to Microsoft Q&A. 

    Correct the name below:

    First

    Picture1

    public double O5rderTotal { get; set; }
    

    To

    public double OrderTotal { get; set; }
    

    Second

    In the Mango_Order database, the O5rderTotal of dbo.OrderHeaders should also be changed to OrderTotal.Picture2

    Third

    Picture3

    config.CreateMap<OrderDetailsDto, OrderDetailsDto>().ReverseMap();
    

    To

    config.CreateMap<OrderDetails, OrderDetailsDto>().ReverseMap();
    

    FourthPicture5

    StripeRequestDto  stripeResponseResult = JsonConvert.DeserializeObject<StripeRequestDto>
                        (Convert.ToString(response.Result));
    

    To

    StripeRequestDto  stripeResponseResult = JsonConvert.DeserializeObject<StripeRequestDto>
        (Convert.ToString(stripeResponse.Result));
    

    Use the correct SecretKey

    First

    In my test, the SecretKey in your project seems to be unavailable. I used the SecretKey on the official website for testing.Picture4

    "SecretKey": "sk_test_tR3PYbcVNZZ796tH88S4VQ2u"
    

    You could use the above SecretKey for testing. It is better to get your own SecretKey from the official website.

    Operation Results:

    Picture6


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.