@@ -27,7 +27,7 @@ class MainActivity : AppCompatActivity() {
2727
2828 val operator = HashMap <String ,Any >()
2929
30- operator .put(" publicKey" ,publicKey.toString() )
30+ operator .put(" publicKey" ," pk_test_6jdl4Qo0FYOSXmrZTR1U5EHp " )
3131 operator .put(" hashString" ,hashStringKey.toString())
3232 Log .e(" orderData" ," pbulc" + publicKey.toString() + " \n hash" + hashStringKey.toString())
3333 Log .e(" buttonKey" ," buttonKey" + buttonKey.toString())
@@ -173,43 +173,62 @@ class MainActivity : AppCompatActivity() {
173173 configuration.put(" invoice" ,invoice)
174174 configuration.put(" interface" ,interfacee)
175175 configuration.put(" post" ,post)
176- configuration.put(" redirect" ,redirect)
177176 configuration.put(" scope" ,scopeKey.toString())
178177 configuration.put(" transaction" ,transaction)
179-
180- findViewById<PayButton >(R .id.paybutton).initPayButton(this , configuration,
181- PayButtonType .valueOf(buttonKey.toString()),object : PayButtonStatusDelegate {
178+ PayButtonConfig .initPayButton(this ,configuration,PayButtonType .BENEFIT_PAY ,findViewById<PayButton >(R .id.paybutton))
179+ PayButtonConfig .addPayButtonStatusDelegate(object : PayButtonStatusDelegate {
182180 override fun onSuccess (data : String ) {
183- Toast .makeText(this @MainActivity," success $data " ,Toast .LENGTH_SHORT ).show()
181+ Toast .makeText(this @MainActivity," ready " ,Toast .LENGTH_SHORT ).show()
184182 }
185183
186184 override fun onError (error : String ) {
187- Toast .makeText(this @MainActivity," error $error " ,Toast .LENGTH_SHORT ).show()
188- Log .e(" error" ,error.toString())
189- }
190-
191- override fun onCancel () {
192- Toast .makeText(this @MainActivity," cancel" ,Toast .LENGTH_SHORT ).show()
193- }
194-
195- override fun onChargeCreated (data : String ) {
196- Toast .makeText(this @MainActivity," charge created $data " ,Toast .LENGTH_SHORT ).show()
197-
198- }
199-
200- override fun onClick () {
201- Toast .makeText(this @MainActivity," click" ,Toast .LENGTH_SHORT ).show()
185+ Toast .makeText(this @MainActivity," erorr" ,Toast .LENGTH_SHORT ).show()
202186 }
203187
204188 override fun onReady () {
205189 Toast .makeText(this @MainActivity," ready" ,Toast .LENGTH_SHORT ).show()
190+
206191 }
207192
208193 override fun onOrderCreated (data : String ) {
209- Toast .makeText(this @MainActivity," order created $data " ,Toast .LENGTH_SHORT ).show()
194+ Toast .makeText(this @MainActivity," order created" ,Toast .LENGTH_SHORT ).show()
210195 }
211196
212197 })
198+ //
199+ // findViewById<PayButton>(R.id.paybutton).initPayButton(this, configuration,
200+ // PayButtonType.valueOf(buttonKey.toString()),object : PayButtonStatusDelegate {
201+ // override fun onSuccess(data: String) {
202+ // Toast.makeText(this@MainActivity,"success $data",Toast.LENGTH_SHORT).show()
203+ // }
204+ //
205+ // override fun onError(error: String) {
206+ // Toast.makeText(this@MainActivity,"error $error",Toast.LENGTH_SHORT).show()
207+ // Log.e("error",error.toString())
208+ // }
209+ //
210+ // override fun onCancel() {
211+ // Toast.makeText(this@MainActivity,"cancel",Toast.LENGTH_SHORT).show()
212+ // }
213+ //
214+ // override fun onChargeCreated(data: String) {
215+ // Toast.makeText(this@MainActivity,"charge created $data",Toast.LENGTH_SHORT).show()
216+ //
217+ // }
218+ //
219+ // override fun onClick() {
220+ // Toast.makeText(this@MainActivity,"click",Toast.LENGTH_SHORT).show()
221+ // }
222+ //
223+ // override fun onReady() {
224+ // Toast.makeText(this@MainActivity,"ready",Toast.LENGTH_SHORT).show()
225+ // }
226+ //
227+ // override fun onOrderCreated(data: String) {
228+ // Toast.makeText(this@MainActivity,"order created $data",Toast.LENGTH_SHORT).show()
229+ // }
230+ //
231+ // })
213232
214233
215234
0 commit comments