Skip to content

Commit 47eb60e

Browse files
committed
added payButtons checker
1 parent a34c5f8 commit 47eb60e

File tree

11 files changed

+89
-55
lines changed

11 files changed

+89
-55
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
1.96 KB
Binary file not shown.
0 Bytes
Binary file not shown.

.gradle/file-system.probe

0 Bytes
Binary file not shown.

.idea/workspace.xml

Lines changed: 28 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/company/tap/paybutton/MainActivity.kt

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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() + " \nhash" + 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

tappaybutton/src/main/java/company/tap/tappaybutton/PayButton.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ class PayButton :LinearLayout {
4141
*/
4242
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
4343

44-
init {
45-
View.inflate(context, R.layout.pay_button_layout,this)
46-
47-
}
48-
4944

5045
fun initPayButton(
5146
context: Context,

0 commit comments

Comments
 (0)