@@ -177,9 +177,44 @@ class MainActivity : AppCompatActivity() {
177177 configuration.put(" scope" ,scopeKey.toString())
178178 configuration.put(" transaction" ,transaction)
179179
180+ //
181+ // findViewById<PayButton>(R.id.paybutton).initPayButton(this, configuration,
182+ // PayButtonType.valueOf(buttonKey.toString()),object : PayButtonStatusDelegate {
183+ // override fun onSuccess(data: String) {
184+ // Toast.makeText(this@MainActivity,"success $data",Toast.LENGTH_SHORT).show()
185+ // }
186+ //
187+ // override fun onError(error: String) {
188+ // Toast.makeText(this@MainActivity,"error $error",Toast.LENGTH_SHORT).show()
189+ // Log.e("error",error.toString())
190+ // }
191+ //
192+ // override fun onCancel() {
193+ // Toast.makeText(this@MainActivity,"cancel",Toast.LENGTH_SHORT).show()
194+ // }
195+ //
196+ // override fun onChargeCreated(data: String) {
197+ // Toast.makeText(this@MainActivity,"charge created $data",Toast.LENGTH_SHORT).show()
198+ //
199+ // }
200+ //
201+ // override fun onClick() {
202+ // Toast.makeText(this@MainActivity,"click",Toast.LENGTH_SHORT).show()
203+ // }
204+ //
205+ // override fun onReady() {
206+ // Toast.makeText(this@MainActivity,"ready",Toast.LENGTH_SHORT).show()
207+ // }
208+ //
209+ // override fun onOrderCreated(data: String) {
210+ // Toast.makeText(this@MainActivity,"order created $data",Toast.LENGTH_SHORT).show()
211+ // }
212+ //
213+ // })
214+
215+ PayButtonConfig .initPayButton(this ,configuration,PayButtonType .KNET ,findViewById<PayButton >(R .id.paybutton))
180216
181- findViewById<PayButton >(R .id.paybutton).initPayButton(this , configuration,
182- PayButtonType .valueOf(buttonKey.toString()),object : PayButtonStatusDelegate {
217+ PayButtonConfig .addPayButtonStatusDelegate(object : PayButtonStatusDelegate {
183218 override fun onSuccess (data : String ) {
184219 Toast .makeText(this @MainActivity," success $data " ,Toast .LENGTH_SHORT ).show()
185220 }
@@ -213,41 +248,6 @@ class MainActivity : AppCompatActivity() {
213248 })
214249
215250
216- // //PayButtonConfig.addPayButtonStatusDelegate(object : PayButtonStatusDelegate {
217- // override fun onSuccess(data: String) {
218- // Toast.makeText(this@MainActivity,"success $data",Toast.LENGTH_SHORT).show()
219- // }
220- //
221- // override fun onError(error: String) {
222- // Toast.makeText(this@MainActivity,"error $error",Toast.LENGTH_SHORT).show()
223- // Log.e("error",error.toString())
224- // }
225- //
226- // override fun onCancel() {
227- // Toast.makeText(this@MainActivity,"cancel",Toast.LENGTH_SHORT).show()
228- // }
229- //
230- // override fun onChargeCreated(data: String) {
231- // Toast.makeText(this@MainActivity,"charge created $data",Toast.LENGTH_SHORT).show()
232- //
233- // }
234- //
235- // override fun onClick() {
236- // Toast.makeText(this@MainActivity,"click",Toast.LENGTH_SHORT).show()
237- // }
238- //
239- // override fun onReady() {
240- // Toast.makeText(this@MainActivity,"ready",Toast.LENGTH_SHORT).show()
241- // }
242- //
243- // override fun onOrderCreated(data: String) {
244- // Toast.makeText(this@MainActivity,"order created $data",Toast.LENGTH_SHORT).show()
245- // }
246- //
247- // })
248-
249- // PayButtonConfig.initPayButton(this,configuration, PayButtonType.valueOf(buttonKey.toString()), findViewById(R.id.paybutton))
250-
251251 }
252252
253253 private fun getPayButtonType (key : String ): PayButtonType {
0 commit comments