Problems with webpay cooperation

Problems with webpay, Django, Angularjs integration

checkout helper button is not displayed after the second time

--In the case of SPA, the button is no longer displayed after the second time due to the phenomenon that the webpay script is not read every time. --Solution: Add the following code

$scope.init = function() {
    window.WebPay = void(0);
    window.WebPayCheckoutHelper = void(0);
}

Difference between webpay public key and secret key

――I couldn't find the difference between the two keys for a long time. --publick_key: key to display checkout helper button on templete side --secret_key: The key to be passed as a request parameter on the server side when making a payment with the acquired customer_id or token (don't show it)

Separation process of webpay key in production environment and local environment

--I want to set the key by judging the following on the server side --In production, "data-key =" live_public_234u32942342 ... " --In the local environment, "data-key =" test_public_jfi443of34f ... "

I thought that I could do it as follows, but I was able to go hard coding, but when the server processing runs, the script processing is executed first and an error occurs without the key

  <script class="webpay-button"
          data-key="[[form_data.webpay_key]]"
          data-lang="ja"
          data-partial="true"
          data-text="Enter card information"
          data-submit-text="Card information input completed"
          src="https://checkout.webpay.jp/v3/"</script>

The solution is to set data-key = "[[form_data.webpay_key]]" before getting the key on the server.

Other

――Isn't webpay very suitable for SPA?

As mentioned above, I had a problem with webpay cooperation.

Recommended Posts

Problems with webpay cooperation
Problems with installing Scrapy
nwdiag Problems with offline installation
Solving 4-color problems with combinatorial optimization
Solve AtCoder Problems Recommendation with python (20200517-0523)
Precautions when solving DP problems with Python